Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.

Commit 6679819

Browse files
committed
retune v2
1 parent 598f58c commit 6679819

8 files changed

Lines changed: 61 additions & 9 deletions

File tree

src/main/kotlin/com/frcteam3636/frc2025/Dashboard.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ enum class AutoModes(val autoName: String, val developerAuto: Boolean = false, v
3636
TestAutoOneCoral("Test Auto 1 Coral", true, false),
3737
TestAutoTwoCoral("Test Auto 2 Coral", true, false),
3838
TestAutoThreeCoral("Test Auto 3 Coral", true, false),
39+
TestAutoFourCoral("Test Auto 4 Coral", true, false),
3940
}

src/main/kotlin/com/frcteam3636/frc2025/Robot.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ object Robot : LoggedRobot() {
317317
AutoModes.TestAutoOneCoral -> TestAuto().autoSequence()
318318
AutoModes.TestAutoTwoCoral -> TestAutoTwoCoral().autoSequence()
319319
AutoModes.TestAutoThreeCoral -> TestAutoThreeCoral().autoSequence()
320+
AutoModes.TestAutoFourCoral -> TestAutoFourCoral().autoSequence()
320321
AutoModes.None -> Commands.none()
321322
}
322323
}
@@ -336,6 +337,7 @@ object Robot : LoggedRobot() {
336337
AutoModes.TestAutoOneCoral -> TestAuto().autoSequence()
337338
AutoModes.TestAutoTwoCoral -> TestAutoTwoCoral().autoSequence()
338339
AutoModes.TestAutoThreeCoral -> TestAutoThreeCoral().autoSequence()
340+
AutoModes.TestAutoFourCoral -> TestAutoFourCoral().autoSequence()
339341
AutoModes.None -> Commands.none()
340342
}
341343
}

src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/Drivetrain.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ object Drivetrain : Subsystem {
668668
Pose2d(target.translation, heading)
669669
)
670670

671-
val constraints = PathConstraints(10.0, 3.0, 2 * Math.PI, 4 * Math.PI)
671+
val constraints = AutoMode.DEFAULT_AUTO_CONSTRAINTS
672672

673673
val constraintZone = ConstraintsZone(
674674
0.85, 1.0, AutoMode.DEFAULT_AUTO_CONSTRAINTS_SLOW_ZONE
@@ -859,7 +859,7 @@ object Drivetrain : Subsystem {
859859
val BRAKE_POSITION = MODULE_POSITIONS.map { position -> SwerveModuleState(0.0, position.translation.angle) }
860860

861861

862-
val ALIGN_TRANSLATION_PID_GAINS = PIDGains(16.0)
862+
val ALIGN_TRANSLATION_PID_GAINS = PIDGains(21.0)
863863
val ALIGN_ROTATION_PID_GAINS = PIDGains(5.0)
864864
}
865865
}

