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

turning turtlebot a set number of degrees

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

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:

http://answers.ros.org/question/12557/how-to-make-the-turtlebot-rotate-in-place-a-set-of/

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

http://answers.ros.org/question/30926/getting-turtlebot-heading/

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?

Thanks!

edit retag flag offensive close merge delete

Comments

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

1 Answer

Sort by ยป oldest newest most voted
2

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

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

Comments

1

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

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

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 -0600 )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 -0600 )edit

Question Tools

Stats

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

Seen: 7,501 times

Last updated: Sep 28 '19