Hugo Hadfield
Imagine a 3D vector from the origin
Magnitude of the vector is the angle of rotation
Direction of the vector is the axis to rotate around
Minimum representation of rotation
Forms a linear (but periodic) space
First we make some algebraic elements with specific properties:
Then write our rotation vector as:
We pass this through the exponential function:
w coef of the quat
x,y,z coefs of the quat
We apply a quaternion to a point with a double sided sandwich operation:
Let's make a point:
And a quat:
(In fact there is a slightly faster formula)
Imagine some quat rotates a vector:
All we have to do to get the rotation matrix is to apply the quat to each basis vector in turn:
To convert Euler angles to a quat we will use the fact that they compose:
Just choose your ordering to match your Euler angle convention
(note we can of course expand this formula out for efficiency)
We know we need 6 degrees of freedom
We could stack a rotation vector with a translation vector
Rotation vector
Translation vector
}
}
This is a really good way of storing a transform
It is minimal (exactly 6dof)
It is intuitive
Imagine a line in 3D space, we will call it L
This line encodes a rotation about that line with the magnitude of the line as the angle of rotation:
We are now rotating about something that does not pass through the origin
Consider a line through a point a, and with a certain direction m, we could just stack them up:
This is not unique, any point on the line produces a different numerical L despite being the same 3D line...
Do this instead:
This representation is called Plücker coordinates!
Consider two lines and add them together:
The pitch represents translation in the direction of the line!
This thing is called a screw
Line bit (axis)
Not line bit (pitch)
We can always break up a screw into an axis and a pitch
Write a screw like this:
Where:
BUT ALSO:
Again we just run it through the exponential function to get something we can apply to points:
They compose with a single multiplication
They are by default orthogonal
They are great for interpolation of poses
They are very easy to invert
They are numerically efficient
They have very neat formulations of kinematics and dynamics
Researchers love them
Consider a dual quat \(q_\epsilon\) and you want to break it into a quat \(q\) and a translation \(t\)
We can read off the quat directly, q = w + xi + yj + zk
To get the translation vector we then get rid of the rotation bit, grab the \(\epsilon i , \epsilon j, \epsilon k\) coefs and divide by the scalar bit
Make a standard quat to do the rotation
Make a dual quat that does translation only
Compose them
Rotations only:
Rotation and translation (6dof pose):
Rotation vector + translation is great
Screws are just made up of adding rotations about 3D lines
Dual quats are not so scary (just screws basically, and easy to convert to other formats)
The quat rules are hiding the geometry of the rotation!
We can recover the quaternion multiplication rules if we compose reflections together.
Too long to go into here, but check out this video.