Skip to content

Commit 4d98660

Browse files
authored
Merge branch 'master' into pre-vaale
2 parents 827291e + 84d4ea8 commit 4d98660

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

src/main/kotlin/com/team4099/robot2026/RobotContainer.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ import com.team4099.robot2026.util.driver.Jessika
5252
import edu.wpi.first.wpilibj.RobotBase
5353
import edu.wpi.first.wpilibj2.command.ConditionalCommand
5454
import edu.wpi.first.wpilibj2.command.InstantCommand
55+
import edu.wpi.first.wpilibj2.command.SequentialCommandGroup
56+
import edu.wpi.first.wpilibj2.command.WaitCommand
5557
import org.ironmaple.simulation.SimulatedArena
5658
import org.ironmaple.simulation.drivesims.SwerveDriveSimulation
5759
import org.ironmaple.simulation.seasonspecific.rebuilt2026.Arena2026Rebuilt
@@ -216,7 +218,15 @@ object RobotContainer {
216218
ControlBoard.prepClimb.onTrue(superstructure.requestPrepClimbCommand())
217219
ControlBoard.climb.onTrue(superstructure.requestClimbCommand())
218220

219-
ControlBoard.intake.onTrue(superstructure.requestIntakeCommand())
221+
ControlBoard.intake.onTrue(
222+
ConditionalCommand(
223+
SequentialCommandGroup(
224+
superstructure.runOnce { superstructure.jigglingIntake = true },
225+
WaitCommand(0.5),
226+
superstructure.runOnce { superstructure.jigglingIntake = false }),
227+
superstructure.requestIntakeCommand()) {
228+
superstructure.currentState == Superstructure.Companion.SuperstructureStates.INTAKE
229+
})
220230
ControlBoard.forceIntakeFullUp.whileTrue(
221231
superstructure.requestForceIntakeCommand(IntakeConstants.ANGLES.FORCE_UP_ANGLE))
222232
ControlBoard.forceIntakeHalfUp.whileTrue(

src/main/kotlin/com/team4099/robot2026/config/constants/IntakeConstants.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ object IntakeConstants {
6868
val FORCE_DOWN_ANGLE = -30.degrees
6969

7070
val RESET_INTAKE_ANGLE = INTAKE_ANGLE - 3.degrees
71+
val INTAKING_JIGGLE_ANGLE = INTAKE_ANGLE + 40.degrees
7172
}
7273

7374
object PID {
@@ -76,7 +77,7 @@ object IntakeConstants {
7677
val REAL_PIVOT_KI: IntegralGain<Radian, Volt> = 0.0.volts / (1.0.radians * 1.0.seconds)
7778
val REAL_PIVOT_KD: DerivativeGain<Radian, Volt> = 0.0.volts / 1.0.radians.perSecond
7879

79-
val SIM_PIVOT_KP: ProportionalGain<Radian, Volt> = .1.volts / 1.0.radians
80+
val SIM_PIVOT_KP: ProportionalGain<Radian, Volt> = 5.volts / 1.0.radians
8081
val SIM_PIVOT_KI: IntegralGain<Radian, Volt> = 0.0.volts / (1.0.radians * 1.0.seconds)
8182
val SIM_PIVOT_KD: DerivativeGain<Radian, Volt> = 0.0.volts / 1.0.radians.perSecond
8283

src/main/kotlin/com/team4099/robot2026/subsystems/superstructure/Superstructure.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ class Superstructure(
6161

6262
val field = Field2d()
6363

64+
var jigglingIntake = false
65+
6466
init {
6567
SmartDashboard.putData("Field", field)
6668
}
@@ -244,7 +246,9 @@ class Superstructure(
244246
intakeRollers.currentRequest =
245247
Request.RollersRequest.OpenLoop(RollersConstants.INTAKE_VOLTAGE)
246248
intake.currentRequest =
247-
Request.IntakeRequest.TargetingPosition(IntakeConstants.ANGLES.INTAKE_ANGLE)
249+
Request.IntakeRequest.TargetingPosition(
250+
if (jigglingIntake) IntakeConstants.ANGLES.INTAKING_JIGGLE_ANGLE
251+
else IntakeConstants.ANGLES.INTAKE_ANGLE)
248252

249253
when (currentRequest) {
250254
is SuperstructureRequest.Idle -> nextState = SuperstructureStates.IDLE

0 commit comments

Comments
 (0)