env¶
env
¶
Modules:
| Name | Description |
|---|---|
abstract_sensors |
|
arena |
|
camera_manager |
Camera management for MolmoSpaces environments. |
data_views |
|
env |
|
mj_extensions |
|
object_manager |
|
rby1_sensors |
|
sensors |
|
sensors_cameras |
|
abstract_sensors
¶
Classes:
| Name | Description |
|---|---|
Sensor |
Represents a sensor that provides data from the environment to agent. |
SensorSuite |
Represents a set of sensors, with each sensor being identified through a |
Attributes:
| Name | Type | Description |
|---|---|---|
SpaceDict |
|
Sensor
¶
Bases: ABC
Represents a sensor that provides data from the environment to agent. The user of this class needs to implement the get_observation method and the user is also required to set the below attributes:
Attributes¶
uuid : universally unique id.
observation_space : gym.Space object corresponding to observation of
sensor.
is_dict : whether the observation is a dictionary
str_max_len : maximum length of the string representation of the encoded dictionary, if is_dict is True
Methods:
| Name | Description |
|---|---|
get_observation |
Returns observations from the environment (or task). |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/abstract_sensors.py
get_observation
abstractmethod
¶
Returns observations from the environment (or task).
Parameters¶
env : The environment the sensor is used upon. task : (Optionally) a Task from which the sensor should get data.
Returns¶
Current observation for Sensor.
Source code in molmo_spaces/env/abstract_sensors.py
SensorSuite
¶
SensorSuite(sensors: Sequence[Sensor])
Represents a set of sensors, with each sensor being identified through a unique id.
Attributes¶
list containing sensors for the environment, uuid of each
sensor must be unique.
Initializer.
Parameters¶
param sensors: the sensors that will be included in the suite.
Methods:
| Name | Description |
|---|---|
get |
Return sensor with the given |
get_observations |
Get all observations corresponding to the sensors in the suite. |
Attributes:
| Name | Type | Description |
|---|---|---|
observation_spaces |
Dict
|
|
sensors |
dict[str, Sensor]
|
|
Source code in molmo_spaces/env/abstract_sensors.py
get
¶
get(uuid: str) -> Sensor
get_observations
¶
Get all observations corresponding to the sensors in the suite.
Parameters¶
env : The environment from which to get the observation. task : (Optionally) the task from which to get the observation.
Returns¶
Data from all sensors packaged inside a Dict.
Source code in molmo_spaces/env/abstract_sensors.py
arena
¶
Modules:
| Name | Description |
|---|---|
arena_utils |
|
bathroom |
|
cabinet |
|
drawer |
|
kitchen |
|
procthor_types |
|
randomization |
|
scene_tweaks |
|
arena_utils
¶
Functions:
| Name | Description |
|---|---|
fix_exclude_contact_floor_with_fridges |
|
fix_move_objects_within_inner_sites_up_abit |
|
fix_remove_all_toasters |
|
fix_remove_objects_within_inner_sites |
|
get_all_bodies_with_joints_as_mlspaces_objects |
Get all bodies with joints as MlSpacesObject instances. |
load_env_with_objects |
|
load_env_with_objects_with_tweaks |
|
modify_mjmodel_thor_articulated |
|
Attributes:
| Name | Type | Description |
|---|---|---|
DEFAULT_Z_OFFSET_OBJS_WITHIN_SITES |
|
|
args |
|
|
data |
|
|
house_path |
|
|
iTHOR_CATEGORIES |
|
|
new_model |
MjModel | None
|
|
old_model |
MjModel | None
|
|
parser |
|
|
t_start |
|
iTHOR_CATEGORIES
module-attribute
¶
fix_exclude_contact_floor_with_fridges
¶
Source code in molmo_spaces/env/arena/arena_utils.py
fix_move_objects_within_inner_sites_up_abit
¶
fix_move_objects_within_inner_sites_up_abit(spec: MjSpec, z_offset: float = DEFAULT_Z_OFFSET_OBJS_WITHIN_SITES) -> None
Source code in molmo_spaces/env/arena/arena_utils.py
fix_remove_all_toasters
¶
Source code in molmo_spaces/env/arena/arena_utils.py
fix_remove_objects_within_inner_sites
¶
Source code in molmo_spaces/env/arena/arena_utils.py
get_all_bodies_with_joints_as_mlspaces_objects
¶
get_all_bodies_with_joints_as_mlspaces_objects(model: MjModel, data: MjData) -> list[MlSpacesObject]
Get all bodies with joints as MlSpacesObject instances.
This function finds all bodies in the model that have joints (movable bodies) and creates MlSpacesObject instances for them. Bodies without valid names or that fail to create MlSpacesObject instances are skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
MjModel
|
MuJoCo model |
required |
data
|
MjData
|
MuJoCo data |
required |
Returns:
| Type | Description |
|---|---|
list[MlSpacesObject]
|
List of MlSpacesObject instances for all bodies with joints that could be |
list[MlSpacesObject]
|
successfully created. Bodies that fail to create MlSpacesObject instances |
list[MlSpacesObject]
|
are silently skipped. |
Source code in molmo_spaces/env/arena/arena_utils.py
load_env_with_objects
¶
load_env_with_objects(xml_path: str) -> tuple[MjModel, dict[str, list[MlSpacesArticulationObject]]]
Source code in molmo_spaces/env/arena/arena_utils.py
load_env_with_objects_with_tweaks
¶
load_env_with_objects_with_tweaks(xml_path: str, remove_objects_within_inner_sites: bool = False, move_objects_within_sites_up_abit: bool = False, remove_all_toasters: bool = False) -> tuple[MjModel, dict[str, list[MlSpacesArticulationObject]], dict]
Source code in molmo_spaces/env/arena/arena_utils.py
modify_mjmodel_thor_articulated
¶
modify_mjmodel_thor_articulated(model: MjModel, data) -> dict[str, list[MlSpacesArticulationObject]]
Source code in molmo_spaces/env/arena/arena_utils.py
bathroom
¶
Classes:
| Name | Description |
|---|---|
ShowerDoor |
|
Attributes:
| Name | Type | Description |
|---|---|---|
SHOWER_DOOR |
|
ShowerDoor
¶
Bases: MlSpacesArticulationObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/arena/bathroom.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
cabinet
¶
Classes:
| Name | Description |
|---|---|
Cabinet |
|
Attributes:
| Name | Type | Description |
|---|---|---|
CABINET |
|
Cabinet
¶
Bases: MlSpacesArticulationObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/arena/cabinet.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
drawer
¶
Classes:
| Name | Description |
|---|---|
Drawer |
|
Attributes:
| Name | Type | Description |
|---|---|---|
DRAWER |
|
Drawer
¶
Bases: MlSpacesArticulationObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/arena/drawer.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
kitchen
¶
Classes:
| Name | Description |
|---|---|
Dishwasher |
|
Oven |
|
Stoveknob |
|
Attributes:
| Name | Type | Description |
|---|---|---|
DISHWASHER |
|
|
OVEN |
|
|
STOVEKNOB |
|
Dishwasher
¶
Bases: MlSpacesArticulationObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/arena/kitchen.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
Oven
¶
Bases: MlSpacesArticulationObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/arena/kitchen.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
Stoveknob
¶
Bases: MlSpacesArticulationObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/arena/kitchen.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
procthor_types
¶
Classes:
| Name | Description |
|---|---|
PhysicalProperty |
|
RandomizePhysicalProperties |
|
PhysicalProperty
¶
RandomizePhysicalProperties
¶
Methods:
| Name | Description |
|---|---|
enable_property |
Enable randomization for a specific property. |
get_random_value |
Get a random value for a specific property. |
get_range |
Get the randomization range for a specific property. |
is_enabled |
Check if randomization is enabled for a specific property. |
set_range |
Set the randomization range for a specific property. |
Attributes:
| Name | Type | Description |
|---|---|---|
properties |
|
|
randomize_density |
bool
|
|
randomize_friction |
bool
|
|
randomize_joint_armature |
bool
|
|
randomize_joint_damping |
bool
|
|
randomize_joint_frictionloss |
bool
|
|
randomize_joint_limited |
bool
|
|
randomize_joint_stiffness |
bool
|
|
randomize_mass |
bool
|
|
range_density |
tuple[float, float]
|
|
range_friction |
tuple[float, float]
|
|
range_joint_armature |
tuple[float, float]
|
|
range_joint_damping |
tuple[float, float]
|
|
range_joint_frictionloss |
tuple[float, float]
|
|
range_joint_limited |
tuple[float, float]
|
|
range_joint_stiffness |
tuple[float, float]
|
|
range_mass |
tuple[float, float]
|
|
Source code in molmo_spaces/env/arena/procthor_types.py
properties
instance-attribute
¶
properties = {'friction': PhysicalProperty(), 'density': PhysicalProperty(), 'mass': PhysicalProperty(), 'joint': {'stiffness': PhysicalProperty(), 'damping': PhysicalProperty(), 'limited': PhysicalProperty(), 'armature': PhysicalProperty(), 'frictionloss': PhysicalProperty()}}
enable_property
¶
Enable randomization for a specific property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property_name
|
str
|
Name of the property to enable ('friction', 'density', 'mass', 'joint') |
required |
joint_property
|
str
|
If property_name is 'joint', specify which joint property |
None
|
Source code in molmo_spaces/env/arena/procthor_types.py
get_random_value
¶
Get a random value for a specific property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property_name
|
str
|
Name of the property to get random value for |
required |
joint_property
|
If property_name is 'joint', specify which joint property |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
A random value for the property |
Source code in molmo_spaces/env/arena/procthor_types.py
get_range
¶
Get the randomization range for a specific property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property_name
|
str
|
Name of the property to get range for |
required |
joint_property
|
str
|
If property_name is 'joint', specify which joint property |
None
|
Returns:
| Type | Description |
|---|---|
tuple[float, float]
|
Tuple[float, float]: The (min, max) range for the property |
Source code in molmo_spaces/env/arena/procthor_types.py
is_enabled
¶
Check if randomization is enabled for a specific property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property_name
|
str
|
Name of the property to check |
required |
joint_property
|
str
|
If property_name is 'joint', specify which joint property |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if randomization is enabled for the property |
Source code in molmo_spaces/env/arena/procthor_types.py
set_range
¶
Set the randomization range for a specific property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
property_name
|
str
|
Name of the property to set range for |
required |
range
|
tuple[float, float]
|
Tuple of (min, max) values |
required |
joint_property
|
str
|
If property_name is 'joint', specify which joint property |
None
|
Source code in molmo_spaces/env/arena/procthor_types.py
randomization
¶
Modules:
| Name | Description |
|---|---|
dynamics |
|
lighting |
|
test_randomizers |
Env wrapper to randomize the scene. |
texture |
|
dynamics
¶
Classes:
| Name | Description |
|---|---|
DynamicsRandomizer |
Randomizer for dynamics properties of MlSpacesObject instances. |
DynamicsRandomizer
¶
DynamicsRandomizer(random_state: RandomState | None = None, randomize_friction: bool = True, randomize_mass: bool = True, randomize_inertia: bool = True, friction_perturbation_ratio: float = 0.1, mass_perturbation_ratio: float = 0.1, inertia_perturbation_ratio: float = 0.1)
Randomizer for dynamics properties of MlSpacesObject instances.
Randomizes object-level properties: friction (of geoms), mass, and inertia. Note: Density cannot be modified at runtime in MuJoCo, only mass can be changed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
random_state
|
RandomState | None
|
Random state for reproducibility. If None, uses global numpy random state. |
None
|
randomize_friction
|
bool
|
If True, randomizes geom friction |
True
|
randomize_mass
|
bool
|
If True, randomizes object mass |
True
|
randomize_inertia
|
bool
|
If True, randomizes object inertia |
True
|
friction_perturbation_ratio
|
float
|
Relative magnitude of friction randomization |
0.1
|
mass_perturbation_ratio
|
float
|
Relative magnitude of mass randomization |
0.1
|
inertia_perturbation_ratio
|
float
|
Relative magnitude of inertia randomization |
0.1
|
Methods:
| Name | Description |
|---|---|
randomize_object |
Randomize dynamics properties of a single MlSpacesObject. |
randomize_objects |
Randomize dynamics properties of multiple MlSpacesObject instances. |
restore_object |
Restore default values for a single object. |
restore_objects |
Restore default values for multiple objects. |
Attributes:
| Name | Type | Description |
|---|---|---|
friction_perturbation_ratio |
|
|
inertia_perturbation_ratio |
|
|
mass_perturbation_ratio |
|
|
random_state |
|
|
randomize_friction |
|
|
randomize_inertia |
|
|
randomize_mass |
|
Source code in molmo_spaces/env/arena/randomization/dynamics.py
friction_perturbation_ratio
instance-attribute
¶ inertia_perturbation_ratio
instance-attribute
¶ randomize_object
¶randomize_object(obj: MlSpacesObject) -> None
Randomize dynamics properties of a single MlSpacesObject.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
MlSpacesObject
|
MlSpacesObject instance to randomize |
required |
Source code in molmo_spaces/env/arena/randomization/dynamics.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | |
randomize_objects
¶randomize_objects(objects: list[MlSpacesObject]) -> None
Randomize dynamics properties of multiple MlSpacesObject instances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
objects
|
list[MlSpacesObject]
|
List of MlSpacesObject instances to randomize |
required |
Source code in molmo_spaces/env/arena/randomization/dynamics.py
restore_object
¶restore_object(obj: MlSpacesObject) -> None
Restore default values for a single object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
MlSpacesObject
|
MlSpacesObject instance to restore |
required |
Source code in molmo_spaces/env/arena/randomization/dynamics.py
restore_objects
¶restore_objects(objects: list[MlSpacesObject]) -> None
Restore default values for multiple objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
objects
|
list[MlSpacesObject]
|
List of MlSpacesObject instances to restore |
required |
Source code in molmo_spaces/env/arena/randomization/dynamics.py
lighting
¶
Classes:
| Name | Description |
|---|---|
LightingRandomizer |
Randomizer for lighting properties in MuJoCo simulations. |
LightingRandomizer
¶
LightingRandomizer(model: MjModel, random_state: RandomState | None = None, light_names: list[str] | None = None, randomize_position: bool = True, randomize_direction: bool = True, randomize_specular: bool = True, randomize_ambient: bool = True, randomize_diffuse: bool = True, randomize_active: bool = True, position_perturbation_size: float = 0.1, direction_perturbation_size: float = 0.35, specular_perturbation_size: float = 0.1, ambient_perturbation_size: float = 0.1, diffuse_perturbation_size: float = 0.1)
Randomizer for lighting properties in MuJoCo simulations.
Based on the mujoco-py LightingModder implementation, adapted to work with MjModel and MjData directly (instead of MjSim).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
MjModel
|
MuJoCo model |
required |
random_state
|
RandomState | None
|
Random state for reproducibility. If None, uses global numpy random state. |
None
|
light_names
|
list[str] | None
|
List of light names to randomize. If None, randomizes all lights in the model. |
None
|
randomize_position
|
bool
|
If True, randomizes light position |
True
|
randomize_direction
|
bool
|
If True, randomizes light direction |
True
|
randomize_specular
|
bool
|
If True, randomizes specular color |
True
|
randomize_ambient
|
bool
|
If True, randomizes ambient color |
True
|
randomize_diffuse
|
bool
|
If True, randomizes diffuse color |
True
|
randomize_active
|
bool
|
If True, randomizes whether light is active |
True
|
position_perturbation_size
|
float
|
Magnitude of position randomization |
0.1
|
direction_perturbation_size
|
float
|
Magnitude of direction randomization in radians |
0.35
|
specular_perturbation_size
|
float
|
Magnitude of specular color randomization |
0.1
|
ambient_perturbation_size
|
float
|
Magnitude of ambient color randomization |
0.1
|
diffuse_perturbation_size
|
float
|
Magnitude of diffuse color randomization |
0.1
|
Note
MjData should be passed to the randomize() method, not to init.
Methods:
| Name | Description |
|---|---|
get_active |
Get active state of a specific light. |
get_ambient |
Get ambient color of a specific light. |
get_diffuse |
Get diffuse color of a specific light. |
get_dir |
Get direction of a specific light. |
get_pos |
Get position of a specific light. |
get_specular |
Get specular color of a specific light. |
randomize |
Randomize all enabled light properties. |
restore_defaults |
Restore saved default light parameter values. |
save_defaults |
Save default light parameter values from the current model state. |
set_active |
Set active state of a specific light. |
set_ambient |
Set ambient color of a specific light. |
set_diffuse |
Set diffuse color of a specific light. |
set_dir |
Set direction of a specific light. |
set_pos |
Set position of a specific light. |
set_specular |
Set specular color of a specific light. |
update_model |
Update the model reference. |
Attributes:
Source code in molmo_spaces/env/arena/randomization/lighting.py
ambient_perturbation_size
instance-attribute
¶ diffuse_perturbation_size
instance-attribute
¶ direction_perturbation_size
instance-attribute
¶ position_perturbation_size
instance-attribute
¶ specular_perturbation_size
instance-attribute
¶ get_active
¶Get active state of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
1 if active, 0 if inactive |
Source code in molmo_spaces/env/arena/randomization/lighting.py
get_ambient
¶Get ambient color of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (r, g, b) ambient color |
Source code in molmo_spaces/env/arena/randomization/lighting.py
get_diffuse
¶Get diffuse color of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (r, g, b) diffuse color |
Source code in molmo_spaces/env/arena/randomization/lighting.py
get_dir
¶Get direction of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (x, y, z) direction vector |
Source code in molmo_spaces/env/arena/randomization/lighting.py
get_pos
¶Get position of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (x, y, z) position |
Source code in molmo_spaces/env/arena/randomization/lighting.py
get_specular
¶Get specular color of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (r, g, b) specular color |
Source code in molmo_spaces/env/arena/randomization/lighting.py
randomize
¶Randomize all enabled light properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
MjData | None
|
MuJoCo data for forward pass. If None, forward pass is skipped. |
None
|
Source code in molmo_spaces/env/arena/randomization/lighting.py
restore_defaults
¶Restore saved default light parameter values.
Source code in molmo_spaces/env/arena/randomization/lighting.py
save_defaults
¶Save default light parameter values from the current model state.
Source code in molmo_spaces/env/arena/randomization/lighting.py
set_active
¶Set active state of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
value
|
int
|
1 for active, 0 for inactive |
required |
Source code in molmo_spaces/env/arena/randomization/lighting.py
set_ambient
¶Set ambient color of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
value
|
ndarray
|
(r, g, b) ambient color |
required |
Source code in molmo_spaces/env/arena/randomization/lighting.py
set_diffuse
¶Set diffuse color of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
value
|
ndarray
|
(r, g, b) diffuse color |
required |
Source code in molmo_spaces/env/arena/randomization/lighting.py
set_dir
¶Set direction of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
value
|
ndarray
|
(x, y, z) direction vector |
required |
Source code in molmo_spaces/env/arena/randomization/lighting.py
set_pos
¶Set position of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
value
|
ndarray
|
(x, y, z) position |
required |
Source code in molmo_spaces/env/arena/randomization/lighting.py
set_specular
¶Set specular color of a specific light.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
light_id
|
int
|
ID of the light |
required |
value
|
ndarray
|
(r, g, b) specular color |
required |
Source code in molmo_spaces/env/arena/randomization/lighting.py
update_model
¶Update the model reference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
MjModel
|
New MuJoCo model |
required |
test_randomizers
¶
Env wrapper to randomize the scene.
TEST RUNTIME RANDOMIZATION¶
- lightings (randomize intensity and color and position)
- textures (switch among preloaded textures and randomize material properties)
- dynamics (object mass, inertia, friction, density, etc.)
Functions:
| Name | Description |
|---|---|
test |
Test function to test the randomizers and visualize using MuJoCo passive viewer. |
test
¶
test(scene_path: str, texture_paths: list[str] | None = None, relaunch_viewer_on_randomize: bool = True) -> None
Test function to test the randomizers and visualize using MuJoCo passive viewer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scene_path
|
str
|
Path to scene XML file. Model and data will be loaded from this file. |
required |
texture_paths
|
list[str] | None
|
Optional list of texture file paths for texture randomization. If None, uses textures already loaded in the scene XML. |
None
|
relaunch_viewer_on_randomize
|
bool
|
If True, relaunches the viewer after each randomization to ensure model property changes (textures, lights) are visible. Default is True. |
True
|
Loads the scene, applies randomization, and visualizes the results.
Source code in molmo_spaces/env/arena/randomization/test_randomizers.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | |
texture
¶
Classes:
| Name | Description |
|---|---|
TextureRandomizer |
Randomizer for geom colors, material properties, and textures in MuJoCo simulations. |
Functions:
| Name | Description |
|---|---|
assign_texture_to_material |
Assign a texture to a material's RGB role. |
create_empty_texture |
Create an empty texture in the spec using the placeholder file. |
create_placeholder_texture_file |
Create a temporary placeholder texture file for MuJoCo 2D textures. |
setup_empty_materials |
Create a pool of empty materials and textures in the MjSpec that can be assigned to geoms at runtime. |
Attributes:
| Name | Type | Description |
|---|---|---|
TEXTURE_FOLDER_PATH |
|
TEXTURE_FOLDER_PATH
module-attribute
¶
TEXTURE_FOLDER_PATH = ASSETS_DIR / 'objects' / 'thor' / 'Textures'
TextureRandomizer
¶
TextureRandomizer(model: MjModel, random_state: RandomState | None = None, geom_names: list[str] | None = None, randomize_geom_rgba: bool = True, randomize_material_rgba: bool = True, randomize_material_specular: bool = True, randomize_material_shininess: bool = True, randomize_texture: bool = True, texture_paths: list[str] | None = None, scene_metadata: dict | None = None, rgba_perturbation_size: float = 0.1, specular_perturbation_size: float = 0.1, shininess_perturbation_size: float = 0.1)
Randomizer for geom colors, material properties, and textures in MuJoCo simulations.
Can randomize: - Geom RGBA colors - Material properties (RGBA, specular, shininess) - Texture bitmaps from loaded texture files
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
MjModel
|
MuJoCo model |
required |
random_state
|
RandomState | None
|
Random state for reproducibility. If None, uses global numpy random state. |
None
|
geom_names
|
list[str] | None
|
List of geom names to randomize. If None, randomizes all geoms in the model. |
None
|
randomize_geom_rgba
|
bool
|
If True, randomizes geom RGBA colors |
True
|
randomize_material_rgba
|
bool
|
If True, randomizes material RGBA colors |
True
|
randomize_material_specular
|
bool
|
If True, randomizes material specular |
True
|
randomize_material_shininess
|
bool
|
If True, randomizes material shininess |
True
|
randomize_texture
|
bool
|
If True, randomizes texture bitmaps from loaded textures. Default behavior uses textures already loaded in the model XML. |
True
|
texture_paths
|
list[str] | None
|
Optional list of paths to external texture image files (PNG, etc.). If None (default), uses textures already loaded in the model XML. If provided, loads textures from these external files instead. |
None
|
scene_metadata
|
dict | None
|
Optional scene metadata for category-based texture randomization |
None
|
rgba_perturbation_size
|
float
|
Magnitude of RGBA color randomization |
0.1
|
specular_perturbation_size
|
float
|
Magnitude of specular randomization |
0.1
|
shininess_perturbation_size
|
float
|
Magnitude of shininess randomization |
0.1
|
Note
MjData should be passed to the randomize() method, not to init.
Methods:
| Name | Description |
|---|---|
randomize |
Randomize all textures, colors, and material attributes for all geoms, regardless of category. |
randomize_by_category |
Randomize textures and colors by category. |
randomize_object |
Randomize colors and material attributes for a single MlSpacesObject. |
save_defaults |
Save default geom and material parameter values from the current model state. |
Attributes:
Source code in molmo_spaces/env/arena/randomization/texture.py
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
material_database_filename
class-attribute
instance-attribute
¶material_database_filename = ASSETS_DIR / 'objects' / 'thor' / 'material-database.json'
materials_to_texture_filename
class-attribute
instance-attribute
¶materials_to_texture_filename = ASSETS_DIR / 'objects' / 'thor' / 'material_to_textures.json'
randomize_material_shininess
instance-attribute
¶ randomize_material_specular
instance-attribute
¶ shininess_perturbation_size
instance-attribute
¶ specular_perturbation_size
instance-attribute
¶ randomize
¶Randomize all textures, colors, and material attributes for all geoms, regardless of category. This method bypasses category filtering and applies full randomization to all geoms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
MjData | None
|
MuJoCo data for forward pass. If None, forward pass is skipped. |
None
|
Source code in molmo_spaces/env/arena/randomization/texture.py
1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 | |
randomize_by_category
¶Randomize textures and colors by category. For each geom, randomly picks a material from the appropriate category in MAT_PER_CATEGORY and applies its texture (if available) or color. Each geom gets a different random material.
Targets: floors, countertops, tabletops, doors (including door handles, drawers, cabinets)
Source code in molmo_spaces/env/arena/randomization/texture.py
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 | |
randomize_object
¶Randomize colors and material attributes for a single MlSpacesObject. Only randomizes geoms that don't have textures.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
thor_object
|
MlSpacesObject
|
MlSpacesObject instance to randomize |
required |
data
|
MjData | None
|
MuJoCo data for forward pass. If None, forward pass is skipped. |
None
|
Source code in molmo_spaces/env/arena/randomization/texture.py
save_defaults
¶Save default geom and material parameter values from the current model state. Optimized for large scenes by only processing visual geoms (contype == 0).
Source code in molmo_spaces/env/arena/randomization/texture.py
assign_texture_to_material
¶
Assign a texture to a material's RGB role.
Source code in molmo_spaces/env/arena/randomization/texture.py
create_empty_texture
¶
Create an empty texture in the spec using the placeholder file.
Source code in molmo_spaces/env/arena/randomization/texture.py
create_placeholder_texture_file
¶
Create a temporary placeholder texture file for MuJoCo 2D textures.
Source code in molmo_spaces/env/arena/randomization/texture.py
setup_empty_materials
¶
Create a pool of empty materials and textures in the MjSpec that can be assigned to geoms at runtime. This allows texture randomization to modify materials and textures without affecting other geoms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
MjSpec | None
|
MjSpec to modify |
None
|
num_materials
|
int
|
Maximum number of empty materials/textures to create. Actual number is based on visual geom count with a safety buffer. |
200
|
Source code in molmo_spaces/env/arena/randomization/texture.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |
scene_tweaks
¶
Classes:
| Name | Description |
|---|---|
Context |
|
ContextFlags |
|
Functions:
| Name | Description |
|---|---|
does_body_aabb_intersect_box_site |
|
is_body_com_within_box_site |
|
is_body_within_any_site |
|
is_body_within_site_in_freespace |
|
key_callback |
|
run_check_body_com_all_sites |
|
Attributes:
| Name | Type | Description |
|---|---|---|
DISTANCE_RAYCAST_THRESHOLD |
|
|
OFFSET_UP_RAYCAST |
|
|
SITE_SIZE_TOLERANCE |
|
|
args |
|
|
body_handle |
|
|
body_name |
|
|
context |
|
|
data |
|
|
house_path |
|
|
model |
|
|
parser |
|
|
result |
|
|
t_start |
|
SITE_SIZE_TOLERANCE
module-attribute
¶
Context
¶
ContextFlags
dataclass
¶
Attributes:
| Name | Type | Description |
|---|---|---|
dirty_pause |
|
|
dirty_reset |
|
|
dirty_test_aabb_intersect |
|
|
dirty_test_com_inside |
|
|
dirty_test_in_free_space |
|
|
dirty_test_with_all_sites |
|
does_body_aabb_intersect_box_site
¶
is_body_com_within_box_site
¶
Source code in molmo_spaces/env/arena/scene_tweaks.py
is_body_within_any_site
¶
Source code in molmo_spaces/env/arena/scene_tweaks.py
is_body_within_site_in_freespace
¶
is_body_within_site_in_freespace(site_id: int, body_id: int, model: MjModel, data: MjData) -> tuple[bool, float, str]
Source code in molmo_spaces/env/arena/scene_tweaks.py
key_callback
¶
Source code in molmo_spaces/env/arena/scene_tweaks.py
run_check_body_com_all_sites
¶
Source code in molmo_spaces/env/arena/scene_tweaks.py
camera_manager
¶
Camera management for MolmoSpaces environments.
This module handles all camera-related functionality including camera registration, pose updates, rendering, and setup from camera configurations.
Classes:
| Name | Description |
|---|---|
Camera |
Base camera class with position and orientation. |
CameraManager |
Manages all camera-related operations for an environment. |
CameraRegistry |
Registry for camera objects with auto-updating support. |
RobotMountedCamera |
Generic robot-mounted camera that can attach to any body/joint with configurable offsets. |
Attributes:
| Name | Type | Description |
|---|---|---|
log |
|
Camera
¶
Camera(name: str, pos: NDArray[float32] | None = None, forward: NDArray[float32] | None = None, up: NDArray[float32] | None = None, fov: float = 45.0)
Base camera class with position and orientation.
Methods:
| Name | Description |
|---|---|
get_pose |
return 4x4 pose |
update_pose |
Update camera pose. Returns True if pose changed, False otherwise. |
Attributes:
| Name | Type | Description |
|---|---|---|
forward |
NDArray[float32]
|
|
fov |
float
|
|
name |
str
|
|
pos |
NDArray[float32]
|
|
up |
NDArray[float32]
|
|
Source code in molmo_spaces/env/camera_manager.py
forward
instance-attribute
¶
forward: NDArray[float32] = forward if forward is not None else array([1.0, 0.0, 0.0], dtype=float32)
pos
instance-attribute
¶
up
instance-attribute
¶
get_pose
¶
return 4x4 pose
Source code in molmo_spaces/env/camera_manager.py
update_pose
¶
update_pose(env: CPUMujocoEnv) -> bool
CameraManager
¶
Manages all camera-related operations for an environment.
This class encapsulates camera setup, registration, and rendering operations, keeping camera logic separate from core environment concerns.
Note: This class does not store a reference to the environment to avoid circular references and enable pickling for multiprocessing. Instead, the environment is passed as a parameter to methods that need it.
Initialize the camera manager with an empty registry.
Methods:
| Name | Description |
|---|---|
add_camera |
Adds or updates a static camera in the registry with its world pose. |
add_robot_mounted_camera |
Add a robot-mounted camera that follows a specific body/joint. |
add_robot_mounted_camera_with_quaternion |
Add a robot-mounted camera that follows a specific body/joint using quaternion orientation. |
apply_mjcf_camera_noise |
Apply position, orientation, and FOV noise to MJCF camera parameters. |
create_lookat_pose |
Create camera position and orientation vectors using enhanced lookat approach. |
create_lookat_pose_world |
Create camera position and orientation vectors using enhanced lookat approach. |
create_quaternion_camera_pose |
Create camera pose using quaternion-based orientation relative to reference body. |
create_robot_mounted_camera_pose |
Create generic robot-mounted camera pose using the existing create_lookat_pose method. |
setup_cameras |
Set up all cameras from a CameraSystemConfig. |
Attributes:
| Name | Type | Description |
|---|---|---|
registry |
CameraRegistry
|
|
Source code in molmo_spaces/env/camera_manager.py
add_camera
¶
add_camera(camera_name: str, pos: NDArray[float32], forward: NDArray[float32], up: NDArray[float32], fov: float = 45.0) -> None
Adds or updates a static camera in the registry with its world pose.
Source code in molmo_spaces/env/camera_manager.py
add_robot_mounted_camera
¶
add_robot_mounted_camera(env, camera_name: str, reference_body_names: str | list[str], camera_offset: NDArray[float32] | None = None, lookat_offset: NDArray[float32] | None = None, up_axis: str = 'z') -> None
Add a robot-mounted camera that follows a specific body/joint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
camera_name
|
str
|
Name for the camera |
required |
reference_body_names
|
str | list[str]
|
Body name(s) to attach camera to. If list, tries each until one works. |
required |
camera_offset
|
NDArray[float32] | None
|
Camera position relative to reference body frame |
None
|
lookat_offset
|
NDArray[float32] | None
|
Offset from reference body to look at |
None
|
up_axis
|
str
|
Which local axis of reference frame is "up" ("x", "y", or "z") |
'z'
|
Source code in molmo_spaces/env/camera_manager.py
add_robot_mounted_camera_with_quaternion
¶
add_robot_mounted_camera_with_quaternion(env, camera_name: str, reference_body_names: str | list[str], camera_offset: NDArray[float32] | None = None, camera_quaternion: NDArray[float32] | None = None, camera_fov: float = 45) -> None
Add a robot-mounted camera that follows a specific body/joint using quaternion orientation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
camera_name
|
str
|
Name for the camera |
required |
reference_body_names
|
str | list[str]
|
Body name(s) to attach camera to. If list, tries each until one works. |
required |
camera_offset
|
NDArray[float32] | None
|
Camera position relative to reference body frame |
None
|
camera_quaternion
|
NDArray[float32] | None
|
Quaternion [w, x, y, z] relative to reference body frame |
None
|
Source code in molmo_spaces/env/camera_manager.py
apply_mjcf_camera_noise
staticmethod
¶
apply_mjcf_camera_noise(camera_pos: ndarray, camera_quat: ndarray, camera_fov: float, camera_config: MjcfCameraConfig, rng=random) -> tuple[ndarray, ndarray, float]
Apply position, orientation, and FOV noise to MJCF camera parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
camera_pos
|
ndarray
|
Camera position (body-frame offset), modified in place. |
required |
camera_quat
|
ndarray
|
Camera quaternion [w,x,y,z] (body-frame), modified in place. |
required |
camera_fov
|
float
|
Base FOV in degrees. |
required |
camera_config
|
MjcfCameraConfig
|
Config carrying noise ranges. |
required |
rng
|
Random generator (np.random module or np.random.RandomState). |
random
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray, float]
|
Tuple of (noised_pos, noised_quat, noised_fov). |
Source code in molmo_spaces/env/camera_manager.py
create_lookat_pose
¶
create_lookat_pose(env, camera_relative_pos: ndarray, rpy: ndarray, reference_body_name: str, lookat_target: ndarray = None, lookat_body_name: str = None, camera_up: ndarray = None) -> tuple[ndarray, ndarray, ndarray]
Create camera position and orientation vectors using enhanced lookat approach.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
camera_relative_pos
|
ndarray
|
Camera position relative to reference body |
required |
rpy
|
ndarray
|
Roll, pitch, yaw (currently unused but kept for compatibility) |
required |
reference_body_name
|
str
|
Body name for camera positioning reference |
required |
lookat_target
|
ndarray
|
Optional 3D point (np.array) to look at in world coordinates |
None
|
lookat_body_name
|
str
|
Optional body name to look at (used if lookat_target is None) |
None
|
camera_up
|
ndarray
|
Optional desired up direction for camera (np.array in world coordinates) If None, uses world Z-up [0, 0, 1] |
None
|
Source code in molmo_spaces/env/camera_manager.py
create_lookat_pose_world
¶
create_lookat_pose_world(env, camera_pos_world: ndarray, rpy: ndarray, lookat_target: ndarray | None = None, lookat_body_name: str | None = None, camera_up: ndarray | None = None) -> tuple[ndarray, ndarray, ndarray]
Create camera position and orientation vectors using enhanced lookat approach. Functionally equivalent to create_lookat_pose, but without use of a reference body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
camera_pos_world
|
ndarray
|
Camera position in world coordinates |
required |
rpy
|
ndarray
|
Roll, pitch, yaw (currently unused but kept for compatibility) |
required |
lookat_target
|
ndarray | None
|
Optional 3D point (np.array) to look at in world coordinates |
None
|
lookat_body_name
|
str | None
|
Optional body name to look at (used if lookat_target is None) |
None
|
camera_up
|
ndarray | None
|
Optional desired up direction for camera (np.array in world coordinates) If None, uses world Z-up [0, 0, 1] |
None
|
Returns: Tuple of (camera_pos_world, forward_vector, up_vector), each of shape (3,)
Source code in molmo_spaces/env/camera_manager.py
create_quaternion_camera_pose
¶
create_quaternion_camera_pose(env, reference_body_name: str, camera_offset: ndarray, camera_quaternion: ndarray) -> tuple[ndarray, ndarray, ndarray]
Create camera pose using quaternion-based orientation relative to reference body.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
reference_body_name
|
str
|
Name of the body to attach camera to |
required |
camera_offset
|
ndarray
|
Camera position relative to reference body frame |
required |
camera_quaternion
|
ndarray
|
Quaternion [w, x, y, z] relative to reference body frame |
required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray, ndarray]
|
Tuple of (camera_pos_world, forward_vector, up_vector) |
Source code in molmo_spaces/env/camera_manager.py
create_robot_mounted_camera_pose
¶
create_robot_mounted_camera_pose(env, reference_body_name: str, camera_offset: ndarray, lookat_offset: ndarray = None, up_axis: str = 'z') -> tuple[ndarray, ndarray, ndarray]
Create generic robot-mounted camera pose using the existing create_lookat_pose method. Camera positioned relative to reference body, looking at a specific point offset from the body, with camera up aligned with the specified local axis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
reference_body_name
|
str
|
Name of the body to attach camera to |
required |
camera_offset
|
ndarray
|
Camera position relative to reference body frame |
required |
lookat_offset
|
ndarray
|
Offset from reference body to look at (default: 8cm forward along local Z axis) |
None
|
up_axis
|
str
|
Which local axis of reference frame is "up" ("x", "y", or "z") |
'z'
|
Source code in molmo_spaces/env/camera_manager.py
setup_cameras
¶
setup_cameras(env, camera_system_config: CameraSystemConfig, workspace_center=None, visibility_resolver: Callable[[str], list[str]] | None = None, deterministic_only: bool = False) -> None
Set up all cameras from a CameraSystemConfig.
This is the main entry point for camera setup. It processes each camera spec and delegates to the appropriate setup method based on camera type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
env
|
The environment instance (CPUMujocoEnv) |
required | |
camera_system_config
|
CameraSystemConfig
|
CameraSystemConfig instance with all camera specs |
required |
workspace_center
|
Optional workspace center position (np.ndarray) for camera placement |
None
|
|
visibility_resolver
|
Callable[[str], list[str]] | None
|
Optional callable(key: str) -> str that resolves special visibility keys |
None
|
Source code in molmo_spaces/env/camera_manager.py
CameraRegistry
¶
Registry for camera objects with auto-updating support.
Methods:
| Name | Description |
|---|---|
__contains__ |
|
__getitem__ |
|
__iter__ |
|
__setitem__ |
|
add_camera |
Adds a camera object to the registry. |
add_static_camera |
Adds a static camera to the registry. |
keys |
|
update_all_cameras |
Update all cameras that need updating. Returns list of cameras that changed. |
Attributes:
| Name | Type | Description |
|---|---|---|
cameras |
dict[str, Camera]
|
|
Source code in molmo_spaces/env/camera_manager.py
__contains__
¶
__iter__
¶
add_static_camera
¶
add_static_camera(name: str, pos: NDArray[float32], forward: NDArray[float32], up: NDArray[float32]) -> None
Adds a static camera to the registry.
Source code in molmo_spaces/env/camera_manager.py
keys
¶
update_all_cameras
¶
update_all_cameras(env: CPUMujocoEnv) -> list[str]
Update all cameras that need updating. Returns list of cameras that changed.
Source code in molmo_spaces/env/camera_manager.py
RobotMountedCamera
¶
RobotMountedCamera(name: str, reference_body_names: str | list[str], camera_offset: NDArray[float32] | list[float] | None = None, lookat_offset: NDArray[float32] | list[float] | None = None, up_axis: str = 'z', camera_quaternion: NDArray[float32] | list[float] | None = None, camera_fov: float = 45)
Bases: Camera
Generic robot-mounted camera that can attach to any body/joint with configurable offsets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Camera name |
required |
reference_body_names
|
str | list[str]
|
Body name(s) to attach camera to. If list, tries each until one works. |
required |
camera_offset
|
NDArray[float32] | list[float] | None
|
Camera position relative to reference body frame |
None
|
lookat_offset
|
NDArray[float32] | list[float] | None
|
Offset from reference body to look at (used when camera_quaternion is None) |
None
|
up_axis
|
str
|
Which local axis of reference frame is "up" ("x", "y", or "z") (used when camera_quaternion is None) |
'z'
|
camera_quaternion
|
NDArray[float32] | list[float] | None
|
Quaternion [w, x, y, z] relative to reference body frame. If provided, overrides lookat_offset and up_axis |
None
|
Methods:
| Name | Description |
|---|---|
get_pose |
return 4x4 pose |
update_pose |
Update camera pose based on current reference body state. Returns True if pose changed. |
Attributes:
| Name | Type | Description |
|---|---|---|
camera_offset |
NDArray[float32]
|
|
camera_quaternion |
NDArray[float32] | None
|
|
forward |
NDArray[float32]
|
|
fov |
float
|
|
lookat_offset |
NDArray[float32]
|
|
name |
str
|
|
pos |
NDArray[float32]
|
|
reference_body_names |
list[str]
|
|
up |
NDArray[float32]
|
|
up_axis |
str
|
|
Source code in molmo_spaces/env/camera_manager.py
camera_offset
instance-attribute
¶
camera_offset: NDArray[float32] = array(camera_offset, dtype=float32) if camera_offset is not None else array([0.1, 0.0, -0.15], dtype=float32)
camera_quaternion
instance-attribute
¶
camera_quaternion: NDArray[float32] | None = array(camera_quaternion, dtype=float32) if camera_quaternion is not None else None
forward
instance-attribute
¶
forward: NDArray[float32] = forward if forward is not None else array([1.0, 0.0, 0.0], dtype=float32)
lookat_offset
instance-attribute
¶
lookat_offset: NDArray[float32] = array(lookat_offset, dtype=float32) if lookat_offset is not None else array([0.0, 0.0, 0.08], dtype=float32)
pos
instance-attribute
¶
reference_body_names
instance-attribute
¶
reference_body_names: list[str] = [reference_body_names] if isinstance(reference_body_names, str) else reference_body_names
up
instance-attribute
¶
get_pose
¶
return 4x4 pose
Source code in molmo_spaces/env/camera_manager.py
update_pose
¶
update_pose(env: CPUMujocoEnv) -> bool
Update camera pose based on current reference body state. Returns True if pose changed.
Source code in molmo_spaces/env/camera_manager.py
data_views
¶
Classes:
| Name | Description |
|---|---|
Door |
|
MlSpacesArticulationObject |
|
MlSpacesBody |
|
MlSpacesCamera |
|
MlSpacesFreeJointBody |
|
MlSpacesImmovableBody |
|
MlSpacesMocapBody |
|
MlSpacesObject |
Class to represent scene object data |
MlSpacesObjectAbstract |
|
Functions:
| Name | Description |
|---|---|
create_mlspaces_body |
|
Door
¶
Bases: MlSpacesArticulationObject
Methods:
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
door_name |
str
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
num_handles |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/data_views.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_handle_bboxes_array
¶
Get handle bounding boxes as an array. Finds leaf bodies in the door hierarchy (assumed to be handles) and returns their visual geom AABBs. Returns: np.ndarray: Array of AABBs (center, size) for handle visual geoms
Source code in molmo_spaces/env/data_views.py
get_handle_joint_index
¶
Get the index of the handle joint (the joint that has 'handle' in its name). Returns: int: Index of the handle joint in self.joint_ids list
Source code in molmo_spaces/env/data_views.py
get_handle_pose
¶
Get handle pose (position + quaternion) as a single array. Finds the first handle visual geom and returns its pose. If multiple handles exist, returns the first one. Returns: np.ndarray: Handle pose [x, y, z, qw, qx, qy, qz]
Source code in molmo_spaces/env/data_views.py
get_hinge_joint_index
¶
Get the index of the door hinge joint (the joint that does not have 'handle' in its name). Returns: int: Index of the hinge joint in self.joint_ids list (not the joint ID itself) Warns: UserWarning: If no joint without 'handle' in its name is found.
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_swing_arc_circle
¶
Source code in molmo_spaces/env/data_views.py
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
handle_name
¶
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
is_point_in_swing_arc
¶
Source code in molmo_spaces/env/data_views.py
MlSpacesArticulationObject
¶
Bases: MlSpacesObject
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_joint_anchor_position |
|
get_joint_armature |
|
get_joint_axis |
|
get_joint_body_orientation |
|
get_joint_damping |
|
get_joint_frictionloss |
|
get_joint_leaf_body_position |
|
get_joint_position |
|
get_joint_qpos_adr |
|
get_joint_range |
|
get_joint_stiffness |
|
get_joint_type |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
set_joint_position |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
joint_id2name |
|
|
joint_id2qpos_adr |
|
|
joint_ids |
|
|
joint_names |
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
njoints |
int
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/data_views.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_joint_anchor_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_armature
¶
get_joint_axis
¶
get_joint_body_orientation
¶
Source code in molmo_spaces/env/data_views.py
get_joint_damping
¶
get_joint_frictionloss
¶
get_joint_leaf_body_position
¶
Source code in molmo_spaces/env/data_views.py
get_joint_position
¶
get_joint_qpos_adr
¶
get_joint_range
¶
get_joint_stiffness
¶
get_joint_type
¶
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
is_object_picked_up
¶
set_joint_position
¶
MlSpacesBody
¶
MlSpacesCamera
¶
MlSpacesFreeJointBody
¶
Bases: MlSpacesBody
Attributes:
| Name | Type | Description |
|---|---|---|
body_id |
int
|
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
pose |
ndarray
|
|
position |
ndarray
|
|
quat |
ndarray
|
|
Source code in molmo_spaces/env/data_views.py
MlSpacesImmovableBody
¶
MlSpacesMocapBody
¶
MlSpacesObject
¶
Bases: MlSpacesBody
Class to represent scene object data
Methods:
| Name | Description |
|---|---|
body_name2id |
|
body_parent_id |
|
build_children_lists |
|
find_top_object_body_id |
|
get_ancestors |
|
get_descendants |
|
get_direct_children |
|
get_friction |
|
get_geom_infos |
Get geom information for this object. |
get_geom_type_name |
|
get_mass |
|
get_top_level_bodies |
Return bodies whose parent is the world body. |
is_child_name_of |
|
is_object_in_gripper |
|
is_object_picked_up |
|
Attributes:
| Name | Type | Description |
|---|---|---|
aabb_center |
ndarray
|
|
aabb_size |
ndarray
|
|
body_id |
int
|
|
body_ids |
Get all body IDs belonging to this object including descendants (lazy, cached). |
|
bvh_root |
|
|
center_of_mass |
|
|
geom_ids |
Get all geom IDs belonging to this object (lazy, cached). |
|
mj_data |
|
|
mj_model |
|
|
name |
str
|
|
object_id |
int
|
|
object_root_id |
|
|
pose |
ndarray
|
|
position |
|
|
quat |
|
Source code in molmo_spaces/env/data_views.py
body_ids
cached
property
¶
Get all body IDs belonging to this object including descendants (lazy, cached).
body_name2id
staticmethod
¶
body_parent_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
build_children_lists
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
find_top_object_body_id
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_ancestors
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_descendants
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_direct_children
staticmethod
¶
get_friction
¶
get_geom_infos
¶
get_geom_infos(include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Get geom information for this object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
include_descendants
|
bool
|
If True, includes geoms from all descendant bodies. If False, only includes geoms directly attached to this object's body. |
True
|
max_geoms
|
int | None
|
Maximum number of geoms to return. If None, returns all. |
2048
|
Returns:
| Type | Description |
|---|---|
list[dict[str, object]]
|
List of dicts with geom info: id, name, position, size, type, type_name |
Source code in molmo_spaces/env/data_views.py
get_geom_type_name
staticmethod
¶
Source code in molmo_spaces/env/data_views.py
get_mass
¶
get_top_level_bodies
staticmethod
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/data_views.py
is_child_name_of
staticmethod
¶
is_object_in_gripper
¶
MlSpacesObjectAbstract
¶
create_mlspaces_body
¶
create_mlspaces_body(data: MjData, body_name_or_id: str | int) -> MlSpacesBody
Source code in molmo_spaces/env/data_views.py
env
¶
Classes:
| Name | Description |
|---|---|
BaseMujocoEnv |
|
CPUMujocoEnv |
|
Attributes:
| Name | Type | Description |
|---|---|---|
HAS_FILAMENT |
bool
|
|
log |
|
HAS_FILAMENT
module-attribute
¶
BaseMujocoEnv
¶
Bases: ABC
Methods:
| Name | Description |
|---|---|
is_loaded |
Check if a scene is currently loaded. |
reset |
|
step |
|
Attributes:
| Name | Type | Description |
|---|---|---|
config |
|
|
current_batch_index |
int
|
Current batch index for accessing data and robots. |
current_data |
MjData
|
Current MjData instance based on current_batch_index. |
current_model |
MjModel
|
Current MjModel instance (always the same across batches). |
current_model_path |
str
|
Current string xml path instance (always the same across batches). |
current_robot |
Robot
|
Current robot instance based on current_batch_index. |
current_scene_metadata |
dict
|
Current scene metadata instance (always the same across batches). |
depth_frame |
ndarray
|
Get the latest depth frame. |
mj_datas |
Sequence[MjData]
|
|
mj_model |
MjModel
|
|
n_batch |
int
|
|
object_managers |
list[ObjectManager]
|
|
rgb_frame |
ndarray
|
Get the latest RGB frame. |
robots |
Sequence[Robot]
|
|
segmentation_frame |
ndarray
|
Get the latest segmentation frame. |
Source code in molmo_spaces/env/env.py
current_batch_index
property
writable
¶
Current batch index for accessing data and robots.
current_model
property
¶
Current MjModel instance (always the same across batches).
current_model_path
property
¶
Current string xml path instance (always the same across batches).
current_scene_metadata
property
¶
Current scene metadata instance (always the same across batches).
is_loaded
¶
reset
abstractmethod
¶
CPUMujocoEnv
¶
CPUMujocoEnv(exp_config: MlSpacesExpConfig, robot_factory: Callable[[MjData], Robot], mj_model: MjModel, mj_base_scene_path: str, parallelize: bool = True)
Bases: BaseMujocoEnv
Methods:
| Name | Description |
|---|---|
__del__ |
|
check_camera_visibility_constraints |
Check if all cameras with visibility constraints can see their target objects. |
check_if_robot_collision_at_base_pose |
Check if robot placement would result in collision with environment. |
check_robot_collision_in_current_pose |
|
check_visibility |
Check visibility of one or more target objects from a specific camera. |
cleanup_rendering |
Clean up rendering resources. |
close |
|
get_camera_parameters |
Get camera parameters for a specific camera. |
get_robot_gripper_positions |
Get current world positions of all robot grippers/end-effectors. |
get_segmentation_mask_of_object |
Get binary segmentation mask for a specific object from a camera view. |
get_thormap |
Get or create a cached occupancy map for robot placement. |
get_visible_objects |
Get list of visible objects for a specific camera (placeholder). |
is_loaded |
Check if a scene is currently loaded. |
place_robot_near |
Place robot near a target point or object with collision checking. |
render_depth_frame |
Renders a depth frame from the perspective of the specified camera. |
render_rgb_frame |
Renders an RGB frame from the perspective of the specified camera. |
render_segmentation_frame |
Renders a segmentation frame from the perspective of the specified camera. |
reset |
|
segmentation_fraction |
Calculate visibility of a body in the segmentation image. |
step |
|
Attributes:
| Name | Type | Description |
|---|---|---|
camera_manager |
|
|
config |
|
|
current_batch_index |
int
|
Current batch index for accessing data and robots. |
current_data |
MjData
|
Current MjData instance based on current_batch_index. |
current_model |
MjModel
|
Current MjModel instance (always the same across batches). |
current_model_path |
str
|
Current string xml path instance (always the same across batches). |
current_robot |
Robot
|
Current robot instance based on current_batch_index. |
current_scene_metadata |
dict
|
Current scene metadata instance (always the same across batches). |
depth_frame |
ndarray
|
Get the latest depth frame. |
mj_datas |
Sequence[MjData]
|
|
mj_model |
MjModel
|
|
n_batch |
int
|
|
object_managers |
|
|
rgb_frame |
ndarray
|
Get the latest RGB frame. |
robots |
Sequence[Robot]
|
|
segmentation_frame |
ndarray
|
Get the latest segmentation frame. |
Source code in molmo_spaces/env/env.py
current_batch_index
property
writable
¶
Current batch index for accessing data and robots.
current_model
property
¶
Current MjModel instance (always the same across batches).
current_model_path
property
¶
Current string xml path instance (always the same across batches).
current_scene_metadata
property
¶
Current scene metadata instance (always the same across batches).
__del__
¶
check_camera_visibility_constraints
¶
check_camera_visibility_constraints(visibility_resolver: Callable[[str], list[str]] | None = None, save_frames_dir: Path | str | None = None) -> tuple[bool, dict[str, dict[str, float]]]
Check if all cameras with visibility constraints can see their target objects.
This is used during robot placement to ensure that cameras (fixed exo, robot-mounted base, etc.) have good views of important objects (e.g., gripper, target objects).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
visibility_resolver
|
Callable[[str], list[str]] | None
|
Optional callable that resolves special visibility keys like "gripper" to (possibly multiple) actual body names |
None
|
save_frames_dir
|
Path | str | None
|
Optional directory to save RGB frames from each camera for debugging |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
Tuple of (all_satisfied, detailed_results) |
dict[str, dict[str, float]]
|
|
tuple[bool, dict[str, dict[str, float]]]
|
|
Source code in molmo_spaces/env/env.py
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 | |
check_if_robot_collision_at_base_pose
¶
check_if_robot_collision_at_base_pose(robot_view, robot_pose: ndarray, robot_namespace: str = 'robot_0/') -> bool
Check if robot placement would result in collision with environment.
Source code in molmo_spaces/env/env.py
check_robot_collision_in_current_pose
¶
Source code in molmo_spaces/env/env.py
check_visibility
¶
Check visibility of one or more target objects from a specific camera.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
camera_name
|
str
|
Name of camera in the registry |
required |
*target_objects
|
Variable number of object/body names to check visibility for |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
float |
float | dict[str, float]
|
If single object provided, returns visibility fraction (0.0 to 1.0) |
dict |
float | dict[str, float]
|
If multiple objects provided, returns mapping of object names to visibility fractions |
Source code in molmo_spaces/env/env.py
cleanup_rendering
¶
close
¶
Source code in molmo_spaces/env/env.py
get_camera_parameters
¶
Get camera parameters for a specific camera.
Source code in molmo_spaces/env/env.py
get_robot_gripper_positions
¶
Get current world positions of all robot grippers/end-effectors.
It's particularly useful for camera positioning to ensure good gripper visibility.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_index
|
int
|
Index of robot in batch (default 0) |
0
|
Returns:
| Type | Description |
|---|---|
dict[str, ndarray]
|
Dict mapping gripper names to their world positions as numpy arrays. |
dict[str, ndarray]
|
Returns empty dict if the robot does not have any grippers. |
Source code in molmo_spaces/env/env.py
get_segmentation_mask_of_object
¶
get_segmentation_mask_of_object(object_name: str, camera_name: str, batch_index: int = 0) -> ndarray | None
Get binary segmentation mask for a specific object from a camera view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object_name
|
str
|
Name of the object body to segment |
required |
camera_name
|
str
|
Name of the camera to render from |
required |
batch_index
|
int
|
Batch index for the environment |
0
|
Returns:
| Type | Description |
|---|---|
ndarray | None
|
Binary mask (HxW) where True indicates object pixels, or None if object not found |
Source code in molmo_spaces/env/env.py
get_thormap
¶
get_thormap(agent_radius: float = 0.35, px_per_m: int = 200) -> ProcTHORMap | iTHORMap
Get or create a cached occupancy map for robot placement.
The map is cached per scene and parameters to avoid expensive recreation. Creating the map involves re-parsing XML, re-compiling MuJoCo model, and rendering multiple depth views - typically taking 10-30 seconds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
agent_radius
|
float
|
Safety radius for occupancy dilation (default 0.35m) |
0.35
|
px_per_m
|
int
|
Pixels per meter resolution (default 200) |
200
|
Returns:
| Type | Description |
|---|---|
ProcTHORMap | iTHORMap
|
ProcTHORMap or iTHORMap depending on scene type |
Source code in molmo_spaces/env/env.py
get_visible_objects
¶
Get list of visible objects for a specific camera (placeholder).
is_loaded
¶
place_robot_near
¶
place_robot_near(robot_view, target, max_tries: int = 10, sampling_radius_range: tuple[float, float] = (0.0, 1.0), robot_safety_radius: float = 0.35, preserve_z: float = None, face_target: bool = True, check_camera_visibility: bool = False, visibility_resolver=None, excluded_positions: list[ndarray] | None = None, exclusion_threshold: float | None = None, save_visibility_frames_dir: Path | str | None = None) -> bool
Place robot near a target point or object with collision checking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
robot_view
|
Robot view object to position |
required | |
target
|
Either a 3D point (np.ndarray) or an Object instance or object name (str) |
required | |
max_tries
|
int
|
Maximum number of placement attempts |
10
|
sampling_radius_range
|
tuple[float, float]
|
Radius range around target to sample robot positions. For picking up objects, the min radius is 0.0. |
(0.0, 1.0)
|
robot_safety_radius
|
float
|
Safety radius for occupancy map collision checking |
0.35
|
preserve_z
|
float
|
Z height to preserve for robot (if None, uses current robot Z) |
None
|
face_target
|
bool
|
Whether to orient robot to face the target |
True
|
check_camera_visibility
|
bool
|
Whether to check fixed camera visibility constraints after placing robot |
False
|
visibility_resolver
|
Optional callable(key: str) -> str for resolving special visibility keys |
None
|
|
excluded_positions
|
list[ndarray] | None
|
List of positions to avoid (e.g. previously used positions) |
None
|
exclusion_threshold
|
float | None
|
Minimum distance from any excluded position |
None
|
save_visibility_frames_dir
|
Path | str | None
|
Optional directory to save camera frames during visibility check |
None
|
Returns: bool: True if placement was successful, False otherwise
Source code in molmo_spaces/env/env.py
761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 | |
render_depth_frame
¶
Renders a depth frame from the perspective of the specified camera.
Returns raw metric depth values in meters as float32 array. Depth encoding to RGB happens at save time for video storage.
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: (H, W) float32 array of depth values in meters |
Source code in molmo_spaces/env/env.py
render_rgb_frame
¶
Renders an RGB frame from the perspective of the specified camera.
Source code in molmo_spaces/env/env.py
render_segmentation_frame
¶
Renders a segmentation frame from the perspective of the specified camera.
Source code in molmo_spaces/env/env.py
reset
¶
Source code in molmo_spaces/env/env.py
segmentation_fraction
¶
Calculate visibility of a body in the segmentation image.
Source code in molmo_spaces/env/env.py
step
¶
Source code in molmo_spaces/env/env.py
mj_extensions
¶
Classes:
| Name | Description |
|---|---|
MjModelBindings |
|
MjModelBindings
¶
Methods:
| Name | Description |
|---|---|
__getattr__ |
|
extract_mj_names |
|
from_xml_path |
|
Attributes:
| Name | Type | Description |
|---|---|---|
actuator_id2name |
dict[int, str]
|
|
actuator_name2id |
dict[str, int]
|
|
actuator_names |
list[str]
|
|
body_id2name |
dict[int, str]
|
|
body_name2id |
dict[str, int]
|
|
body_names |
list[str]
|
|
camera_id2name |
dict[int, str]
|
|
camera_name2id |
dict[str, int]
|
|
camera_names |
list[str]
|
|
equality_id2name |
dict[int, str]
|
|
equality_name2id |
dict[str, int]
|
|
equality_names |
list[str]
|
|
geom_id2name |
dict[int, str]
|
|
geom_name2id |
dict[str, int]
|
|
geom_names |
list[str]
|
|
id |
int
|
|
joint_id2name |
dict[int, str]
|
|
joint_name2id |
dict[str, int]
|
|
joint_names |
list[str]
|
|
light_id2name |
dict[int, str]
|
|
light_name2id |
dict[str, int]
|
|
light_names |
list[str]
|
|
mesh_id2name |
dict[int, str]
|
|
mesh_name2id |
dict[str, int]
|
|
mesh_names |
list[str]
|
|
model |
MjModel
|
|
sensor_id2name |
dict[int, str]
|
|
sensor_name2id |
dict[str, int]
|
|
sensor_names |
list[str]
|
|
site_id2name |
dict[int, str]
|
|
site_name2id |
dict[str, int]
|
|
site_names |
list[str]
|
|
tendon_id2name |
dict[int, str]
|
|
tendon_name2id |
dict[str, int]
|
|
tendon_names |
list[str]
|
|
xml |
Element
|
|
xml_path |
|
Source code in molmo_spaces/env/mj_extensions.py
__getattr__
¶
Source code in molmo_spaces/env/mj_extensions.py
extract_mj_names
¶
from_xml_path
classmethod
¶
from_xml_path(model: MjModel, filename: str) -> MjModelBindings
object_manager
¶
Classes:
| Name | Description |
|---|---|
Context |
|
ObjectManager |
|
Attributes:
| Name | Type | Description |
|---|---|---|
ObjectOrNameOrIdType |
|
|
log |
|
Context
¶
ObjectManager
¶
ObjectManager(env: BaseMujocoEnv, batch_idx: int, caching_enabled: bool = True, name_caching_enabled: bool = True)
Methods:
| Name | Description |
|---|---|
ancestors |
|
approximate_supporting_geoms |
|
category_from_name |
|
children_lists |
|
clear |
|
compute_placement_region |
|
default_object_context_synsets |
|
descendants |
|
expression_probs |
Compute probabilities for each expression in the priority list. |
fallback_expression |
|
find_door_names |
Find all valid door body names in the scene. |
get_annotation_category |
|
get_annotation_synset |
|
get_body_to_geoms |
|
get_cache_key |
|
get_collision_obj_files |
Return collision mesh file paths and the world pose of the body holding them. |
get_context_objects |
|
get_context_synsets |
|
get_direct_children_names |
|
get_door_bboxes_array |
Get door collision geometry bounding boxes as an array. |
get_free_objects |
Return list of all bodies with free joints |
get_geom_infos |
|
get_mobile_objects |
Return of list of all task relevant bodies i.e. not robots/policy objects |
get_natural_object_names |
|
get_object |
|
get_object_body_id |
|
get_object_by_name |
Return the top-level object with the specified name, or None if not found. |
get_object_hypernyms |
|
get_object_name |
|
get_objects_of_type |
Return top-level scene objects for which at least one valid identifier matches any in object_types. |
get_objects_that_are_on_top_of_object |
|
get_parent_chain_names |
|
get_pickup_candidates |
Return top-level candidate small objects for pickup. |
get_possible_object_types |
|
get_receptacles |
Return top-level receptacle objects (tables, counters, etc.) |
get_support_below |
Return the name of the support surface below (receptacle or room floor). |
has_free_joint |
|
has_receptacle_site |
|
has_some_valid_identifier |
If empty valid_identifiers, equivalent to accept any. |
infer_room_name |
|
invalidate_all_caches |
|
invalidate_data_cache |
|
invalidate_model_cache |
|
is_excluded |
|
is_object_articulable |
If it has at least one hinge or slide joint, return True |
is_pickup_candidate |
If pickup_types is None, match None |
is_receptacle |
If receptacle_types is None, match None |
is_structural |
|
list_top_level_objects |
List all non-structural top-level objects as Object instances. |
most_concrete_synset |
|
object_bottom_z |
|
object_metadata |
|
object_summary_str |
|
objects_on_bench |
|
objects_on_receptacle |
|
prefilter_with_clip |
|
referral_expression_priority |
Return prioritized referral expressions, each presented as a tuple with: |
sample_expression |
Sample a candidate expression using a softmax distribution over priority scores. |
summarize_top_level_bodies |
|
thresholded_expression_priority |
Thresholding to filter out ambiguous expressions. |
top_level_bodies |
Return bodies whose parent is the world body. |
uid_to_annotation_for_type |
Return list of uids in entire object library with object_type among the possible types |
Attributes:
| Name | Type | Description |
|---|---|---|
STRUCTURAL_TYPES |
|
|
data |
|
|
model |
MjModel
|
|
model_path |
Path
|
|
scene_metadata |
dict | None
|
|
Source code in molmo_spaces/env/object_manager.py
STRUCTURAL_TYPES
class-attribute
instance-attribute
¶
ancestors
¶
ancestors(object_or_name_or_id: ObjectOrNameOrIdType)
Source code in molmo_spaces/env/object_manager.py
approximate_supporting_geoms
¶
approximate_supporting_geoms(object_or_name_or_id: ObjectOrNameOrIdType, body_to_geoms: dict[int, list[int]])
Source code in molmo_spaces/env/object_manager.py
category_from_name
¶
category_from_name(object_or_name_or_id: ObjectOrNameOrIdType)
Source code in molmo_spaces/env/object_manager.py
children_lists
¶
Source code in molmo_spaces/env/object_manager.py
clear
¶
compute_placement_region
¶
compute_placement_region(object_or_name_or_id: ObjectOrNameOrIdType, margin_xy: float = 0.05) -> dict[str, ndarray]
Source code in molmo_spaces/env/object_manager.py
default_object_context_synsets
¶
default_object_context_synsets(target: ObjectOrNameOrIdType) -> set[str]
Source code in molmo_spaces/env/object_manager.py
descendants
¶
descendants(object_or_name_or_id: ObjectOrNameOrIdType)
Source code in molmo_spaces/env/object_manager.py
expression_probs
staticmethod
¶
Compute probabilities for each expression in the priority list.
Parameters¶
priority : list[tuple[float, float, str]]
A list of tuples (sim_margin, target_similarity, value):
- sim_margin (float): A priority score (typically in [-1, 1]) used as the
primary softmax logit.
- target_similarity (float): A secondary score indicating similarity to a
target representation.
- value (str): The actual expression or token to be sampled.
temperature : float, optional
Softmax temperature. Lower values (< 0.1) make sampling more deterministic by
amplifying score differences; higher values increase exploration.
Returns¶
np.ndarray A probability distribution over the expressions in the priority list.
Source code in molmo_spaces/env/object_manager.py
fallback_expression
¶
Source code in molmo_spaces/env/object_manager.py
find_door_names
¶
Find all valid door body names in the scene.
Valid doors are identified by the naming convention and whether they have joints.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of door body names found in the scene. |
Source code in molmo_spaces/env/object_manager.py
get_annotation_category
¶
get_annotation_category(object_or_name_or_id: ObjectOrNameOrIdType) -> str
Source code in molmo_spaces/env/object_manager.py
get_annotation_synset
¶
get_annotation_synset(object_or_name_or_id: ObjectOrNameOrIdType) -> str | None
Source code in molmo_spaces/env/object_manager.py
get_body_to_geoms
¶
Source code in molmo_spaces/env/object_manager.py
get_cache_key
¶
get_cache_key(object_or_name_or_id: ObjectOrNameOrIdType, context_synsets: Collection[str] = None)
Source code in molmo_spaces/env/object_manager.py
get_collision_obj_files
¶
get_collision_obj_files(object_or_name_or_id: ObjectOrNameOrIdType, xml_path: Path | None = None) -> tuple[list[Path], ndarray]
Return collision mesh file paths and the world pose of the body holding them.
Parses an XML file to find all descendant collision geoms of the object's body, resolves their mesh references to file paths, and returns the list of absolute .obj file paths together with the 4x4 world pose of the child body that contains the geoms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
object_or_name_or_id
|
ObjectOrNameOrIdType
|
The object to look up. |
required |
xml_path
|
Path | None
|
Optional XML file to parse instead of the scene model path. Useful for dynamically added objects whose meshes are defined in a standalone XML rather than the scene XML. |
None
|
Returns:
| Type | Description |
|---|---|
list[Path]
|
A tuple of (obj_files, pose_4x4) where obj_files is a list of |
ndarray
|
absolute .obj file paths and pose_4x4 is the 4x4 world pose of |
tuple[list[Path], ndarray]
|
the child body holding the collision geoms. |
Source code in molmo_spaces/env/object_manager.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
get_context_objects
¶
get_context_objects(object_or_name_or_id: ObjectOrNameOrIdType, context_type: Context = BENCH, bench_geom_ids: list[int] = None, cameras: list[str] = None, room_ids: list[str] = None, disable_caching: bool = True, **kwargs) -> list[MlSpacesObject]
Source code in molmo_spaces/env/object_manager.py
get_context_synsets
¶
get_context_synsets(context_objects: Collection[ObjectOrNameOrIdType]) -> list[str]
Source code in molmo_spaces/env/object_manager.py
get_direct_children_names
¶
get_direct_children_names(object_or_name_or_id: ObjectOrNameOrIdType) -> list[str]
Source code in molmo_spaces/env/object_manager.py
get_door_bboxes_array
¶
get_door_bboxes_array(object_or_name_or_id: ObjectOrNameOrIdType) -> ndarray
Get door collision geometry bounding boxes as an array. Returns: np.ndarray: Array of AABBs (center, size) for door collision geoms
Source code in molmo_spaces/env/object_manager.py
get_free_objects
¶
get_free_objects() -> list[MlSpacesObject]
Return list of all bodies with free joints
Source code in molmo_spaces/env/object_manager.py
get_geom_infos
¶
get_geom_infos(object_or_name_or_id: ObjectOrNameOrIdType, include_descendants: bool = True, max_geoms: int | None = 2048) -> list[dict[str, object]]
Source code in molmo_spaces/env/object_manager.py
get_mobile_objects
¶
get_mobile_objects() -> list[MlSpacesObject]
Return of list of all task relevant bodies i.e. not robots/policy objects
Source code in molmo_spaces/env/object_manager.py
get_natural_object_names
¶
get_natural_object_names(object_or_name_or_id: ObjectOrNameOrIdType, context_synsets: list[str] = None)
Source code in molmo_spaces/env/object_manager.py
get_object
¶
get_object(object_or_name_or_id: ObjectOrNameOrIdType) -> MlSpacesObject
Source code in molmo_spaces/env/object_manager.py
get_object_body_id
¶
get_object_body_id(object_or_name_or_id: ObjectOrNameOrIdType) -> int
Source code in molmo_spaces/env/object_manager.py
get_object_by_name
¶
get_object_by_name(object_name: str) -> MlSpacesObject | None
Return the top-level object with the specified name, or None if not found.
Source code in molmo_spaces/env/object_manager.py
get_object_hypernyms
¶
get_object_hypernyms(target: ObjectOrNameOrIdType, context_synsets: Collection[str]) -> list[str]
get_object_name
¶
get_object_name(object_or_name_or_id: ObjectOrNameOrIdType) -> str
Source code in molmo_spaces/env/object_manager.py
get_objects_of_type
¶
get_objects_of_type(object_types: Collection[str]) -> list[MlSpacesObject]
Return top-level scene objects for which at least one valid identifier matches any in object_types. If pickup is True, objects need to have a free joint to be returned. Returns MlSpacesObject instances (not MujocoBody) built from top-level bodies. If empty list, return any, if None, accept None
Source code in molmo_spaces/env/object_manager.py
get_objects_that_are_on_top_of_object
¶
get_objects_that_are_on_top_of_object(object_or_name_or_id: ObjectOrNameOrIdType, pickup_types: Collection[str], z_above_min: float = 0.02, z_above_max: float = 0.6, constrain_to_pickupable: bool = True) -> list[MlSpacesObject]
Source code in molmo_spaces/env/object_manager.py
get_parent_chain_names
¶
get_parent_chain_names(object_or_name_or_id: ObjectOrNameOrIdType) -> list[str]
Source code in molmo_spaces/env/object_manager.py
get_pickup_candidates
¶
get_pickup_candidates() -> list[MlSpacesObject]
Return top-level candidate small objects for pickup.
get_possible_object_types
¶
get_possible_object_types(object_or_name_or_id: ObjectOrNameOrIdType) -> list[str]
Source code in molmo_spaces/env/object_manager.py
get_receptacles
¶
get_receptacles() -> list[MlSpacesObject]
Return top-level receptacle objects (tables, counters, etc.)
get_support_below
¶
get_support_below(object_or_name_or_id: ObjectOrNameOrIdType, receptacle_types: Collection[str], z_clearance_eps: float = 0.1) -> str | None
Return the name of the support surface below (receptacle or room floor).
Source code in molmo_spaces/env/object_manager.py
has_free_joint
¶
has_free_joint(object_or_name_or_id: ObjectOrNameOrIdType) -> bool
Source code in molmo_spaces/env/object_manager.py
has_receptacle_site
¶
has_receptacle_site(object_or_name_or_id: ObjectOrNameOrIdType) -> bool
has_some_valid_identifier
¶
has_some_valid_identifier(object_or_name_or_id: ObjectOrNameOrIdType, valid_identifiers: Collection[str])
If empty valid_identifiers, equivalent to accept any. If None, equivalent to accept none
Source code in molmo_spaces/env/object_manager.py
infer_room_name
¶
infer_room_name(object_or_name_or_id: ObjectOrNameOrIdType, receptacle_types: Collection[str]) -> str | None
Source code in molmo_spaces/env/object_manager.py
invalidate_all_caches
¶
Source code in molmo_spaces/env/object_manager.py
invalidate_data_cache
¶
invalidate_model_cache
¶
is_excluded
¶
is_excluded(object_or_name_or_id: ObjectOrNameOrIdType) -> bool
Source code in molmo_spaces/env/object_manager.py
is_object_articulable
¶
If it has at least one hinge or slide joint, return True else return False
Source code in molmo_spaces/env/object_manager.py
is_pickup_candidate
¶
is_pickup_candidate(object_or_name_or_id: ObjectOrNameOrIdType, pickup_types: Collection[str]) -> bool
If pickup_types is None, match None If empty list, match any with free joint
Source code in molmo_spaces/env/object_manager.py
is_receptacle
¶
is_receptacle(object_or_name_or_id: ObjectOrNameOrIdType, receptacle_types: Collection[str]) -> bool
If receptacle_types is None, match None If empty list, match any with receptacle site
Source code in molmo_spaces/env/object_manager.py
is_structural
¶
is_structural(object_or_name_or_id: ObjectOrNameOrIdType) -> bool
Source code in molmo_spaces/env/object_manager.py
list_top_level_objects
¶
list_top_level_objects() -> list[MlSpacesObject]
List all non-structural top-level objects as Object instances.
Source code in molmo_spaces/env/object_manager.py
most_concrete_synset
staticmethod
¶
Source code in molmo_spaces/env/object_manager.py
object_bottom_z
¶
object_bottom_z(object_or_name_or_id: ObjectOrNameOrIdType) -> float
Source code in molmo_spaces/env/object_manager.py
object_metadata
¶
object_metadata(object_or_name_or_id: ObjectOrNameOrIdType) -> dict
object_summary_str
¶
object_summary_str(object_or_name_or_id: ObjectOrNameOrIdType, receptacle_types: Collection[str]) -> str
Source code in molmo_spaces/env/object_manager.py
objects_on_bench
¶
objects_on_bench(bench_geom_ids: list[int], angle_threshold: float = radians(30), fallback_thres=0.01, attempt_contact: bool = True) -> list[MlSpacesObject]
Source code in molmo_spaces/env/object_manager.py
objects_on_receptacle
¶
objects_on_receptacle(objs_to_check: list[MlSpacesObject], bench_geom_ids: list[int], angle_threshold: float = radians(30), fallback_thres=0.01, attempt_contact: bool = True) -> list[MlSpacesObject]
Source code in molmo_spaces/env/object_manager.py
1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 | |
prefilter_with_clip
staticmethod
¶
prefilter_with_clip(target_type: str | list[str], uids: list[str], min_sim: float = 0.25) -> list[str]
Source code in molmo_spaces/env/object_manager.py
referral_expression_priority
¶
referral_expression_priority(object_or_name_or_id: ObjectOrNameOrIdType, context_object_or_name_or_ids: Collection[ObjectOrNameOrIdType]) -> list[tuple[float, float, str]]
Return prioritized referral expressions, each presented as a tuple with: - similarity score margin versus highest-scoring distractor in context - similarity score for target object - referral expression Priority is based on margin, similarity to target, expression length,
Source code in molmo_spaces/env/object_manager.py
1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 | |
sample_expression
staticmethod
¶
Sample a candidate expression using a softmax distribution over priority scores.
Parameters¶
priority : list[tuple[float, float, str]]
A list of tuples (sim_margin, target_similarity, value):
- sim_margin (float): A priority score (typically in [-1, 1]) used as the
primary softmax logit.
- target_similarity (float): A secondary score indicating similarity to a
target representation.
- value (str): The actual expression or token to be sampled.
temperature : float, optional
Softmax temperature. Lower values (< 0.1) make sampling more deterministic by
amplifying score differences; higher values increase exploration.
Default is 2e-2, producing a sharp distribution.
Returns¶
str The sampled expression/value from the given list.
Notes¶
The final sampling is categorical: p(i) = softmax(sim_margin_i / temperature).
Source code in molmo_spaces/env/object_manager.py
summarize_top_level_bodies
¶
Source code in molmo_spaces/env/object_manager.py
thresholded_expression_priority
staticmethod
¶
thresholded_expression_priority(priority: list[tuple[float, float, str]], sim_margin_threshold: float = 0.03, target_sim_threshold: float = 0.1) -> list[tuple[float, float, str]]
Thresholding to filter out ambiguous expressions.
Parameters¶
priority : list[tuple[float, float, str]]
A list of tuples (sim_margin, target_similarity, value):
- sim_margin (float): A priority score (typically in [-1, 1]) used as the
primary softmax logit.
- target_similarity (float): A secondary score indicating similarity to a
target representation.
- value (str): The actual expression or token to be sampled.
sim_margin_threshold : float, optional
Minimum allowed sim_margin for an item to be considered when thresholding.
target_sim_threshold : float, optional
Minimum required target_similarity for thresholding.
Returns¶
list[tuple[float, float, str]] (filtered prioritization) The sampled expression/value from the filtered list.
Source code in molmo_spaces/env/object_manager.py
top_level_bodies
¶
Return bodies whose parent is the world body.
Source code in molmo_spaces/env/object_manager.py
uid_to_annotation_for_type
staticmethod
¶
Return list of uids in entire object library with object_type among the possible types
Note: for now, we are reusing the functionality based on use of scene metadata in this class. We also don't cache results, so best keep them cached in your caller
Source code in molmo_spaces/env/object_manager.py
rby1_sensors
¶
Classes:
| Name | Description |
|---|---|
RBY1GraspPoseSensor |
Sensor for RBY1 grasp pose in 7D format (can be current TCP or planned grasp pose). |
RBY1GraspStateSensor |
|
RBY1RobotStateSensor |
Sensor for RBY1 robot joint positions, velocities, and dual end-effector poses. |
RBY1TCPPoseSensor |
Sensor for RBY1 TCP (Tool Center Point) poses in 7D format for both arms. |
Functions:
| Name | Description |
|---|---|
get_rby1_door_opening_sensors |
Get core sensors for RBY1 door opening data generation. |
RBY1GraspPoseSensor
¶
Bases: Sensor
Sensor for RBY1 grasp pose in 7D format (can be current TCP or planned grasp pose).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uuid
|
str
|
Unique identifier for this sensor |
'rby1_grasp_pose'
|
arm_side
|
str
|
Which arm to track ("left" or "right") |
'left'
|
Methods:
| Name | Description |
|---|---|
get_observation |
Get grasp pose (using current TCP pose as proxy) for the specified arm. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
arm_side |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/rby1_sensors.py
get_observation
¶
Get grasp pose (using current TCP pose as proxy) for the specified arm.
Source code in molmo_spaces/env/rby1_sensors.py
RBY1GraspStateSensor
¶
Bases: Sensor
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
arm_side |
|
|
finger1_name |
|
|
finger2_name |
|
|
is_dict |
bool
|
|
obj_name |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/rby1_sensors.py
get_observation
¶
Source code in molmo_spaces/env/rby1_sensors.py
RBY1RobotStateSensor
¶
Bases: Sensor
Sensor for RBY1 robot joint positions, velocities, and dual end-effector poses.
Methods:
| Name | Description |
|---|---|
get_observation |
Get RBY1 robot state observation for a specific environment in the batch. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/rby1_sensors.py
get_observation
¶
Get RBY1 robot state observation for a specific environment in the batch.
Source code in molmo_spaces/env/rby1_sensors.py
RBY1TCPPoseSensor
¶
Bases: Sensor
Sensor for RBY1 TCP (Tool Center Point) poses in 7D format for both arms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
uuid
|
str
|
Unique identifier for this sensor |
'rby1_tcp_pose'
|
arm_side
|
str
|
Which arm to track ("left" or "right") |
'left'
|
Methods:
| Name | Description |
|---|---|
get_observation |
Get TCP pose in world coordinates for the specified arm. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
arm_side |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/rby1_sensors.py
get_observation
¶
Get TCP pose in world coordinates for the specified arm.
Source code in molmo_spaces/env/rby1_sensors.py
get_rby1_door_opening_sensors
¶
Get core sensors for RBY1 door opening data generation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exp_config
|
Experiment configuration object with sensor parameters |
required |
Returns: List of initialized sensors
Source code in molmo_spaces/env/rby1_sensors.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 | |
sensors
¶
Classes:
| Name | Description |
|---|---|
ActorStateSensor |
Sensor for actor (object) states in numerical format. |
ArticulationStateSensor |
Sensor for articulation (robot) state in numerical format. |
DoorStateSensor |
Sensor for door state including joint angle and opening percentage. |
EnvStateSensor |
Sensor for complete MuJoCo environment state. |
GraspPoseSensor |
Sensor for the planned grasp pose in 7D format. |
GraspStateSensor |
Sensor for grasp state. For each gripper, track whether it is touching (and possibly holding) the object. |
LastActionSensor |
Sensor for robot actions (absolute values only). |
LastCommandedEEPoseSensor |
|
LastCommandedEETwistSensor |
|
LastCommandedJointPosSensor |
|
LastCommandedRelativeJointPosSensor |
|
ObjectEndPoseSensor |
Sensor for target/end object pose in 7D format (x, y, z, qw, qx, qy, qz). |
ObjectImagePointsSensor |
Sensor for tracking object pixel coordinates across multiple cameras. |
ObjectPoseSensor |
Sensor for object poses relative to robot base. |
ObjectStartPoseSensor |
Sensor for initial object pose in 7D format (x, y, z, qw, qx, qy, qz). |
PolicyNumRetriesSensor |
Sensor for tracking the number of retries of the object manipulation policy. |
PolicyPhaseSensor |
Sensor for tracking the current phase of a planner policy. |
RobotBasePoseSensor |
Sensor for robot base pose in 7D format. |
RobotJointPositionSensor |
Sensor for robot joint positions as numerical array. |
RobotJointVelocitySensor |
Sensor for robot joint velocities as numerical array. |
RobotStateSensor |
Sensor for robot joint positions, velocities, and end-effector pose. |
TCPPoseSensor |
Sensor for TCP (Tool Center Point / End Effector) pose in 7D format. |
TaskInfoSensor |
Sensor for task information. |
Functions:
| Name | Description |
|---|---|
get_core_sensors |
Get core sensors for Franka pick-place data generation. |
get_nav_task_sensors |
Get sensors for navigation to object task. |
Attributes:
| Name | Type | Description |
|---|---|---|
log |
|
ActorStateSensor
¶
Bases: Sensor
Sensor for actor (object) states in numerical format.
Methods:
| Name | Description |
|---|---|
get_observation |
Get actor states as numerical array. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
actor_names |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get actor states as numerical array.
Source code in molmo_spaces/env/sensors.py
ArticulationStateSensor
¶
Bases: Sensor
Sensor for articulation (robot) state in numerical format.
Methods:
| Name | Description |
|---|---|
get_observation |
Get articulation state as numerical array. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
state_dim |
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get articulation state as numerical array.
Source code in molmo_spaces/env/sensors.py
DoorStateSensor
¶
Bases: Sensor
Sensor for door state including joint angle and opening percentage.
Methods:
| Name | Description |
|---|---|
get_observation |
Get door state as encoded JSON. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get door state as encoded JSON.
Source code in molmo_spaces/env/sensors.py
714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 | |
EnvStateSensor
¶
Bases: Sensor
Sensor for complete MuJoCo environment state.
Methods:
| Name | Description |
|---|---|
get_observation |
Get complete environment state from MuJoCo. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get complete environment state from MuJoCo.
Source code in molmo_spaces/env/sensors.py
GraspPoseSensor
¶
Bases: Sensor
Sensor for the planned grasp pose in 7D format.
Methods:
| Name | Description |
|---|---|
get_observation |
Get grasp pose (using current TCP pose as proxy). |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get grasp pose (using current TCP pose as proxy).
Source code in molmo_spaces/env/sensors.py
GraspStateSensor
¶
Bases: Sensor
Sensor for grasp state. For each gripper, track whether it is touching (and possibly holding) the object. The held state is calculated with a heuristic, and only tracks whether the object is only touching the gripper, not whether the object is actually stably supported by the gripper. More sophisticated heuristics may be added in the future.
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
|
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
object_name |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env: BaseMujocoEnv, task: BaseMujocoTask, batch_index: int = 0, *args, **kwargs) -> dict
Source code in molmo_spaces/env/sensors.py
LastActionSensor
¶
LastActionSensor(dtype: str = 'float32', uuid: str = 'actions/commanded_action', str_max_len: int = 2000)
Bases: Sensor
Sensor for robot actions (absolute values only).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dtype
|
str
|
Target dtype for all action components |
'float32'
|
uuid
|
str
|
Sensor UUID |
'actions/commanded_action'
|
Methods:
| Name | Description |
|---|---|
get_observation |
Get action dictionary with absolute values. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
dtype |
|
|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get action dictionary with absolute values.
Source code in molmo_spaces/env/sensors.py
LastCommandedEEPoseSensor
¶
Bases: Sensor
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env: BaseMujocoEnv, task: BaseMujocoTask, batch_index: int = 0, *args, **kwargs)
Source code in molmo_spaces/env/sensors.py
LastCommandedEETwistSensor
¶
Bases: Sensor
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
|
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env: BaseMujocoEnv, task: BaseMujocoTask, batch_index: int = 0, *args, **kwargs)
Source code in molmo_spaces/env/sensors.py
LastCommandedJointPosSensor
¶
Bases: Sensor
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env: BaseMujocoEnv, task: BaseMujocoTask, batch_index: int = 0, *args, **kwargs)
Source code in molmo_spaces/env/sensors.py
LastCommandedRelativeJointPosSensor
¶
Bases: Sensor
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
|
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env: BaseMujocoEnv, task: BaseMujocoTask, batch_index: int = 0, *args, **kwargs)
Source code in molmo_spaces/env/sensors.py
ObjectEndPoseSensor
¶
Bases: Sensor
Sensor for target/end object pose in 7D format (x, y, z, qw, qx, qy, qz).
Methods:
| Name | Description |
|---|---|
get_observation |
Get target object pose. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
object_name |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get target object pose.
Source code in molmo_spaces/env/sensors.py
ObjectImagePointsSensor
¶
ObjectImagePointsSensor(exp_config, camera_names: list[str] | None = None, uuid: str = 'object_image_points', max_points: int = 10, erosion_iterations: int = 2, exclude_follower_cameras: bool = True)
Bases: Sensor
Sensor for tracking object pixel coordinates across multiple cameras.
Detects task objects in camera views and returns sampled pixel coordinates normalized to 0-1 range. Returns HDF5-native numpy arrays (not JSON).
Output structure (nested dict of numpy arrays):
{
"
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exp_config
|
Experiment configuration with camera_config |
required | |
camera_names
|
list[str] | None
|
Optional list of camera names to track. If None, uses all cameras from config. |
None
|
uuid
|
str
|
Unique sensor identifier |
'object_image_points'
|
max_points
|
int
|
Maximum number of points to sample per camera |
10
|
erosion_iterations
|
int
|
Number of erosion iterations for segmentation mask |
2
|
exclude_follower_cameras
|
bool
|
If True, exclude cameras with 'follower' in their name |
True
|
Methods:
| Name | Description |
|---|---|
get_observation |
Get pixel coordinates of task objects in each camera view. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
camera_names |
|
|
camera_specs |
|
|
erosion_iterations |
|
|
is_dict |
|
|
max_points |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env, task, batch_index: int = 0, *args, **kwargs) -> dict[str, dict[str, dict[str, ndarray]]]
Get pixel coordinates of task objects in each camera view.
All points are normalized to 0-1 range based on image resolution. Returns HDF5-native numpy arrays (not JSON strings).
Returns:
| Type | Description |
|---|---|
dict[str, dict[str, dict[str, ndarray]]]
|
Dictionary with structure: |
dict[str, dict[str, dict[str, ndarray]]]
|
{
" |
dict[str, dict[str, dict[str, ndarray]]]
|
} |
dict[str, dict[str, dict[str, ndarray]]]
|
Where object_key is determined by task.get_task_objects() (e.g., 'pickup_obj', |
dict[str, dict[str, dict[str, ndarray]]]
|
'place_receptacle', 'door_handle'). |
Source code in molmo_spaces/env/sensors.py
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | |
ObjectPoseSensor
¶
Bases: Sensor
Sensor for object poses relative to robot base.
Methods:
| Name | Description |
|---|---|
get_observation |
Get object poses relative to robot base for a specific environment. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
object_names |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get object poses relative to robot base for a specific environment.
Source code in molmo_spaces/env/sensors.py
ObjectStartPoseSensor
¶
Bases: Sensor
Sensor for initial object pose in 7D format (x, y, z, qw, qx, qy, qz).
Methods:
| Name | Description |
|---|---|
get_observation |
Get initial object pose. |
reset |
Reset stored initial pose. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
object_name |
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get initial object pose.
Source code in molmo_spaces/env/sensors.py
PolicyNumRetriesSensor
¶
Bases: Sensor
Sensor for tracking the number of retries of the object manipulation policy.
Methods:
| Name | Description |
|---|---|
get_observation |
Return the number of retries of the object manipulation policy. |
reset |
|
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Return the number of retries of the object manipulation policy.
Source code in molmo_spaces/env/sensors.py
PolicyPhaseSensor
¶
Bases: Sensor
Sensor for tracking the current phase of a planner policy.
Methods:
| Name | Description |
|---|---|
get_observation |
Return the current phase of the policy as a string encoded as uint8 array. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Return the current phase of the policy as a string encoded as uint8 array.
Source code in molmo_spaces/env/sensors.py
RobotBasePoseSensor
¶
Bases: Sensor
Sensor for robot base pose in 7D format.
Methods:
| Name | Description |
|---|---|
get_observation |
Get robot base pose. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get robot base pose.
Source code in molmo_spaces/env/sensors.py
RobotJointPositionSensor
¶
Bases: Sensor
Sensor for robot joint positions as numerical array.
Methods:
| Name | Description |
|---|---|
get_observation |
Get robot joint positions as numerical array. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
max_joints |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get robot joint positions as numerical array.
Source code in molmo_spaces/env/sensors.py
RobotJointVelocitySensor
¶
Bases: Sensor
Sensor for robot joint velocities as numerical array.
Methods:
| Name | Description |
|---|---|
get_observation |
Get robot joint velocities as numerical array. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
max_joints |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get robot joint velocities as numerical array.
Source code in molmo_spaces/env/sensors.py
RobotStateSensor
¶
Bases: Sensor
Sensor for robot joint positions, velocities, and end-effector pose.
Methods:
| Name | Description |
|---|---|
get_observation |
Get robot state observation for a specific environment in the batch. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get robot state observation for a specific environment in the batch.
Source code in molmo_spaces/env/sensors.py
TCPPoseSensor
¶
Bases: Sensor
Sensor for TCP (Tool Center Point / End Effector) pose in 7D format.
Methods:
| Name | Description |
|---|---|
get_observation |
Get TCP pose in robot frame. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
Get TCP pose in robot frame.
Source code in molmo_spaces/env/sensors.py
TaskInfoSensor
¶
Bases: Sensor
Sensor for task information.
Methods:
| Name | Description |
|---|---|
get_observation |
|
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
is_dict |
|
|
observation_space |
Space
|
|
str_max_len |
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors.py
get_observation
¶
get_observation(env: BaseMujocoEnv, task: BaseMujocoTask, batch_index: int = 0, *args, **kwargs) -> dict
get_core_sensors
¶
Get core sensors for Franka pick-place data generation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exp_config
|
Experiment configuration object with sensor parameters |
required |
Returns:
| Type | Description |
|---|---|
|
List of initialized sensors |
Source code in molmo_spaces/env/sensors.py
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 | |
get_nav_task_sensors
¶
Get sensors for navigation to object task.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exp_config
|
Experiment configuration object with sensor parameters |
required |
Returns:
| Type | Description |
|---|---|
|
List of initialized sensors |
Source code in molmo_spaces/env/sensors.py
sensors_cameras
¶
Classes:
| Name | Description |
|---|---|
CameraParameterSensor |
Sensor for camera parameters (intrinsics and extrinsics). |
CameraSensor |
Sensor for RGB camera images from MuJoCo. |
DepthSensor |
Sensor for depth images from MuJoCo. |
SegmentationSensor |
Sensor for segmentation images from MuJoCo, outputs video-compatible arrays. |
CameraParameterSensor
¶
CameraParameterSensor(camera_name: str = 'camera', uuid: str | None = None, img_resolution: tuple[int, int] = (480, 480))
Bases: Sensor
Sensor for camera parameters (intrinsics and extrinsics).
Methods:
| Name | Description |
|---|---|
get_observation |
Get camera parameters for a specific environment. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
camera_name |
|
|
img_resolution |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors_cameras.py
get_observation
¶
Get camera parameters for a specific environment.
Source code in molmo_spaces/env/sensors_cameras.py
CameraSensor
¶
CameraSensor(camera_name: str = 'camera', img_resolution: tuple[int, int] = (480, 480), uuid: str | None = None)
Bases: Sensor
Sensor for RGB camera images from MuJoCo.
Methods:
| Name | Description |
|---|---|
get_observation |
Get camera image from environment rendering. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
camera_name |
|
|
img_resolution |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors_cameras.py
get_observation
¶
Get camera image from environment rendering.
Source code in molmo_spaces/env/sensors_cameras.py
DepthSensor
¶
DepthSensor(camera_name: str = 'camera', img_resolution: tuple[int, int] = (480, 480), uuid: str | None = None)
Bases: Sensor
Sensor for depth images from MuJoCo.
Returns raw metric depth in meters as float32. Encoding to RGB for video storage happens at save time. See molmo_spaces.utils.depth_utils for encoding/decoding functions.
Methods:
| Name | Description |
|---|---|
get_observation |
Get depth image from environment rendering. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
camera_name |
|
|
img_resolution |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors_cameras.py
get_observation
¶
Get depth image from environment rendering.
Source code in molmo_spaces/env/sensors_cameras.py
SegmentationSensor
¶
SegmentationSensor(camera_name: str = 'camera', img_resolution: tuple[int, int] = (480, 480), uuid: str | None = None)
Bases: Sensor
Sensor for segmentation images from MuJoCo, outputs video-compatible arrays.
Methods:
| Name | Description |
|---|---|
get_observation |
Get segmentation image from environment rendering. |
reset |
Reset the sensor to its initial state. |
Attributes:
| Name | Type | Description |
|---|---|---|
camera_name |
|
|
img_resolution |
|
|
is_dict |
bool
|
|
observation_space |
Space
|
|
str_max_len |
int
|
|
uuid |
str
|
|
Source code in molmo_spaces/env/sensors_cameras.py
get_observation
¶
Get segmentation image from environment rendering.