One step, several clocks#
The physics step advances state; the control period determines when inputs change; the frame rate determines when you see a picture. They can differ. Wall time is the time the machine actually spends.
A gripper’s 20 ms#
With a 2 ms physics step and a new target every ten steps, the control period is 20 ms: 50 Hz. Dynamics still evolves between targets. Holding an input does not freeze the robot or guarantee constant actuator force.
Halve the step while keeping ten steps per update, and control runs twice as often. To compare physics steps alone, adjust the repeat count to preserve the control period.
Adjust the timeline#
Predict first: what happens to control frequency if you change 2 ms to 1 ms? Then set the repeat count to 20 and recover the original control period.
A teaching diagram. It does not run MuJoCo or measure real-time performance.
Why can force change while the input stays fixed?
The actuator defines what ctrl means. A position actuator can take a target position, with force depending on the actual position, velocity and other quantities. Motors, activation dynamics and limits have their own paths. Not every control input is a direct torque.
Think of keeping a car's accelerator pedal in one position: the input stays fixed, but the speed is not locked. This analogy distinguishes inputs from state; it does not replace the actuator equations.
Observations have a time too#
After mj_step, the integration state has advanced. Derived quantities and sensors are produced at their own computation stages. Record simulated time, sampling stage and units together; do not silently combine forces and poses from different stages. Recompute the required forward quantities when needed, accounting for callbacks that another forward call may invoke.
In Python, data.qpos typically exposes native memory. Copy arrays when recording history; otherwise an “old snapshot” can change during later steps. See the state and time course; its exact fields and state masks belong to its 3.15.0 baseline.
Self-check: what changed?#
Read the explanation
Update every 20 steps. Rendering does not set the control period, and equal simulated duration does not imply equal wall time.
Back to an actual system#
Read back the physics step, control timestamps and repeat count, then locate the sampling stage. For a MATRiX integration, inspect its real scheduler and logs. The teaching values of 2 ms and 50 Hz are not asserted system settings.
Read more: Actuation and control · Dynamics and pipeline · Official simulation-loop documentation
Progress stays in this browser. You can unmark a lesson.