Skip to content
Snippets Groups Projects
Commit c03b0f50 authored by Paul-Winpenny's avatar Paul-Winpenny
Browse files

Reverting a few changes back.

parent 7d98c8e2
No related branches found
No related tags found
1 merge request!2Manual control user interface
...@@ -53,7 +53,6 @@ class ApiNode(Node): ...@@ -53,7 +53,6 @@ class ApiNode(Node):
publisher = self.publisher_topics[topic] publisher = self.publisher_topics[topic]
# Check if the topic is 'cmd_vel' and format the message as a Twist message # Check if the topic is 'cmd_vel' and format the message as a Twist message
self.get_logger().info(f"Publishing to {topic}: {message}")
if topic == "cmd_vel" and isinstance(message, tuple): if topic == "cmd_vel" and isinstance(message, tuple):
linear_x, angular_z = message linear_x, angular_z = message
twist_msg = Twist() twist_msg = Twist()
......
...@@ -10,8 +10,7 @@ class MotorController(Node): ...@@ -10,8 +10,7 @@ class MotorController(Node):
self.wheel_radius = 0.05 # meters self.wheel_radius = 0.05 # meters
self.wheel_base = 0.30 self.wheel_base = 0.30
self.get_logger().info("hello") self.get_logger().info("hello")
left_pwm = 0
right_pwm = 0
def cmd_vel_callback(self, msg): def cmd_vel_callback(self, msg):
v = msg.linear.x v = msg.linear.x
...@@ -47,9 +46,7 @@ class MotorController(Node): ...@@ -47,9 +46,7 @@ class MotorController(Node):
elif v == -0.5: elif v == -0.5:
left_pwm = -75 left_pwm = -75
right_pwm = -75 right_pwm = -75
if v == 0:
left_pwm = 0
right_pwm = 0
self.get_logger().info(f"Left PWM: {left_pwm}, Right PWM: {right_pwm}") self.get_logger().info(f"Left PWM: {left_pwm}, Right PWM: {right_pwm}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment