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

turning turtlebot a set number of degrees

asked 2012-07-23 06:50:35 -0500

Rydel gravatar image

I'm looking for a way to turn my robot a certain angle in a cpp node. I have read through these questions:

The above made sense, so then I looked for a way to acquire the heading of the robot,

The user in the above question can already get their robot's quaternion data and I cannot making the answer not very helpful. Could someone explain an efficient way to acquire the robot's quaternion data and explain how the answer in the 2nd link works?


edit retag flag offensive close merge delete


arminf82 gravatar image arminf82  ( 2019-09-28 15:43:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-07-23 12:39:41 -0500

joq gravatar image

I don't have a turtlebot, but some node should be publishing nav_msgs/Odometry, probably as an /odom or /odom_combined topic.

The orientation field in that message contains a quaternion indicating your robot's 3-dimensional orientation. Converting that to a yaw angle should give your 2-dimensional heading, if that is what you want.

edit flag offensive delete link more



ahhhh of course, I feel really dumb, thank you.

Rydel gravatar image Rydel  ( 2012-07-24 04:29:34 -0500 )edit

Don't feel bad. There is a lot going on in a full-sized ROS system.

joq gravatar image joq  ( 2012-07-24 04:37:38 -0500 )edit

I am even dumber, can figure out given these hints. Would be great to have some codes from you guys.

Sanat gravatar image Sanat  ( 2019-03-05 10:42:20 -0500 )edit

Question Tools


Asked: 2012-07-23 06:50:35 -0500

Seen: 7,437 times

Last updated: Sep 28 '19