Open Source Robotics

A curated collection of high-quality open source robotics projects, tools, and software to propel the robotics community forward.

6D rotation representation

  • Also called: 6D rotation, continuous 6D rotation representation
  • Category: Foundations & spatial maths › Frames & transforms
  • Tags: rotations, pose-estimation, deep-learning, spatial-math, so3

Encoding a 3D rotation as two 3D vectors, the first two columns of its rotation matrix, so neural networks can predict rotations without the discontinuities of Euler angles or quaternions.

Definition

The 6D rotation representation encodes a 3D rotation by six numbers: two 3D vectors that, after orthonormalization, become the first two columns of the rotation matrix. It was introduced by Zhou et al. in 2019 for neural networks that predict or take rotations as input. To turn a network's six outputs into a rotation, the first vector is normalized, the component of the second vector along the first is removed and the result normalized, as in Gram-Schmidt orthogonalization, and the third column is the cross product of the first two. Any six numbers in which the two vectors are nonzero and not parallel map to a valid rotation matrix.

The motivation is continuity. Zhou et al. showed that every representation of 3D rotations in four or fewer real dimensions is discontinuous: somewhere, rotations that are close together map to representations that are far apart, or the reverse. Euler angles jump at angle wrap-around and suffer gimbal lock; axis-angle wraps at a rotation of π; quaternions have the double cover, in which q and −q describe the same rotation, and restricting them to one hemisphere to remove that ambiguity introduces a jump at the boundary. A network trained to regress such targets has to approximate a discontinuous function, which tends to produce large errors for some rotations. The 6D representation, like the full 9D rotation matrix, is continuous, and in their experiments networks trained with it learned rotations more accurately.

The 6D form is redundant rather than minimal, and its Gram-Schmidt step treats the first column differently from the second. A common alternative predicts all nine matrix entries and projects them to the nearest rotation with a singular value decomposition, which is symmetric across columns. Losses are usually computed on the recovered rotation matrix, for example as a geodesic angle or Frobenius distance, rather than on the six raw numbers. The representation is a learning tool: classical estimation and optimization usually work directly on the rotation group with quaternions or Lie-algebra updates.

Why it matters

Many robot learning and perception systems predict orientations: object and hand poses, human joint rotations, end-effector actions. The choice of rotation representation affects how well these networks train, and the 6D representation has become a common default for outputs and inputs that are rotations.

Key applications

  • Object and hand pose estimation with neural networks
  • Human pose and body models that predict joint rotations
  • End-effector orientation in learned robot policies and action spaces
  • Camera pose regression and relative pose estimation
  • Generative models of motion and grasps

In practice

A team trains a network to estimate a person's arm pose from wrist-worn sensors. Instead of outputting Euler angles for the shoulder and elbow, the network outputs six numbers per joint. A small layer converts each set of six into a rotation matrix with Gram-Schmidt and a cross product, and the loss compares these matrices with motion capture ground truth through the geodesic angle between them. The same encoding is used for the orientation inputs from the sensors, so the network never sees angle wrap-around. At deployment, the predicted rotation matrices are converted to quaternions or joint angles for the robot controller.

Common misconceptions

  • 6D means a full 6-DoF pose — the representation covers rotation only, which has three degrees of freedom, encoded with six numbers
  • A network's six outputs are already a rotation — they must be orthonormalized and completed with a cross product before they form a valid rotation matrix
  • Quaternions are always the best choice for learning — their double cover and the jump introduced by restricting to one hemisphere make them discontinuous as regression targets
  • The 6D representation replaces quaternions everywhere — it was designed for neural network inputs and outputs, while filters and optimizers usually work on the rotation group directly

Who should know this

  • Robot learning researchers designing action and observation spaces
  • Computer vision engineers working on pose estimation
  • Human motion and animation researchers
  • Engineers training grasp and manipulation networks

Related technologies

  • Rotation Matrix
  • Quaternions
  • Gram-Schmidt Orthogonalization
  • SVD Orthogonalization
  • PyTorch3D

Related terms

  • SE(3)
  • Yaw / Pitch / Roll
  • Transform
  • Coordinate Frame
  • Equivariance

Related projects

  • pySLAM: Hybrid Python/C++ visual SLAM pipeline with classic and deep-learning front-ends
  • AprilTag: The standard visual fiducial marker system for robot localization and pose estimation
  • manif: Header-only C++ Lie theory library for robotics state estimation
  • PyPose: PyTorch library for differentiable robotics with deep learning and Lie group optimization
  • Intrinsic Core: Intrinsic's open industrial robot stack: real-time control, planning and perception
  • PULP-Dronet: Visual navigation for nano-drones with CNN inference onboard a PULP processor.

This website requires JavaScript to function properly. Please enable JavaScript to explore our collection of open source robotics projects.