Ask Your Question
0

Converting yaw between frames

asked 2013-02-24 18:49:45 -0500

ChengXiang gravatar image

updated 2013-02-25 00:46:05 -0500

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_.header.frame_id = "base_link";
 QS_.header.stamp = ros::Time();
 QS_.quaternion = Q_;

 listener.transformQuaternion("/map", QS_, QS_tr);
 yaw = tf::getYaw(QS_tr.quaternion);
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2013-02-24 23:13:06 -0500

dornhege gravatar image

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.

edit flag offensive delete link more

Comments

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.

ChengXiang gravatar image ChengXiang  ( 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.

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

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

ChengXiang gravatar image ChengXiang  ( 2013-02-25 01:33:49 -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: 2013-02-24 18:49:45 -0500

Seen: 536 times

Last updated: Feb 25 '13