Skip to content

Commit

Permalink
fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
bmagyar committed Sep 11, 2024
1 parent cc7154b commit e644b28
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mouse_teleop/mouse_teleop/mouse_teleop.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def __init__(self):
self._holonomic = self.declare_parameter('holonomic', False).value

# Create twist publisher:
self._pub_cmd = self.create_publisher(Twist, 'mouse_vel', 10)
self._pub_cmd = self.create_publisher(TwistStamped, 'mouse_vel', 10)

# Initialize twist components to zero:
self._v_x = 0.0
Expand Down Expand Up @@ -242,13 +242,11 @@ def _send_motion(self):
ang = Vector3(x=0.0, y=0.0, z=w)

twist_stamped = TwistStamped()
header = Header()
header.stamp = rclpy.clock.Clock().now().to_msg()
header.frame_id = 'mouse_teleop'
twist_stamped.header = header
twist_stamped.header.stamp = rclpy.clock.Clock().now().to_msg()
twist_stamped.header.frame_id = 'mouse_teleop'
twist_stamped.twist.linear = lin
twist_stamped.twist.angular = ang

self._pub_cmd.publish(twist_stamped)

def _publish_twist(self):
Expand Down

0 comments on commit e644b28

Please sign in to comment.