This repository was archived by the owner on Jan 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/main/java/frc/robot/arm Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,22 @@ protected void afterTransition(ArmState newState) {
195
195
public void robotPeriodic () {
196
196
super .robotPeriodic ();
197
197
198
+ switch (getState ()) {
199
+ case SPEAKER_SHOT -> {
200
+ var newAngle =
201
+ Units .degreesToRotations (clamp (speakerDistanceToAngle .get (distanceToSpeaker )));
202
+ leftMotor .setControl (positionRequest .withPosition (newAngle ));
203
+ rightMotor .setControl (positionRequest .withPosition (newAngle ));
204
+ }
205
+ case FEEDING -> {
206
+ double newAngle =
207
+ Units .degreesToRotations (clamp (feedSpotDistanceToAngle .get (distanceToFeedSpot )));
208
+ leftMotor .setControl (positionRequest .withPosition (newAngle ));
209
+ rightMotor .setControl (positionRequest .withPosition (newAngle ));
210
+ }
211
+ default -> {}
212
+ }
213
+
198
214
DogLog .log ("Arm/Left/StatorCurrent" , leftMotor .getStatorCurrent ().getValueAsDouble ());
199
215
DogLog .log ("Arm/Left/SupplyCurrent" , leftMotor .getSupplyCurrent ().getValueAsDouble ());
200
216
DogLog .log ("Arm/Left/ArmAngle" , leftMotor .getPosition ().getValueAsDouble ());
You can’t perform that action at this time.
0 commit comments