Orientation is a state
Orientation describes how object axes are arranged relative to reference axes. It is always frame-relative.
Rotation & Orientation Representations
Rotation has only 3 degrees of freedom but can use 3, 4, 6, or 9 numbers. The geometric object belongs to SO(3); Euler angles, quaternions, and matrices encode it with different singularities, constraints, and ambiguities.
Geometric Object
Under the site's column-vector convention, R's columns are the rotated object x, y, and z axes expressed in the reference frame. Rotation preserves length, angle, and handedness, without translation, scale, or reflection.
Orientation describes how object axes are arranged relative to reference axes. It is always frame-relative.
R rotates vectors or basis axes into new directions. Composition and inversion give the relative rotation between orientations.
Matrices, Euler angles, rotvecs, quaternions, and 6D vectors encode the same geometry for storage and computation.
Column interpretation
Object +x direction expressed in the reference frame
Object +y direction expressed in the reference frame
Object +z direction expressed in the reference frame, with r₃ = r₁ × r₂
Representation Atlas
No representation simultaneously optimizes readability, unconstrained parameters, global continuity, uniqueness, composition efficiency, and neural regression. Choose suitable representations for interfaces and convert explicitly at boundaries.
A common language for geometry: rotate vectors and compose orientations directly; columns are rotated basis axes.
9 numbers · 6 constraintsThree ordered rotations about axes. Convenient for interfaces, but admits multiple solutions and gimbal lock.
order + frame + unitRotate by θ around unit axis u. Rotvec combines them as θu, matching OpenCV rvec semantics.
r = θu ∈ R³Unit quaternions lie on S³ and support efficient composition and SLERP, while q and −q map to one rotation.
xyzw ≠ wxyzPredict the first two matrix columns and decode a valid R through Gram–Schmidt, commonly used for deep regression.
a₁, a₂ → b₁, b₂, b₃Small 3D tangent-vector increments near the current rotation map back to SO(3) through exp, supporting optimization and filtering.
R ← Exp(δφ) R| Representation | Storage shape | Uniqueness | Singularity / continuity | Strengths | Main pitfalls |
|---|---|---|---|---|---|
| Rotation matrix | 3×3 · 9 values | Unique matrix | No parameter singularity | Direct composition and vector transformation; clear geometry | 6 constraints; raw network outputs must be projected onto SO(3) |
| Euler / RPY | 3 values | Not unique | Gimbal lock | Readable controls and mechanical-joint semantics | Record axis order, intrinsic/extrinsic convention, angle units, and ranges |
| Axis–angle / rotvec | 3 axis + 1 angle / 3 values | Periodic and boundary equivalences | Arbitrary axis at zero angle; discontinuity near π | Common in Rodrigues, PnP, local optimization, and Lie-algebra updates | Rotvec magnitude is the angle, not three Euler angles |
| Unit quaternion | 4 values + unit constraint | q and −q are equivalent | No gimbal lock | Efficient composition and interpolation; common in robotics and SLAM | Handle xyzw / wxyz order and double cover |
| Continuous 6D representation | 2×3 · 6 values | Unique after decoding | Degenerate when predicted columns are collinear | Suitable for neural regression; avoids low-dimensional global discontinuity | 6 is the embedding dimension, not extra degrees of freedom; requires Gram–Schmidt |
| 9D + SVD | 3×3 · 9 values | Unique after projection | Unstable under singular-value degeneracy | Simple outputs with SVD / polar projection onto SO(3) | Correct reflections where det = −1 |
Interactive Lab
The first view converts yaw–pitch–roll to matrices, quaternions, axis–angle, rotvec, and 6D. The second separates object-center rays from object orientation to explain allocentric / egocentric and in-plane / out-of-plane rotation.
Interactive · SO(3)
9 numbers · 6 constraints
4 numbers · unit sphere
Display order: [x, y, z, w](scalar-last)
scalar-first:
Axis × angle
Learning-friendly embedding
The network predicts two 3D vectors, then orthogonalizes them into a rotation matrix. Output dimension differs from rotational degrees of freedom.
Ray alignment
Definition used in this lab
Interpretation
Euler Angles
Three angles define reproducible rotation only with axis order, fixed or moving reference axes, action direction, and angle units. Roll/Pitch/Yaw names alone do not resolve these choices.
Site convention
Extrinsic · fixed axes
Intrinsic · moving axes
Euler vs. Tait–Bryan
Axis–Angle & Quaternion
Axis–angle has an arbitrary axis at θ = 0 and a sign boundary near θ = π. Unit quaternions lie on the unit sphere in four-dimensional space, with q and −q representing the same rotation. Adjacent trajectory quaternions are usually aligned to one hemisphere before interpolation.
SciPy defaults to scalar-last; many robotics libraries and papers use scalar-first. Both have shape 4, allowing dangerous silent ordering errors.
Normalize network outputs and integrated states; a zero vector cannot be normalized into a valid quaternion.
Losses can use min(‖q̂−q‖, ‖q̂+q‖); trajectories use adjacent dot products to decide sign flips.
Normalized linear interpolation does not give constant angular velocity; prefer SLERP for large-angle interpolation.
View-Space Decomposition
These terms concern camera viewpoints and orientation decomposition, distinct from intrinsic/extrinsic Euler angles. They appear in cropped-object learning, template-view sampling, and category-level rotation estimation.
This is R in the final object → camera pose. Even with similar local appearance, moving from image center to edge changes the object-center ray and thus egocentric values.
Imagine a virtual camera looking along the object-center ray, then align that ray with the principal optical axis. This reduces coupling between image position and rotation labels for RoI/crop feature learning.
Mainly appears as contour rotation in the image plane. Near the principal point, it is often approximated by camera-z rotation; strictly, the axis is the camera-to-object-center ray.
Tilting or turning around an object changes occlusion, foreshortening, and visible surfaces. Template methods usually sample viewpoints on a sphere and in-plane angles separately.
Learning & Optimization
Networks need regressable vectors, optimizers stable local increments, interfaces efficient composition, and evaluation symmetry equivalence. Choose representations for the full chain rather than output dimension alone.
Network output
6D / quat / 9DValid rotation decoding
normalize / GS / SVDGeometric loss
geodesic / point lossSymmetry reduction
min over equivalenceDownstream use
projection / controlProject 9D onto SO(3)
M = UΣVᵀ
R = U diag(1, 1, det(UVᵀ)) VᵀUsing UVᵀ directly can produce a reflection with det = −1.Rotation error for symmetric objects
dsym(R̂, R) = minS∈G d(R̂, RS)Discrete or continuous symmetries enter losses and evaluation through equivalent-rotation sets G.Across Domains
Networks may regress 6D representations, quaternions, or rotvecs, but geometric estimation, projection, and evaluation usually use rotation matrices. Symmetric objects require comparing equivalent rotations.
Optimizers often update rotations in the local tangent space of SO(3), while storing states as quaternions. Quaternion components must not be added as independent Euclidean variables.
Controls often use RPY, kinematic chains use matrices / homogeneous transforms, and interpolation and messages use quaternions. Interfaces are common sources of order and frame errors.
Grasp orientation includes approach and closing axes and roll about the approach axis. Gripper symmetry can make multiple rotations represent the same executable grasp.
Debug Protocol
Use identity, single-axis 90°, near-π, gimbal-lock, and q/−q cases specifically designed to reveal convention errors.
All representations should recover I; quaternions are [0,0,0,±1] and rotvec is 0.
For example, Rz(+90°)[1,0,0]ᵀ must give [0,1,0]ᵀ, exposing handedness, active/passive, and transpose errors.
Verify RᵀR≈I and det(R)≈+1. A determinant near −1 usually indicates reflection or missing SVD correction.
For Euler→R→quat→R, compare matrices or geodesic angles rather than requiring identical final Euler components.
Test pitch=±90°, θ≈π, q and −q, crossings of ±180°, and nearly collinear 6D columns.
Project object xyz axes, CAD contours, and asymmetric features into the image to confirm agreement between numerical conventions and visual results.
Next topic · 04