Multi-rate timing: 200 Hz physics and IO, 50 Hz policy
How Asimov's documented rates fit together: physics and IO-side state handling every 5 ms, the policy every 20 ms, so each policy action is held for four physics steps.
What it demonstrates
How Asimov's documented rates fit together: physics and IO-side state handling every 5 ms, the policy every 20 ms, so each policy action is held for four physics steps.
How it works
A step counter advances in 5 ms physics steps. Physics and IO tasks run on every step. The policy task runs on the first physics step at or after each of its ideal release times, i / f_policy. For 50 Hz this is exactly every fourth step.
The bottom trace shows a joint target produced at each policy step and held constant (zero-order hold) until the next one. Choosing a rate that does not divide 200 Hz, such as 60 Hz, shows the uneven 4-3-3 pattern that results.
Adjustable parameters
- Policy rate (50 Hz documented; 40, 60, 100 Hz hypothetical)
- Playback speed
Known limitations
- The relative order of IO, policy and physics inside one step is a modelling choice; Menlo does not document it.
- Rates other than 50 Hz are hypothetical.
Equations
Core update rule
for (let k = 0; ; k++) {
ioSample(state); // 200 Hz
if (runsOnStep(k, 50, 200)) action = policy(observation()); // every 4th step
applyHeld(action); // zero-order hold
physicsStep(state, 0.005); // 200 Hz
}Explained in Chapter 6: Asimov Simulation