File tree Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Expand file tree Collapse file tree 3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ public class BiscuitConstants {
3333 public static final double kSafeToStowUpper = 40 ;
3434 public static final double kSafeToStowLower = -5 ;
3535
36+ // Speeds
37+ public static final double kDosntHaveAlgaeSpeed = 500 ;
38+
3639 // Setpoints
3740 // Idle
3841 public static final Angle kStowSetpoint = Rotations .of (1.862 );
@@ -125,7 +128,7 @@ public static TalonFXSConfiguration getFXSConfig() {
125128
126129 MotionMagicConfigs motionMagic =
127130 new MotionMagicConfigs ()
128- .withMotionMagicAcceleration (500 )
131+ .withMotionMagicAcceleration (kDosntHaveAlgaeSpeed )
129132 .withMotionMagicCruiseVelocity (100 )
130133 .withMotionMagicExpo_kA (0 )
131134 .withMotionMagicExpo_kV (0 )
Original file line number Diff line number Diff line change 33import edu .wpi .first .units .measure .Angle ;
44import org .littletonrobotics .junction .AutoLog ;
55import org .strykeforce .telemetry .TelemetryService ;
6+ import com .ctre .phoenix6 .configs .MotionMagicConfigs ;
67
78public interface BiscuitIO {
89
@@ -15,6 +16,10 @@ public class BiscuitIOInputs {
1516 public boolean didZero ;
1617 }
1718
19+ public default void hasAlgae (boolean enabled ) {}
20+
21+ public default void doesntHaveAlgae (boolean enabled ) {}
22+
1823 public default void setPosition (Angle position ) {}
1924
2025 public default void updateInputs (BiscuitIOInputs inputs ) {}
Original file line number Diff line number Diff line change @@ -92,4 +92,24 @@ public void zero() {
9292 logger .info ("Set Biscuit position to " + setPos );
9393 didZero = true ;
9494 }
95+
96+ @ Override
97+ public void hasAlgae (boolean enabled ) {
98+ talonfxs
99+ .getConfigurator ()
100+ .apply (
101+ BiscuitConstants .getFXSConfig ()
102+ .MotionMagicConfigs
103+ .withMotionMagicAcceleration (BiscuitConstants .kHasAlgaeSpeed ));
104+ }
105+
106+ @ Override
107+ public void doesntHaveAlgae (boolean enabled ) {
108+ talonfxs
109+ .getConfigurator ()
110+ .apply (
111+ BiscuitConstants .getFXSConfig ()
112+ .MotionMagicConfigs
113+ .withMotionMagicAcceleration (BiscuitConstants .kDoesntHaveAlgaeSpeed ));
114+ }
95115}
You can’t perform that action at this time.
0 commit comments