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

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
3

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: http://mirror.umd.edu/roswiki/doc/dia...

tf::getYaw(odom_msg.pose.pose.orientation)
edit flag offensive delete link more

Comments

1

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

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

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
0

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

Hamid Didari gravatar image

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

t1=2*(orientation.z*orientation.w-orientation.x*orientation.y)

t2=2*pow(orientation.x,2)-1+2*pow(orientation.w,2);

yaw=atan2(t1,t2);
edit flag offensive delete link more

Comments

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

nadal11 gravatar image nadal11  ( 2014-02-11 00:16:36 -0500 )edit

Question Tools

1 follower

Stats

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

Seen: 1,461 times

Last updated: May 14 '14