src.utils package

Submodules

src.utils.file_converters module

src.utils.file_converters.mj_xml_to_mjcf(xml_path, mjcf_path, overwrite=False)[source]

Convert a Mujoco XML file to a Mujoco MJCF file.

Parameters:
  • xml_path (str) – Path to the XML file.

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

  • overwrite (bool) – Whether to overwrite the output file if it exists.

src.utils.file_converters.urdf_to_mj_xml(urdf_path, xml_path, overwrite=False)[source]

Convert a URDF file to a Mujoco XML file.

Parameters:
  • urdf_path (str) – Path to the URDF file.

  • xml_path (str) – Path to the output XML file.

  • overwrite (bool) – Whether to overwrite the output file if it exists.

src.utils.file_converters.urdf_to_mjcf(urdf_path, mjcf_path, overwrite=False)[source]

Convert a URDF file to a Mujoco MJCF file.

Parameters:
  • urdf_path (str) – Path to the URDF file.

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

  • overwrite (bool) – Whether to overwrite the output file if it exists.

src.utils.multiagent_model_generator module

src.utils.multiagent_model_generator.multiagent_model(n_drones: int, spacing: float = 2.0) MjModel[source]

Load a multi-agent MuJoCo model with a specified number of drones positioned in a 2D grid.

Parameters:
  • n_drones – The number of drones to include in the model.

  • spacing – The spacing between drones in the grid.

Returns:

An instance of MjModel representing the multi-agent scene.

src.utils.multiagent_model_generator.save_multiagent_model(n_drones: int, spacing: float = 2.0, save_dir: str = None) str[source]

Generate individual UAV XML files and a scene file including all UAVs, then save them to a directory.

Parameters:
  • n_drones – The number of drones to include in the scene.

  • spacing – The spacing between drones in the generated grid.

  • save_dir – The directory to save the generated XML files. Defaults to SAVE_DIR.

Returns:

The path to the generated scene file.

src.utils.multiagent_model_generator.test_multiagent_model()[source]

src.utils.simulation_metrics module

src.utils.viewer module

Module contents