Signal manager
signal_manager
¶
SignalManager
dataclass
¶
SignalManager(
export_path: Path,
batch_size: int = 1000,
record_decimation: int = 1,
_buffer_row_idx: int = 0,
_step_count: int = -1,
_n_cols: int = 0,
)
batch_size
class-attribute
instance-attribute
¶
batch_size: int = 1000
Number of steps before flushing to disk.
record_decimation
class-attribute
instance-attribute
¶
record_decimation: int = 1
How many steps between each recording should be performed.
post
¶
post(
value: float,
category: SignalCategory | str,
subgroups: tuple[str, ...] = (),
*,
attr: str | None = None,
)
Injects a value into the telemetry ledger using a hierarchical namespace.
This method constructs a structured key that the dashboard uses to build a navigable tree view. The naming convention follows a folder-like structure to group related signals (e.g., all axes of a body's position).
Format
Category/Subgroup:Attribute (e.g., "Bodies/Link_1:xpos_x")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
float
|
The numeric data to record. |
required |
category
|
SignalCategory | str
|
Top level category (e.g., "Bodies") |
required |
subgroups
|
tuple[str, ...]
|
The second-level organizational folders. Defaults to an empty tuple. |
()
|
attr
|
str | None
|
The specific signal or component name (e.g., "qpos" or "x"). Defaults to None. |
None
|
Examples:
| Python Console Session | |
|---|---|
| Python Console Session | |
|---|---|
Source code in src/mujoco_mojo/runtime/signal_manager.py
record
¶
Executes all samplers and advances the buffer index. Flushes if due.
Source code in src/mujoco_mojo/runtime/signal_manager.py
flush
¶
Commits the memory buffer to the output file.