Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/main/java/frc/robot/subsystems/Collector.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ public class CollectorConstants {
public static final double PIVOT_KI = 0d; // temp
public static final double PIVOT_KD = 0d; // temp
public static final double PIVOT_KS = 0; // temp
public static final double PIVOT_KG = 0d; // temp
// Gravity compensation voltage. Negative = upward force (same convention
// as Hood kG). START LOW and increase until the arm holds position without
// sagging. If the arm drifts up, make the value less negative (closer to 0).
public static final double PIVOT_KG = RobotMap.IS_OASIS ? -0.15d : -0.15d; // tune me!

Copilot AI Apr 6, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional on RobotMap.IS_OASIS is currently redundant because both branches use the same value (-0.15d). This adds noise and implies the constants may diverge when they don’t. Consider replacing with a single literal (or provide distinct tuned values per robot if that was the intent).

Suggested change
public static final double PIVOT_KG = RobotMap.IS_OASIS ? -0.15d : -0.15d; // tune me!
public static final double PIVOT_KG = -0.15d; // tune me!

Copilot uses AI. Check for mistakes.


// pivot
Expand Down Expand Up @@ -118,12 +121,12 @@ public class CollectorConstants {
private MechanismLigament2d ligament;
private Angle targetPivotPosition;
private PositionVoltage positionPID;
private boolean pivotZeroed = true;
private boolean pivotZeroed = false; // false = will auto-zero on first enable
private final Timer zeroingTimer = new Timer();
private boolean pivotActive = false;
private BooleanEntry requestZeroingDeploy;
private BooleanEntry requestZeroingStow;
private boolean stowZero = false;
private boolean stowZero = true; // true = zero toward stow (retracted) hard stop on startup

private DCMotor gearbox;

Expand Down Expand Up @@ -153,6 +156,7 @@ public Collector() {
pivotConfig.Slot0.kI = CollectorConstants.PIVOT_KI;
pivotConfig.Slot0.kD = CollectorConstants.PIVOT_KD;
pivotConfig.Slot0.kS = CollectorConstants.PIVOT_KS;
pivotConfig.Slot0.kG = CollectorConstants.PIVOT_KG;
pivotConfig.Feedback.SensorToMechanismRatio = CollectorConstants.ENCODER_TO_MECHANISM_RATIO;

pivotConfig.CurrentLimits.StatorCurrentLimitEnable = CollectorConstants.PIVOT_SUPPLY_LIMIT_ENABLE;
Expand Down
Loading