File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class ClimberComponent:
1818 winch_voltage = tunable (12.0 )
1919
2020 def __init__ (self ) -> None :
21+ self .has_deployed = False
2122 self .START_ANGLE = - 30.0
2223 self .DEPLOY_ANGLE = 11.0
2324 self .RETRACT_ANGLE = - 52.0
@@ -48,13 +49,14 @@ def __init__(self) -> None:
4849 SparkMax .PersistMode .kPersistParameters ,
4950 )
5051
51- def stop (self ) -> None :
52- self .set_angle (math .radians (self .encoder_angle ()))
53-
5452 def on_disable (self ) -> None :
5553 self .update_pid = True
54+ self .has_deployed = False
5655 self .go_to_neutral ()
5756
57+ def stop (self ) -> None :
58+ self .set_angle (math .radians (self .encoder_angle ()))
59+
5860 def stop_pid_update (self ) -> None :
5961 self .update_pid = False
6062
@@ -71,7 +73,8 @@ def go_to_deploy(self) -> None:
7173 self .set_angle (math .radians (self .DEPLOY_ANGLE ))
7274
7375 def go_to_retract (self ) -> None :
74- self .set_angle (math .radians (self .RETRACT_ANGLE ))
76+ if self .has_deployed :
77+ self .set_angle (math .radians (self .RETRACT_ANGLE ))
7578
7679 @feedback
7780 def raw_encoder_val (self ) -> float :
You can’t perform that action at this time.
0 commit comments