src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/autos/TestAuto.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ class TestAuto() : AutoMode() {
1313
val reefPose = AprilTagTarget(18, ReefBranchSide.Right).pose
1414

1515
return Commands.sequence(
16-
Drivetrain.driveToPointAllianceRelativeWithSlowZone(
16+
Drivetrain.driveToPointAllianceRelativeWithSlowConstraintZone(
1717
reefPose,
1818
DEFAULT_AUTO_CONSTRAINTS,
1919
DEFAULT_AUTO_CONSTRAINTS_SLOW_ZONE,
2020
SLOW_ZONE_DISTANCE,
21-
SLOW_ZONE_ENTER_VELOCITY
2221
),
2322
Manipulator.outtake().withTimeout(OUTTAKE_TIMEOUT),
2423
Elevator.setTargetHeight(Elevator.Position.Stowed).onlyIf { shouldAutoStow },
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package com.frcteam3636.frc2025.subsystems.drivetrain.autos
2+
3+
import com.frcteam3636.frc2025.subsystems.drivetrain.Drivetrain
4+
import com.frcteam3636.frc2025.subsystems.drivetrain.poi.AprilTagTarget
5+
import com.frcteam3636.frc2025.subsystems.drivetrain.poi.ReefBranchSide
6+
import com.frcteam3636.frc2025.subsystems.elevator.Elevator
7+
import com.frcteam3636.frc2025.subsystems.funnel.Funnel
8+
import com.frcteam3636.frc2025.subsystems.manipulator.CoralState
9+
import com.frcteam3636.frc2025.subsystems.manipulator.Manipulator
10+
import com.frcteam3636.frc2025.utils.math.meters
11+
import edu.wpi.first.math.geometry.Pose2d
12+
import edu.wpi.first.math.geometry.Rotation2d
13+
import edu.wpi.first.wpilibj2.command.Command
14+
import edu.wpi.first.wpilibj2.command.Commands
15+
16+
class TestAutoFourCoral : AutoMode() {
17+
override fun autoSequence(shouldAutoStow: Boolean): Command {
18+
val reefPose = AprilTagTarget(18, ReefBranchSide.Right).pose
19+
val pickupPose = Pose2d(1.251.meters, 4.034.meters, Rotation2d.kZero)
20+
21+
return Commands.sequence(
22+
TestAutoThreeCoral().autoSequence(false),
23+
Commands.parallel(
24+
Elevator.setTargetHeight(Elevator.Position.Stowed),
25+
Drivetrain.driveToPointAllianceRelative(pickupPose, DEFAULT_AUTO_CONSTRAINTS)
26+
),
27+
Commands.parallel(
28+
Commands.sequence(
29+
Commands.race(
30+
Commands.waitUntil {
31+
Manipulator.coralState != CoralState.NONE
32+
},
33+
Commands.waitSeconds(5.0)
34+
),
35+
Drivetrain.driveToPointAllianceRelativeWithSlowConstraintZone(
36+
reefPose,
37+
DEFAULT_AUTO_CONSTRAINTS,
38+
DEFAULT_AUTO_CONSTRAINTS_SLOW_ZONE,
39+
SLOW_ZONE_DISTANCE,
40+
raisePoint = Elevator.Position.MidBar
41+
),
42+
),
43+
Commands.race(
44+
Manipulator.intakeAuto(),
45+
Funnel.intake()
46+
).withTimeout(5.0),
47+
),
48+
Manipulator.outtake().withTimeout(OUTTAKE_TIMEOUT),
49+
Elevator.setTargetHeight(Elevator.Position.Stowed).onlyIf { shouldAutoStow },
50+
)
51+
}
52+
}

src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/autos/TestAutoThreeCoral.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ class TestAutoThreeCoral() : AutoMode() {
3232
},
3333
Commands.waitSeconds(5.0)
3434
),
35-
Drivetrain.driveToPointAllianceRelativeWithSlowZone(
35+
Drivetrain.driveToPointAllianceRelativeWithSlowConstraintZone(
3636
reefPose,
3737
DEFAULT_AUTO_CONSTRAINTS,
3838
DEFAULT_AUTO_CONSTRAINTS_SLOW_ZONE,
3939
SLOW_ZONE_DISTANCE,
40-
SLOW_ZONE_ENTER_VELOCITY,
4140
raisePoint = Elevator.Position.MidBar
4241
),
4342
),

src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/autos/TestAutoTwoCoral.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@ class TestAutoTwoCoral() : AutoMode() {
3232
},
3333
Commands.waitSeconds(INTAKE_TIMEOUT)
3434
),
35-
Drivetrain.driveToPointAllianceRelativeWithSlowZone(
35+
Drivetrain.driveToPointAllianceRelativeWithSlowConstraintZone(
3636
reefPose,
3737
DEFAULT_AUTO_CONSTRAINTS,
3838
DEFAULT_AUTO_CONSTRAINTS_SLOW_ZONE,
3939
SLOW_ZONE_DISTANCE,
40-
SLOW_ZONE_ENTER_VELOCITY
4140
),
4241
),
4342
Commands.race(

src/main/kotlin/com/frcteam3636/frc2025/subsystems/drivetrain/poi/AlignTargets.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,4 +283,4 @@ private enum class FieldOffset(val distance: Distance) {
283283
}
284284
}
285285

286-
private val REEF_DISTANCE_OFFSET = (0.75).inches
286+
private val REEF_DISTANCE_OFFSET = 0.5.inches

0 commit comments

Comments
 (0)