/excavator_simulator_mujoco

A MuJoCo-based simulator for soil digging using an excavator

Primary LanguageC++GNU General Public License v3.0GPL-3.0

excavator_simulator_mujoco

This repository implements a simulator of a hydraulic excavator including soil digging, transportation, and dumping. The simulator is built on the top of a customized version of MuJoCo, available here. The only modification of this customized version is a better visualization of floating soil.

The soil dynamics is modeled using soil_dyanmics_cpp and a custom soil plugin serves as an interface with MuJoCo. A description of the soil plugin as well as an usage example is provided here. An excavator model is also included that is thoroughly described in the corresponding README.

A customized executable to launch MuJoCo is also provided, as the default executable does not include the update of HField.

Installation

A bash script is provided to make the installation of the simulator easier. To install the simulator, simply execute the following command

bash <path_to_repo>/build.bash

This script would:

  • (if necessary) clone the soil_dyanmics_cpp repository and move it to the appropriate folder.
  • Build the simulator with CMake.
  • Copy the custom plugin library to the appropriate folder.
  • Copy the custom executable to the appropriate folder.

Running the simulator

To run the simulator, simply execute the following command

.<path_to_repo>/build/bin/excavator_simulator <path_to_repo>/model/excavator/excavator.xml

A window will open with the hydraulic excavator. It is suggested to toggle on the "Wireframe" view in the "Rendering" section in order to better visualize the soil. The hydraulic excavator can be actuated using the four sliders in the "Control" section.

To change the initial pose of the excavator or the simulation properties (grid and soil), it is recommended to use the script model_generation.py in the model/excavator/script/ folder. This script can generate an excavator model following properties given in an input dictionary. For more details, the user may refer to the model README and the docstrings inside the script. Note that the script relies on the Jinja2 templating engine that can be installed using the following command

pip install Jinja2.

To-do list

There are several important features that are yet to be implemented. These include, in order of priority:

  • Improve the actuation. The excavator should not move when a zero velocity is requested.
  • Add reaction force from the soil.