Skip to content

Commit

Permalink
refactor: remove spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Andeshog committed Jan 5, 2025
1 parent 82d4ed8 commit 6d60ce3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def transition_to_xbox_mode(self):
Turns off the controller and signals that the operational mode has switched to Xbox mode.
"""
self.operational_mode_signal_publisher_.publish(String(data="XBOX"))
self.get_logger().info("XBOX mode")
self.state_ = States.XBOX_MODE

def transition_to_autonomous_mode(self):
Expand All @@ -170,6 +171,7 @@ def transition_to_autonomous_mode(self):
wrench_msg = self.create_2d_wrench_message(0.0, 0.0, 0.0)
self.wrench_publisher_.publish(wrench_msg)
self.operational_mode_signal_publisher_.publish(String(data="autonomous mode"))
self.get_logger().info("Autonomous mode")
self.state_ = States.AUTONOMOUS_MODE

def joystick_cb(self, msg : Joy) -> Wrench:
Expand Down Expand Up @@ -257,14 +259,12 @@ def joystick_cb(self, msg : Joy) -> Wrench:
wrench_msg = self.create_2d_wrench_message(surge, sway, yaw)

if self.state_ == States.XBOX_MODE:
self.get_logger().info("XBOX mode", throttle_duration_sec=1)
self.wrench_publisher_.publish(wrench_msg)

if software_control_mode_button:
self.transition_to_autonomous_mode()

if self.state_ == States.AUTONOMOUS_MODE:
self.get_logger().info("autonomous mode", throttle_duration_sec=1)

if xbox_control_mode_button:
self.transition_to_xbox_mode()
Expand Down

0 comments on commit 6d60ce3

Please sign in to comment.