Skip to content

Commit

Permalink
more stop
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanzemlin committed May 29, 2024
1 parent 66506c7 commit 582c76a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions autonav_ws/src/autonav_serial/src/serial_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ def system_state_transition(self, old: SystemStateEnum, updated: SystemStateEnum
except can.CanError:
pass

if old.state == SystemStateEnum.AUTONOMOUS and updated.state != SystemStateEnum.AUTONOMOUS:
can_msg = can.Message(arbitration_id=MOBILITY_STOP_ID, data=bytes([0]))
try:
self.can.send(can_msg)
except can.CanError:
pass

if old.state == SystemStateEnum.MANUAL and updated.state == SystemStateEnum.AUTONOMOUS:
self.zero_motors()

Expand Down

0 comments on commit 582c76a

Please sign in to comment.