Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Google deepmind Mujoco Platform Step Control

From Leeroopedia
Revision as of 12:47, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Google_deepmind_Mujoco_Platform_Step_Control.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Simulation Control, Timing
Last Updated 2026-02-15 04:00 GMT

Overview

Controls simulation stepping rate, pause states (including viscous pause), speed measurement, timing synchronization, and control noise injection.

Description

step_control.cc implements StepControl, the central simulation timing controller for MuJoCo's platform layer. It installs a high-resolution std::chrono::steady_clock-based timer via mjcb_time, manages real-time synchronization with configurable speed (0.1x to 100x real-time), and supports three pause states: running, paused, and viscous-paused. Viscous pause is a special mode that zeroes gravity, increases viscosity to 10, and disables springs, allowing the simulation to gently settle rather than freeze. The class also manages control noise parameters (scale and rate) and provides a ForceSync method to reset timing after discontinuities. The Advance method determines when to step the simulation based on wall-clock timing.

Usage

Instantiated by Studio's App and used each frame to decide whether to advance the simulation. The step control manages the play/pause toggle, speed slider, and viscous pause mode from the Studio toolbar.

Code Reference

Source Location

Key Functions

static mjtNum Timer();  // steady_clock-based timer in milliseconds
StepControl::StepControl();
float StepControl::GetSpeedMeasured() const;
void StepControl::SetSpeed(float speed_percent_real_time);
void StepControl::SetPauseState(PauseState state, mjModel* m);
StepControl::Status StepControl::Advance(mjModel* m, mjData* d);
void StepControl::SetNoiseParameters(float ctrl_noise_scale, float ctrl_noise_rate);

Import

#include "experimental/platform/step_control.h"

I/O Contract

Inputs

Name Type Required Description
m mjModel* Yes MuJoCo model (modified during viscous pause)
d mjData* Yes MuJoCo data for simulation stepping
speed float No Desired speed as percentage of real-time (0.1 to 100)
state PauseState No Requested pause state (running, paused, viscous-paused)

Outputs

Name Type Description
Status StepControl::Status Whether the simulation should step this frame
speed_measured_ float Actual measured simulation speed

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment