Back to behaviors
Contract v1.0Microduck runtime

The shared rhythm behind every move.

Behavior policies use one predictable interface: 61 observations in, 14 joint targets out, 50 times each second.

Keeping this shape fixed makes behaviors swappable. A policy can change from a walk to a recovery move without changing the daemon that runs it.

The contract below describes the values a policy receives and the targets it returns. Normalization statistics travel inside the ONNX graph.

01 / Observation vector

Eight groups make up the 61-dimensional input.

IndexDimsComponentWhat it carries
0 – 1314Joint positionsMeasured servo angles (rad) relative to the neutral pose.
14 – 2714Joint velocitiesMeasured angular velocity (rad/s) from encoder derivatives.
28 – 4114Previous actionsTargets sent on the previous control tick for temporal smoothness.
42 – 443Projected gravityGravity unit vector in the trunk frame; upright is [0, 0, -1].
45 – 473Angular velocityTrunk gyroscope vector [wx, wy, wz] in rad/s.
48 – 503Twist commandOperator intent: forward, lateral, and yaw velocity.
51 – 544Head pose commandNeck and head orientation targets.
55 – 606Body pose commandTorso translation and rotation offset [tx, ty, tz, roll, pitch, yaw].

02 / Action vector

Each output is a position offset around the home pose: target = home_pose + action_scale × action.

Left leg · 0–4

  • 0 · hip yaw
  • 1 · hip roll
  • 2 · hip pitch
  • 3 · knee
  • 4 · ankle

Neck & head · 5–8

  • 5 · neck pitch
  • 6 · head pitch
  • 7 · head yaw
  • 8 · head roll

Right leg · 9–13

  • 9 · hip yaw
  • 10 · hip roll
  • 11 · hip pitch
  • 12 · knee
  • 13 · ankle
The beak is separate. Its 15th motor is driven through programmatic RPC or gamepad input, outside this fixed locomotion space.

03 / Actuator model & timing

Simulation uses the BAM M6 actuator model for the XL330 Dynamixel. It accounts for the details that matter on a small, light biped.

Motor behavior

  • voltage control laws
  • back-EMF resistance
  • thermal voltage sag

Contact behavior

  • Coulomb & viscous friction
  • Stribeck friction
  • gearbox backlash

Variation

  • battery: 6.5–8.4 V
  • per-environment randomization
  • 50 Hz control loop

04 / Runtime priority

When several gestures are available, the daemon resolves them in this order:

roulade 〉 kick 〉 ground_pick 〉 sit/rise 〉 stand_by_magnitude 〉 walk