Pycarous is a python wrapper for the core ICAROUS C++ modules. Pycarous enables us to simulate ICAROUS (faster than real time). This is very helpful to perform batch simulations and analysis for ICAROUS.
First, follow the module instructions to compile the core ICAROUS modules.
Pycarous requires several python packages. These packages can be easily installed as follows:
pip3 install -r requirements.txt
Note: If you are using windows, consult the Gotchas section at the end.
python3 setup.py build_ext --inplace
The RunPySim.py
script can be used to simulate a scenario. Provide as input the flightplan the unmanned vehicle is required to fly, zero or more Keep-in and/or Keep-out geofence constraints the vehicle should satisfy and zero or more intruders.
- Input flightplans are provided in the mavlink format.
- Geofences are defined using a simple yaml file. Refer to geofence.yaml for an example.
- Intruder initial conditions are defined using a simple yaml file. See traffic.yaml for an example.
Refer to the help for more information on flags:
python3 RunPySim.py --help
A simple example simulating an encounter with a traffic intruder is provided. To simulate and visualize an animation of the simulation, try the following script:
python3 RunPySim.py -t data/traffic.txt
The above simulation produces a .json log file containing the callsign of the vehicle. Use the VisualizeLog.py
script to visualize the simulation.
python3 VisualizeLog.py simlog-SPEEDBIRD.json
- The python3 version should have been compiled using the same compiler used to generate the core Modules. For the Modules, we've recommended using the MinGW compiler tool chain. If you are using msys2 as recommended, you should be able to install a compatible python3 and python3-pip version from msys2.
- Make sure the windows environment path variable contains the
bin
folder where python3 and python3-pip are installed. The default place isC:\msys64\mingw64\bin
. - Unfortunately, not all packages can be installed via pip3. We recommend looking at the
requirements.txt
file for required packages and manually installing them via msys2. msys2 contains MinGW compatible package distributions. You should be able to search for the packages on msys2 as follows:
pacman -S package_name