ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
There are at least three popular ways to specify a rotation in 3-D.
The main thing to know about a quaternion is that it encodes two things in a 4-tuple: 1) an axis of rotation (a 3-D vector), and 2) an angle of rotation, measured as the counter-clockwise rotation in radians about that vector (right-hand rule). This can represent any 3-D rotation using four elements, only slightly more memory than used by Euler angles, and considerably less than the matrix representation.
The 4-tuple quaternion mixes the axis of rotation and angle in a strange way. Let's say the axis of rotation is the vector <x, y,="" z=""> and the angle of rotation is theta, measured as the right-hand rotation in radians about <x, y,="" z="">. Then the quaternion that represents that rotation is:
<cos(theta/2), x*sin(theta/2), y*sin(theta/2), z*sin(theta/2)>
That's really all there is to it, it's just a fairly compact representation of an arbitrary rotation. Quaternions have several advantages over Euler angles and matrix representations.
(Note: There are actually multiple forms of quaternion representations, but only one in ROS.)
2 | No.2 Revision |
There are at least three popular ways to specify a rotation in 3-D.
The main thing to know about a quaternion is that it encodes two things in a 4-tuple: 1) an axis of rotation (a 3-D vector), and 2) an angle of rotation, measured as the counter-clockwise rotation in radians about that vector (right-hand rule). This can represent any 3-D rotation using four elements, only slightly more memory than used by Euler angles, and considerably less than the matrix representation.
The 4-tuple quaternion mixes the axis of rotation and angle in a strange way. Let's say the axis of rotation is the vector <x,
y,="" z=""> y, z> and the angle of rotation is theta, theta
, measured as the right-hand rotation in radians about <x,
y,="" z="">. y, z>. Then the quaternion that represents that rotation is:
<cos(theta/2), x*sin(theta/2), y*sin(theta/2), z*sin(theta/2)>
That's really all there is to it, it's just a fairly compact representation of an arbitrary rotation. Quaternions have several advantages over Euler angles and matrix representations.
(Note: There are actually multiple forms of quaternion representations, but only one in ROS.)