Mojo model
mojo_model
¶
UserData
¶
MojoModel
¶
Bases: MojoBaseModel, StochasBase
Mojo is the highest level watcher which manages model definitions.
mjcf
class-attribute
instance-attribute
¶
mjcf: Mujoco = Field(default_factory=Mujoco)
MuJoCo MJCF model to be written to XML.
user_data
class-attribute
instance-attribute
¶
user_data: SerializeAsAny[UserData] | None = None
User defined data for the model. This is used for transferring information from one function to another (generator to runtime or objective function).
trial_dir
property
¶
trial_dir: Path
Absolute path to this trial's workspace directory.
Set automatically after the generator runs. Available in runtime and objective functions. Raises RuntimeError if accessed inside the generator, where the directory has not yet been created.
get_user_data
¶
get_user_data(cls: type[T]) -> T
Returns the user_data re-validated into the requested class.
Source code in src/mujoco_mojo/mojo_model.py
clear_unpickleable_data
¶
Clear unpickleable objects from the model tree before serialization.
This walks through all geoms in the MJCF tree and clears cached collision managers and proximity queries that contain Cython objects which cannot be pickled for multiprocessing.