Movement command, IMU and joint signals (scripted gait)
How the three command values enter the observation, and what base angular velocity, projected gravity and joint signals look like while a lower-body humanoid steps.
What it demonstrates
How the three command values enter the observation, and what base angular velocity, projected gravity and joint signals look like while a lower-body humanoid steps.
How it works
A 2-D pad sets v_x (up/down) and v_y (left/right); a slider sets w_z. These three numbers are copied straight into obs[6..8].
The 3D robot is driven by scriptedGait(), a hand-written sinusoidal stepping animation, so it is a picture of what the signals look like, not a policy responding to them. Roll and pitch come from a made-up torso sway; the gyro reading is their time derivative plus small Gaussian noise, and yaw rate follows w_z with a 0.25 s lag.
Adjustable parameters
- v_x, v_y via the command pad
- w_z (−1 to 1 rad/s)
- Plotted joint (0–11)
Known limitations
- The gait is scripted. It does not balance, does not react to the IMU and is not trained.
- The robot stays in place (treadmill view); no base motion is simulated.
- Kinematics, link lengths and joint names are illustrative, not Asimov's.
Equations
Core update rule
const { q, toes } = scriptedGait(t, cmd); // hand-written animation
const roll = 0.035 * speed * Math.sin(phase) - 0.12 * cmd.vy;
const pitch = 0.06 * cmd.vx + 0.015 * speed * Math.sin(2 * phase);
angVel = [(roll - prevRoll) / dt, (pitch - prevPitch) / dt, yawRate];
gravity = projectedGravity(roll, pitch);Explained in Chapter 8: Locomotion Policy