In this project, we will be setting up a SITL simulation for PX4 within a Docker container. The container is also capable of creating multiple vehicles if you want swarm simulations etc.
List of the packages that is required for this package is
- Docker
- A GCS software to connect to vehicle(s) (It can be QGroundControl or MAVProxy etc.)
To get a local copy up simply run the following command.
Pull the docker image from server
docker pull oguzhankose/px4-multi-sitl:latest
If you want only one vehicle you can run container without making any changes. For multi simulations you need to set afew parameters.
For connecting vehicles you can use MAVProxy as follows (or you can use QGroundControl etc.)
mavproxy.py --master=tcp:0.0.0.0:5760
Warning : This command will work only with default settings. If you change MAVLINK_TCP_OUT variable you also need to set TCP port in here.
Just run container with default parameters
docker run --rm -it -p5760:5760/tcp oguzhankose/px4-multi-sitl:latest
Warning : The simulation publishes MAVLink connection to tcp:0.0.0.0:5760 by default. To cahnge tcp port see Environment Variables.
Run container for 3 vehicles with setting TCP port to 5770.
docker run --rm -it -p 5770:5770/tcp oguzhankose/px4-multi-sitl:latest -e NUMBER_OF_INSTANCES=3 -e MAVLINK_TCP_OUT="5770"
Warning : MAVLINK_TCP_OUT variable and "-p" argument MUST be same.
Environment variables and their default values are as follows
- PX4_HOME_LAT 42.3898
- PX4_HOME_LON -71.1476
- PX4_HOME_ALT 14.2
- HOST_IP 192.168.1.211
- NUMBER_OF_INSTANCES 1
- MAVLINK_TCP_OUT "5760"
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Oguzhan Kose - @twitter - koseo16@itu.edu.tr
Project Link: https://github.com/oguzhankose/px4-multi-sitl