Skip to content

Commit

Permalink
made status signal refreshing cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
PGgit08 committed Feb 8, 2025
1 parent cea76c9 commit 545bde0
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/main/java/frc/robot/subsystems/Wristevator.java
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,6 @@ private Command holdInPlace() {
return run(() -> {
_leftMotor.setControl(_heightSetter);
_wristMotor.setControl(_angleSetter);

refreshProfileReferences();
})
.withName("Hold In Place");
}
Expand Down Expand Up @@ -461,9 +459,9 @@ public Command setGoal(Setpoint goal) {
_leftMotor.setControl(_heightSetter.withPosition(_nextSetpoint.getHeight()));
_wristMotor.setControl(_angleSetter.withPosition(_nextSetpoint.getAngle()));

refreshProfileReferences();
if (!_isMotionMagic) return;

if (_isMotionMagic) _isManual = false;
_isManual = false;

// once the next setpoint is reached, re-find the next one
if (finishedProfiles(_nextSetpoint)) {
Expand Down Expand Up @@ -519,10 +517,7 @@ public Command setSpeeds(DoubleSupplier elevatorSpeed, DoubleSupplier wristSpeed
public void periodic() {
super.periodic();

_isMotionMagic =
_leftMotor.getMotionMagicIsRunning().getValue() == MotionMagicIsRunningValue.Enabled
&& _wristMotor.getMotionMagicIsRunning().getValue()
== MotionMagicIsRunningValue.Enabled;
refreshProfileReferences();

DogLog.log(
"Wristevator/Elevator Reference",
Expand Down

0 comments on commit 545bde0

Please sign in to comment.