Roll, pitch, and yaw are a set of three angles that describe the orientation of a rigid body in three-dimensional space. They are often used in fields like aerospace, robotics, and computer graphics to represent the orientation of an object, such as an aircraft, spacecraft, or camera.
I’ve provided the standard rotation matrix for a 3D rotation using the ZYX Euler angle convention,
$$ \begin{aligned} R & =\operatorname{rot}( z , \phi) \operatorname{rot}( y , \theta) \operatorname{rot}( x , \psi) \\ & =\left[\begin{array}{ccc} c_\phi c_\theta & c_\phi s_\theta s_\psi-s_\phi c_\psi & c_\phi s_\theta c_\psi+s_\phi s_\psi \\ s_\phi c_\theta & s_\phi s_\theta s_\psi+c_\phi c_\psi & s_\phi s_\theta c_\psi-c_\phi s_\psi \\ -s_\theta & c_\theta s_\psi & c_\theta c_\psi \end{array}\right] \end{aligned} $$
where:
This matrix shows the combined rotation by first rotating around the z-axis (yaw), then the y-axis (pitch), and finally the x-axis (roll). Let's break down why this matrix works and some important points:
Understanding the Matrix Construction:
The matrix is constructed by multiplying the individual rotation matrices for each axis in the specified order:
The order of multiplication is crucial. Matrix multiplication is not commutative, meaning the order in which you multiply the matrices affects the final result. In this ZYX convention, the rotations are applied in the order yaw-pitch-roll.
Why this specific matrix?
The matrix you provided is the result of performing the matrix multiplications of the individual rotation matrices. The individual rotation matrices are:
Multiplying these matrices in the order rot(x, ψ) * rot(y, θ) * rot(z, ϕ) yields the combined rotation matrix you provided.