Ask Your Question

retrieve turtlebot orientation

asked 2014-02-09 22:52:47 -0500

nadal11 gravatar image

updated 2014-05-14 03:34:25 -0500

hi everybody,

kindly help me out to retrieve exact turtlebot's orientation. i have used yaw to determine the orientation but when the robot move the yaw become inaccurate. the yaw command the i used is as follows:

   yaw=atan2(2*(x*y+w*z), w*w + x*x - y*y - z*z);

kindly,give me an advice on how to retrieve the exact turtlebot's orientation. thank you.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2014-05-14 03:47:10 -0500

sterlingm gravatar image

If you're getting Odometry msgs, you can use the function tf::getYaw with the odometry msg directly to get the yaw.

documentation is here:

edit flag offensive delete link more



thanks mate. I have sort this thing out actually. the one you suggest give the same output as the one i suggested.

nadal11 gravatar imagenadal11 ( 2014-05-14 04:10:26 -0500 )edit

answered 2014-02-17 01:14:39 -0500

nadal11 gravatar image

updated 2014-05-14 03:34:08 -0500

i have figure the answer for this problem. the yaw can be retrieved from turtlebot using this equation:

yaw=atan2(2*orientation.w*orientation.z), orientation.w*orientation.w - orientation.z*orientation.z);

thank you to everybody.

edit flag offensive delete link more

answered 2014-02-10 19:22:34 -0500

hamid gravatar image

updated 2014-02-10 19:23:14 -0500



edit flag offensive delete link more


thanks hamid. I have tried it out but the yaw given is still incorrect.

nadal11 gravatar imagenadal11 ( 2014-02-11 00:16:36 -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

1 follower


Asked: 2014-02-09 22:52:47 -0500

Seen: 766 times

Last updated: May 14 '14