Ask Your Question

# 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?

Thanks in advance!

edit retag close merge delete

## 3 Answers

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

## Comments

Thanks, Martin, I was unsure about the reference coordinate system when I wrote my question, but couldn't quite explain it.

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! 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

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2011-04-19 15:09:24 -0500

Seen: 29,418 times

Last updated: Apr 20 '11