Advanced Dynamics -- Lecture 20: Quaternions, A brief introduction
Overview
Christian Hubicki explains why 3D dynamics and robotics systems often represent orientation with unit quaternions instead of roll, pitch, and yaw: three-angle Euler representations become singular at gimbal lock, including when pitch reaches 90 degrees. He builds the idea from 2D rotation matrices and complex-number multiplication, introduces Hamilton’s four-component quaternion algebra and axis-angle rotation formula, then connects it to drone IMUs, MuJoCo, and trajectory generation.
Key takeaways
- Euler-angle orientation mappings can become singular at a pitch of 90 degrees because their rate-conversion matrix has determinant cos θ, producing gimbal lock.
- A unit quaternion stores orientation with four values constrained to unit magnitude, giving three effective degrees of freedom without Euler-angle gimbal-lock singularities.
- For a rotation by angle α about unit axis n, the quaternion is (cos(α/2), n sin(α/2)); a vector rotation can be computed with q r q*.
- Quaternion multiplication is noncommutative, matching the order dependence of 3D rotations: ij = k but ji = −k.
- An IMU combines three-axis acceleration sensing with three-axis gyroscope measurements, which provide body-frame angular velocity used in drone orientation estimation.
- Drone trajectory planning may require smoothness through snap, the fourth time derivative of position, because sideways acceleration depends on rotating and tilting the vehicle.
Chapters
- Christian Hubicki says the final project is a report plus a recorded presentation, with about five minutes of speaking time for each team.
- The quaternion material is advanced, ungraded background on techniques used in modern multibody dynamics engines such as MuJoCo.
- Hubicki frames the lecture around representing rotations in three-dimensional dynamics.
- A 2D vector can be rotated by angle θ using the matrix with rows [cos θ, −sin θ] and [sin θ, cos θ].
- These transformations belong to SO(2), the special orthogonal group of 2D rotations.
- Rotation matrices are orthogonal, so their transpose is their inverse; in 2D, successive rotations commute.
- Three-dimensional orientation is commonly parameterized by three angles, often called yaw, pitch, and roll.
- The lecture represents these rotations with separate RZ, RY, and RX matrices, composed in a chosen order.
- Unlike 2D rotations, 3D rotations generally do not commute, so changing the order can change the resulting orientation.
- An inertial measurement unit combines an accelerometer, which measures acceleration along three axes, with a gyroscope, which measures angular velocity.
- A phone or drone IMU reports motion in the device’s body frame, not directly in the world frame.
- Hubicki connects cheaper sensors to the growth of consumer drones, citing mass production of gyroscopes for devices such as the Nintendo Wii.
- A University of Pennsylvania GRASP Lab drone demonstration illustrates flips and perching maneuvers that require orientation sensing and control.
- Converting between roll, pitch, and yaw rates and body-frame angular velocity requires a matrix that depends on the current orientation.
- For the convention discussed, the mapping’s determinant is cos θ, so it becomes singular when pitch θ reaches 90 degrees.
- At the singularity, rotation axes align and the angle-based representation loses a degree of independent control, the mathematical counterpart of mechanical gimbal lock.
- Hubicki explains why full drone flips make this limitation important and why simulation software may return four orientation values instead of three Euler angles.
- A planar vector (x, y) can be represented as the complex number x + iy.
- Multiplying by cos θ + i sin θ produces the same coordinate transformation as the 2D rotation matrix.
- This complex-number approach motivates seeking an algebraic representation that can handle 3D rotations without Euler-angle singularities.
- William Rowan Hamilton’s quaternion has the form w + xi + yj + zk, giving one real component and three imaginary components.
- The basis elements satisfy i² = j² = k² = −1, with cyclic products such as ij = k, jk = i, and ki = j.
- For orientation, the four components are constrained to unit magnitude, leaving three effective degrees of freedom.
- Quaternion multiplication is noncommutative: ij = k, while ji = −k; reversing the order changes the result.
- The lecture relates this cyclic multiplication pattern to the cross-product directions x × y = z and y × x = −z.
- A quaternion can be written as a scalar-vector pair, with scalar w and vector part (x, y, z), which is useful for rotation calculations.
- A rotation by angle α about unit axis n is represented by q = (cos(α/2), n sin(α/2)).
- To rotate a vector represented as a pure quaternion r, the lecture gives the sandwich operation q r q*, where q* conjugates the imaginary components.
- This representation supports arbitrary 3D rotations without the Euler-angle gimbal-lock singularity.
- Tracking a full 3×3 rotation matrix uses nine values, whereas a quaternion uses four values subject to a unit-length constraint.
- Numerical integration can cause rotation-matrix entries to drift away from orthogonality, requiring periodic renormalization.
- Hubicki identifies quaternions as the standard practical representation for tracking orientation in many dynamics and simulation systems.
- The quaternion magnitude is √(w² + x² + y² + z²), and quaternion magnitudes multiply consistently under quaternion products.
- Hubicki connects drone control to minimum-snap trajectory generation: lateral motion requires tilting the vehicle, coupling translational and rotational dynamics.
- He recommends Joan Solà’s 2017 introduction to quaternion kinematics and notes that MuJoCo may expose orientation as four quaternion values.
- The next lecture is previewed as an introduction to Featherstone’s spatial-vector methods for rigid-body dynamics.
- Hubicki reiterates that four orientation values in MuJoCo indicate a quaternion representation used to avoid gimbal lock.
- He points students to Solà’s 2017 quaternion-kinematics paper for more detailed treatment, including state estimation.
- The upcoming topic is Featherstone’s methods for three-dimensional rigid-body dynamics.
Transcript excerpt
0:00 All right. Thanks for your patience getting started. How are you doing today? >> Pretty good. >> Good. Good. Thanks for your patience. It's been a technical issues going in. Hope you all got a good Thanksgiving. >> Yes. >> Good? Good? Great. Glad to hear it. I really wanted to give this lecture on Monday. I know you're all did heartbroken and disappointed that I did not give it out on on time even especially considering you're not graded on it in any way whatsoever. But I will figure it I would do it today and try to give you as much bonus material as I can to really round out advanced topics here in Advanced Dynamics. Now I'm still working on your exams. I want to say I'm I know a lot of people were worried about the exam, all right? But I think people will realize how nice I am about partial credit. Okay? All right? So if I saw an attempt to do the process and I would say and I
0:48 would say some of the middle problems giving people trouble, but there were definitely a lot of gimmies that people were able to get, you know, on the exam. So all right. So so I'll should get get those back to you on Wednesday for sure so we can hand them all back then. All right. We'll cover some more advanced material. So we're now on a grading blitz right now. We have Nick and me grading your homework, your exam, and your project draft. Okay. The only thing that remains for the for the graded part of the course is the final project. Okay. And the final project again, it's just final it's it's going to be a final report and a short recorded video of you
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Christian Hubicki.