Skip to content

Commit

Permalink
modify: fix a mistake
Browse files Browse the repository at this point in the history
Signed-off-by: TetsuKawa <[email protected]>
  • Loading branch information
TetsuKawa committed Sep 10, 2024
1 parent 0e30ca9 commit 3de69e1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions system/leader_election_converter/script/relay_to_sub.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,23 @@ def __init__(self):
self.autonomous_mode = False
self.operation_mode_autonomous_state = False
self.get_logger().info(f"Initial autonomous mode: {self.autonomous_mode}")
self.tmp_operation_mode_autonomous_state = False

def operation_mode_callback(self, msg):
if msg.autonomous != self.autonomous_mode:
self.autonomous_mode = msg.autonomous
self.get_logger().info(f"Autonomous mode changed: {self.autonomous_mode}")

def operation_mode_state_callback(self, msg):
self.tmp_operation_mode_autonomous_state = self.operation_mode_autonomous_state
if msg.mode == 2:
self.operation_mode_autonomous_state == True
self.operation_mode_autonomous_state = True
if self.tmp_operation_mode_autonomous_state != self.operation_mode_autonomous_state:
self.get_logger().info(f"Operation mode changed: {self.operation_mode_autonomous_state}")
else:
self.operation_mode_autonomous_state == False
self.operation_mode_autonomous_state = False
if self.tmp_operation_mode_autonomous_state != self.operation_mode_autonomous_state:
self.get_logger().info(f"Operation mode changed: {self.operation_mode_autonomous_state}")

def trajectory_callback(self, msg):
if self.autonomous_mode or self.operation_mode_autonomous_state == False:
Expand Down

0 comments on commit 3de69e1

Please sign in to comment.