rlightning.humanoid.loader.mjcf_loader

rlightning.humanoid.loader.mjcf_loader.load_mjcf(mjcf_path: str, num_dof: int, device: str = 'cpu') Dict[str, Any][source]

Load a MJCF file and return the corresponding Mujoco model.

Parameters:
  • mjcf_path (str) – Path to the MJCF file.

  • num_dof (int) – Expected number of DoF joints in the MJCF.

  • device (str) – Target device for returned tensors.

Returns:

A dict of the following keys

  • node_names: List of node names in the model.

  • parent_indices: Tensor of parent indices for each node.

  • local_translation: Tensor of local translations for each node.

  • local_rotation: Tensor of local rotations for each node.

  • joints_range: Tensor of joint ranges.

  • body_to_joint: A dictionary mapping body names to joint names.