Skip to content
Physical AI
All experiments

Projected gravity

That projected gravity encodes roll and pitch but not yaw: turning in place leaves all three numbers unchanged, while nodding or swaying changes them.

Loading simulation…

What it demonstrates

That projected gravity encodes roll and pitch but not yaw: turning in place leaves all three numbers unchanged, while nodding or swaying changes them.

How it works

A robot base follows a scripted orientation: a steady turn (yaw only), a nod (pitch), a sway (roll), or a walking-like mix of sway, a small pitch bob and a slow turn. At each frame the orientation is turned into a rotation matrix and projected gravity g_b = Rᵀ·[0, 0, −1] is computed and plotted.

The plumb indicator shows the horizontal components (g_x, g_y) in the body frame: the dot moves in the direction that 'down' points relative to the robot.

Adjustable parameters

  • Motion: turn, nod, sway, walk
  • Tilt amplitude (0–60°)

Known limitations

  • The motions are scripted, not simulated dynamics.
  • On a real robot projected gravity is estimated by a sensor-fusion filter and carries its own errors, especially during strong accelerations.

Equations

gb=R⊤[0,0,−1]⊤g_b = R^\top [0, 0, -1]^\top
Rz(ψ)⊤[0,0,−1]⊤=[0,0,−1]⊤  ⇒  gb is independent of ψR_z(\psi)^\top [0,0,-1]^\top = [0,0,-1]^\top \;\Rightarrow\; g_b \text{ is independent of } \psi

Core update rule

const { roll, pitch, yaw } = attitude(scenario, t);
const g = projectedGravity(eulerToMatrix(roll, pitch, yaw));
// g depends on roll and pitch only

Explained in Chapter 4: Sensors & Data