# quaternions orientation representation

Hi, I'm trying to understand the geometry_msgs/Pose.msg Is there a way to non-ambiguously explain how quaternions are used to represent orientation? I understand how quaternions represent rotation. You take some initial orientation, and then rotate it around vector (x,y,z) by acos(w). However, when I'm trying to imagine orientation I can't understand what is the initial orientation. Is it set to some constant in ROS?

More specifically, if I have a orientation (w, x,y,z) in 3d to what orientation this corresponds in 2d?

edit retag close merge delete

Sort by » oldest newest most voted

In order to make sense of a geometry_msgs/Pose message, you need to know the reference coordinate system and the intrinsic coordinate system. These should be clear from the context in which the Pose message is used. To specify the reference coordinate system, many ROS packages use the frame_id field of geometry_msgs/PoseStamped instead of using Pose directly.

For example, robot_pose_ekf publishes the robot pose as PoseStamped, where the reference coordinate system (the fixed world frame, if you like) is odom_combined, and the intrinsic coordinate system of the robot is base_link. As the document linked to by @dornhege points out, the default axis orientation for a body (e.g., a robot) is "x forward, y left, z up". So the interpretation of this particular Pose message is "rotate base_link by the rotation given in the quaternion, relative to the odom_combined frame".

More specifically, if I have a orientation (w, x,y,z) in 3d to what orientation this corresponds in 2d?

Generally: none. :-)

Ok, just being cheeky. In cases where a body can only move in 2D (like all the 2D navigation stuff), the rotation axis should be the z axis, since z is "up" (see above). Using the naming conventions from your link, that means that (n_x, n_y, n_z) = (0, 0, 1), so (x, y, z, w) = (0, 0, sin(theta/2), cos(theta/2)).

more

Thanks, Martin, I was unsure about the reference coordinate system when I wrote my question, but couldn't quite explain it.
( 2011-04-21 09:29:11 -0600 )edit
( 2011-06-14 11:03:36 -0600 )edit

Hello Martin, I have a node that gives goal.target_pose.pose.position.x and y and z and also goal.target_pose.pose.orientation.x and y and z and w. I cannot interpret these orientation values, for example, what does Orientation(0,000, 0,000, -0,260, 0,965) mean? Should these values be between 0 and 1? It would be very kind if u could help me with that!

( 2013-09-04 02:52:01 -0600 )edit

( 2013-09-04 02:57:31 -0600 )edit

Thanks a world!

( 2013-09-04 03:08:08 -0600 )edit

These should be the conventions used in ROS: Coordinate Systems

more

I found a pretty accessible explanation at:

http://www.mathworks.com/help/toolbox/physmod/mech/gs/f13-7317.html#brcjlyu

It is a rotation of the center of gravity coordinate system.

Now I need to find what is that for PR2.

more

( 2016-06-24 11:17:32 -0600 )edit
( 2016-11-03 09:27:39 -0600 )edit