ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Rotation of Turtlebot in Gazebo Environment

asked 2019-10-06 10:07:44 -0500

gktg1514 gravatar image

When I was moving turtlebot robot in gazebo environment, I sent the publication to the topic/cmd_vel_mux/input/navi to rotate the turtlebot. My publication was like this:

rostopic pub /cmd_vel_mux/input/navi geometry_msgs/Twist -- '[0, 0, 0]' '[0, 0, 3.14]'

However, the robot did not rotate in 180 degree. I was expecting that it rotates around itself 180 degree. Is there anyone who knows its reason ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-06 10:16:32 -0500

gvdhoorn gravatar image

geometry_msgs/Twist encodes velocity, not position.

From the documentation:

This expresses velocity in free space broken into its linear and angular parts.

Your rostopic pub command line would be publishing a rotation at 3.14 rad/s around the Z axis.

So the total rotation depends on the duration for which you publish that message.

If you want to rotate the robot (any robot that exposes the same Twist interface) a certain angle, you'll have to publish the Twist for as long as needed. nav_msgs/Odometry would be a good source of info on what the current pose of your robot is and could be used to close a position loop over this velocity control interface.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-10-06 10:07:44 -0500

Seen: 775 times

Last updated: Oct 06 '19