Projected Gravity
投影重力CommonGravity's straight-down direction expressed in the robot's own body frame, telling a policy how far the body is tilted.
Projected gravity is a near-universal observation in reinforcement learning for legged and humanoid robots: it takes the unit gravity direction in the world frame, (0, 0, −1), and rotates it into the body (base) frame using the inverse of the torso's orientation quaternion. When the robot stands perfectly upright, this equals (0, 0, −1); when the body tips forward or sideways, the x and y components become nonzero, with their magnitude reflecting how much pitch and roll are present. It carries only tilt information, with no heading (yaw) — which is useful, since yaw does nothing for balance and tends to drift on a real robot — so it's a cleaner input than feeding in the raw orientation quaternion directly. On real hardware, it's computed from the orientation an IMU estimates. Both legged_gym and Isaac Lab include it in their observations, and reward functions commonly penalize the squared sum of its x and y components to keep the body level.
ExampleUnitree's unitree_rl_gym real-robot deployment script reads the IMU quaternion, computes projected gravity, and places it in dimensions 4–6 of the observation, alongside angular velocity, velocity commands, and joint angles, as input to the walking policy.
- Also called
- Projected Gravity Vector, projected_gravity, projected_gravity_b
- Related
- Proprioception · Inertial Measurement Unit · Body Frame · Quaternion · RL-based Locomotion Control · Roll-Pitch-Yaw (RPY)
- Sources
- Isaac Lab API: isaaclab.envs.mdp (projected_gravity)
legged_gym (ETH RSL): legged_robot.py
unitree_rl_gym: deploy_real.py