Trying to get a double acting solenoid to set to kReverse when we enable the robot in Teleop.
We put the method for opening the hooks (setting it to reverse) in TeleopInt(). It works great the first time we enable the robot, but if close the hooks then disable the robot and reenable the robot without power cycling or changing the code it reverts back to its last state not the state we necessarily want it on.
public void teleopInit() {
// This makes sure that the autonomous stops running when
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
if (m_autonomousCommand != null) {
m_autonomousCommand.cancel();
RobotContainer.pneumaticHub.enableCompressorDigital();
RobotContainer.climber.openHook();
}
In our Climber subsystem…
public void openHook(){
hookSolenoid.set(Value.kReverse);
}
We also set it to reverse in the constructor of the climber subsystem, but I believe that only runs upon boot up of the rio. We have also tried adding this in robotInt() which also I believe only runs upon boot up of the rio.