File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
src/main/java/org/carlmontrobotics/lib199/SimpleMechs/Arm Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ public final class ArmConfig {
6666 * @param armKFeedForward (kS, kG, kV, kA) of arm
6767 * @param armMainAbsoluteEncoder null if no absolute
6868 * @param armMotorIDOfBackupRelativeEncoder -1 if none
69- * @param armAbsoluteZeroOffset zeroOffset (in degrees) of abs enc, 0 should always be down !
69+ * @param armAbsoluteZeroOffset zeroOffset (in degrees) of abs enc, 0 should always be horizontal !
7070 * @param bottomLimit lowest value the arm can achieve (soft limit)
7171 * @param topLimit highest value the arm can achieve (soft limit)
7272 */
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ public class SimpleArm extends SubsystemBase {
4444
4545 Timer armTimer = new Timer ();
4646
47+ private final double defaultRelativeEncoderResetValue = -90 ;
48+
4749 public enum ArmControlState {
4850 AUTO ,
4951 MANUAL ,
@@ -120,7 +122,7 @@ private void resetFeedbackEncoder() {
120122 armFeedbackEncoder .setPosition ((armResetEncoder .getPosition () + armConfig .armAbsoluteZeroOffset )/armConfig .armAbsoluteGearReduction *armConfig .armRelativeGearReduction );
121123 }
122124 else {
123- armFeedbackEncoder .setPosition (0 );
125+ armFeedbackEncoder .setPosition (defaultRelativeEncoderResetValue );
124126 }
125127 }
126128
@@ -145,7 +147,7 @@ private void autoArm() {
145147 }
146148
147149 if (armConfig .armFeedForwardExists ) {
148- feedforwardOutput = armConfig .armFeedForward .calculate (armGoal /360 *2 *Math .PI + Math . PI / 2 , 0 );
150+ feedforwardOutput = armConfig .armFeedForward .calculate (armGoal /360 *2 *Math .PI , 0 );
149151 }
150152 else {
151153 feedforwardOutput = 0 ;
You can’t perform that action at this time.
0 commit comments