# Converting yaw between frames

Hi all, I have a query regarding converting yaw between frames.

The velocity commands (linear and angular) received from the base local planner are in term of robot's frame. Let says that I want to convert the velocity commands into the map's frame in gazebo, do I need to do conversion on the angular velocity?

My intuition is that since the orientation of z-axis in both robot frame and map frame are the same, the yaw in both frame should be the same right?

The reason I asked this question is because after I did an angular velocity conversion between the robot frame and world frame, the values I got are different.

1st update: The way I did the conversion is as such, rot is the double value of the original angular velocity.

(Q_is geometry_msg::quaternion , QS_ and QS_tr is geometry_msgs::QuaternionStamped )

 Q_ = tf::createQuaternionMsgFromYaw(rot_);
QS_.quaternion = Q_;

listener.transformQuaternion("/map", QS_, QS_tr);
yaw = tf::getYaw(QS_tr.quaternion);

edit retag close merge delete

Sort by » oldest newest most voted

No, you don't. Your intuition is correct.

How did you do the conversion? If you rotated the "yaw/s" as a yaw, the you are doing it wrong.

Angular velocity is the derivate of the angle. So, unless you scale or flip your coordinate system, its magnitude must stay the same. The direction could change, but as we stay in a 2D world it isn't affected.

more

Thanks dornhege. In that case, I think I should not do the conversion at all. Well, I also added the steps I did my conversion. i first changed it to a quaternion so that I can make use of tf::transformer::transformQuaternion.

( 2013-02-25 00:50:41 -0500 )edit

Yes, that would probably be the easiest, it gets relevant once you leave the plane. Your transformation is definitely wrong as the rate of turn would now depend on where it is pointing.

( 2013-02-25 01:12:10 -0500 )edit

I think I am careless to treat the angular velocity as yaw. Thanks again!

( 2013-02-25 01:33:49 -0500 )edit