A tool for orchestrating drone simulation experiments.
drone-sim-runner is a Python package that simplifies running drone simulations by
managing multiple processes:
- Simulator: Launches the simulation environment (currently Parrot Sphinx/UE4)
- Firmware: Starts the drone firmware to connect to the simulator (compatible with Sphinx Sim)
- Script: Executes your experiment/control algorithm
The package handles process lifecycle, initialization detection, logging, and cleanup automatically.
In a virtual environment
python -m pip install -e .For running the examples with Parrot Sphinx:
python -m pip install -r requirements-optional.txt- Will work on GNU/Linux systems only (Ubuntu and Debian supported by Sphinx currently)
- Parrot Sphinx simulator installed
- Parrot UE4 environment (e.g.,
sudo apt install parrot-ue4-emptyas in example-config.yaml) - A
.envfile with yourAUTHvariable for sudo operations
Note: You will need a .env at the base project level that has the root password
under a variable named AUTH. For example:
AUTH=YOUR-SUDO-PASSWORD
This is needed to run the following command:
sudo systemctl restart firmwared.service
drone-sim-runner/
├── core/ # Shared utilities (logging, process management)
└── sphx/ # Sphinx-specific implementation
Available examples are provided with a configuration file, the script will open the Parrot Sphinx ue4-empty map, load the Anafi 4K drone firmware and then run the takeoff and land script. Running the example:
python -m pip install -e .
python examples/run_sphinx_simulator_take_off_and_land.pyCreate a YAML configuration file similar to examples/example-config.yaml
to define your simulation setup. If no additional .fbx files (Parrot Sphinx supports only these files)
are needed that field can be left empty. If they are needed you need to provide the path from the base
directory where the .fbx config .yaml file lives, and it must match this structure:
├── config
│ └── add_car.yaml
├── models
│ └── car.fbx
This is needed because in add_car.yaml the FBX path is given a relative
path to avoid hardcoding absolute paths (whom are needed by Parrot Sphinx -config-file parameter):
FbxPath: "${MODELS_DIR}/car.fbx"
For scripts arguments if custom parameters are needed they can be added in the YAML configuration
file based on your needs. If paths need to be provided (e.g., for creating output directories)
you can pass them with ${output_dir}/ placeholder to avoid hardcoding paths in the YAML.
Your controller script can accept custom arguments via argparse.ArgumentParser().
These must match the keys defined under args in the YAML configuration file.
For example, given this config:
args:
--log_path: "${output_dir}/logs"
--sleep_time: 10Your script should have:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--sleep_time", type=int, help="Time in seconds to wait.")
parser.add_argument("--log_path", type=str, help="Where to store the logs.")
args = parser.parse_args()- MuJoCo support