scenarioSimpleDocking
It’s recommended to review the following scenario(s) first (and any recommended scenario(s) that they may have):
examples/mujoco/scenarioArmWithThrusters.py
This scripts shows how one can simulate two independent spacecraft
docking and constraining their movement with respect to each other.
This illustrates the use of MuJoCo equality
in MJScene.
The multi-body system is defined in the XML file sats_dock.xml
.
The system defined in this XML file is simple, but it illustrates some
of the tools MuJoCo offers for our simulation needs. First, this shows
how contact physics can be disabled through flag contact="disable"
.
Second, it illustrates how two free-floating bodies can be defined.
Third, it shows how to declare an equality
.
Equalities are a way to add dynamical constraints to a system. In this case, we use a ‘weld’ constraint between two sites, which tells MuJoCo to enforce that the frames associated with the sites are aligned. This prevents any relative movement between them, and thus between the bodies that they are attached to. We use this to simulate the dynamics after docking. MuJoCo will automatically compute the force and torques that are produced at this point to ensure the equality constraint is met.
For more information about constraints, see https://mujoco.readthedocs.io/en/stable
- scenarioSimpleDocking.run(showPlots: bool = False, visualize: bool = False)[source]
Main function, see scenario description.
- Parameters:
showPlots (bool, optional) – If True, simulation results are plotted and show. Defaults to False.
visualize (bool, optional) – If True, the
MJScene
visualization tool is run on the simulation results. Defaults to False.