Dataframe
dataframe
¶
MojoNamespace
¶
Enhanced Polars DataFrame for MuJoCo Mojo telemetry.
Supports hierarchical signal filtering and common physics transformations.
Source code in src/mujoco_mojo/utils/dataframe.py
rotatable_bases
property
¶
Returns the unique base names for 3-component vectors (x, y, z).
quaternion_bases
property
¶
Returns the unique base names for 4-component quaternions (w, x, y, z).
rotatable_columns
property
¶
Returns column names ending in :x, :y, or :z (excluding quaternions which end with :w).
quaternion_columns
property
¶
Returns all columns that form a full quaternion group. Specifically looks for columns ending with quat:w, quat:x, quat:y, quat:z.
select_category
¶
select_category(
category: SignalCategory | str,
) -> MojoDataFrame
Filter columns belonging to a specific SignalCategory (e.g., 'Bodies').
select_name
¶
select_name(name: str) -> MojoDataFrame
General filter for columns associated with a specific object name (e.g., 'racket').
Source code in src/mujoco_mojo/utils/dataframe.py
select_channel
¶
select_channel(channel: str) -> MojoDataFrame
Selects all components of a specific channel across any category.
Matches the logical 'folder' before the attribute separator. Example: 'xpos' matches 'Bodies/Hand/xpos:x' and 'Bodies/Hand/xpos:y'.
Source code in src/mujoco_mojo/utils/dataframe.py
select_attribute
¶
select_attribute(attr: str) -> MojoDataFrame
Selects a specific attribute across all categories and objects. Matches exact scalars (':nutation_deg') or vector groups (':x').
Source code in src/mujoco_mojo/utils/dataframe.py
select_joint
¶
select_joint(name: JointName) -> MojoDataFrame
Select all signals belonging to a specific Joint (qpos, qvel, etc.).
Source code in src/mujoco_mojo/utils/dataframe.py
select_site
¶
select_site(name: SiteName) -> MojoDataFrame
Select all signals recorded at a specific Site.
select_geom
¶
select_geom(name: GeomName) -> MojoDataFrame
Select all signals associated with a specific Geom (contacts, etc.).
select_sensor
¶
select_sensor(name: SensorName) -> MojoDataFrame
Select data from a specific named Sensor.
select_actuator
¶
select_actuator(name: ActuatorName) -> MojoDataFrame
Select data from a specific Actuator.
select_tendon
¶
select_tendon(name: TendonName) -> MojoDataFrame
Select data from a specific Tendon.
select_camera
¶
select_camera(name: CameraName) -> MojoDataFrame
Select pose or FOV data from a specific Camera.
select_light
¶
select_light(name: LightName) -> MojoDataFrame
Select pose or intensity data from a specific Light.
select_equality
¶
select_equality(name: EqualityName) -> MojoDataFrame
Select force/error data from an Equality constraint.
select_plugin
¶
select_plugin(name: InstanceName) -> MojoDataFrame
Select custom state data from a specific Plugin Instance.
select_flex
¶
select_flex(name: FlexName) -> MojoDataFrame
Select vertex/stress data from a Deformable Flex object.
get_manifest
¶
Returns the structured manifest used by the frontend.
Source code in src/mujoco_mojo/utils/dataframe.py
with_rotation
¶
Rotates all 3D vectors into a new frame using the specified quaternion.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quat_base
|
str
|
Prefix for the [w,x,y,z] quaternion group. |
required |
invert
|
bool
|
If True, performs World to Local transformation (use False with the same |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Self |
MojoDataFrame
|
DataFrame with transformed :x, :y, :z columns. |
Source code in src/mujoco_mojo/utils/dataframe.py
with_filter_map
¶
with_filter_map(
filter_map: dict[str, list[AnyFilter]],
omit_time: bool = True,
) -> MojoDataFrame
Applies specific filter stacks to mapped columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter_map
|
dict[str, list[AnyFilter]]
|
Dictionary mapping column names to a list of filters. |
required |
omit_time
|
bool
|
If True, skips the 'time' column even if present in the map. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Self |
MojoDataFrame
|
DataFrame with the transformed columns overwritten. |
Source code in src/mujoco_mojo/utils/dataframe.py
with_filters
¶
with_filters(
filters: list[AnyFilter],
columns: list[str] | None = None,
omit_time: bool = True,
) -> MojoDataFrame
Applies a sequential stack of filters to the specified or all numeric columns.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filters
|
list[AnyFilter]
|
List of Filter objects to apply in order (e.g., LowPass -> Derivative). |
required |
columns
|
list[str] | None
|
Specific columns to transform. If None, applies to all available columns. Defaults to None. |
None
|
omit_time
|
bool
|
If True, prevents filters from being applied to the 'time' column. Defaults to True. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Self |
MojoDataFrame
|
DataFrame with the transformed columns overwritten. |