Skip to content

Commit

Permalink
Fix homing
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitkakkar committed Feb 1, 2025
1 parent 537cc90 commit d7c1dc0
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/main/java/frc/robot/subsystems/lift/LiftSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@ public void initialize() {
}

@Override
public void execute() {
if (s_liftinstance.elevatorAtHome()) {
s_liftinstance.resetElevatorEncoder();
s_liftinstance.stopElevator();
}
public void end(boolean interrupted) {
s_liftinstance.resetElevatorEncoder();
s_liftinstance.stopElevator();
}

@Override
public LiftStates nextState() {
if (s_liftinstance.elevatorAtHome() && s_liftinstance.getElevatorHeight().isNear(Meters.zero(), HOMING_EPSILON))
if (s_liftinstance.elevatorAtHome())
return IDLE;
return this;
}
Expand Down Expand Up @@ -833,7 +831,7 @@ private LiftSubsystem(Hardware liftHardware) {
m_elevatorPositionSetter = new MotionMagicVoltage(Radians.zero());
m_elevatorHomingBeamBreak = liftHardware.elevatorHomingBeamBreak;

//TODO: Figure out motor configuration values (gear ratios, sensors, etc)
// TODO: Figure out motor configuration values (gear ratios, sensors, etc)

// Create configurations for elevator motor
TalonFXConfiguration elevatorConfig = new TalonFXConfiguration();
Expand Down

0 comments on commit d7c1dc0

Please sign in to comment.