File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -390,6 +390,15 @@ def stop_snapping(self) -> None:
390390 """stops the heading_controller"""
391391 self .snapping_to_heading = False
392392
393+ @feedback
394+ def is_stationary (self ) -> bool :
395+ velocity = self .get_velocity ()
396+ return (
397+ math .isclose (velocity .vx , 0.0 )
398+ and math .isclose (velocity .vy , 0.0 )
399+ and math .isclose (velocity .omega , 0.0 )
400+ )
401+
393402 def execute (self ) -> None :
394403 # rotate desired velocity to compensate for skew caused by discretization
395404 # see https://www.chiefdelphi.com/t/field-relative-swervedrive-drift-even-with-simulated-perfect-modules/413892/
Original file line number Diff line number Diff line change @@ -61,8 +61,7 @@ def preparing(self):
6161 self .wrist .at_setpoint ()
6262 and self .shooter_component .top_flywheels_up_to_speed ()
6363 and self .shooter_component .bottom_flywheels_up_to_speed ()
64- and math .isclose (self .chassis .get_velocity ().vx , 0 )
65- and math .isclose (self .chassis .get_velocity ().vy , 0 )
64+ and self .chassis .is_stationary ()
6665 ):
6766 self .next_state (self .shooting )
6867
You can’t perform that action at this time.
0 commit comments