Ask Your Question
1

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:

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 imagearminf82 ( 2019-09-28 15:43:11 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

Comments

1

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

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

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

joq gravatar imagejoq ( 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 imageSanat ( 2019-03-05 10:42:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 4,985 times

Last updated: Sep 28