Skip to main content
Read a MuJoCo sensor’s value by name. Returns a handle with read() updated every physics frame.

Signature

Usage

Return Value

Sensor Types

Common MuJoCo sensor types and their dimensions:

Notes

  • The read() array is updated every frame via useAfterPhysicsStep
  • If the sensor doesn’t exist, read() returns an empty Float64Array
  • For enumerating all sensors, use api.getSensors()
  • The name parameter accepts string by default, or a generated union type if you use mujocoReact()