ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Transform quaternion orientation to vector

asked 2022-02-24 18:32:29 -0500

xaru8145 gravatar image

Hi,

I have a geometry_message::Pose message. This message has a position and an orientation in quaternions. I would like to obtain a vector that represents the orientation. Just like in rviz you visualize a pose with an arrow. The arrow is given by the position and a direction (orientation).

How can I transform the quaternion into a unit vector that represents the direction? In CPP.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-02-25 05:11:50 -0500

ljaniec gravatar image

I suggest you use of the `tf2' and it's transformation functions.

There you have the tutorial: http://wiki.ros.org/tf2/Tutorials/Qua...

I would use this method getYaw().

edit flag offensive delete link more

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

Stats

Asked: 2022-02-24 18:32:29 -0500

Seen: 62 times

Last updated: Feb 25