Skip to content

oguzhankose/px4-multi-sitl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


PX4 SITL Simulator for Multiple Vehicles

Report Bug · Request Feature

Table of Contents

  1. Purpose of the Project
  2. Installation
  3. Usage
  4. Environment Variables
  5. License
  6. Contact

Purpose of Project

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.


Installation

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

Usage

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.


Running Single Instance

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.


Running Multiple Instance

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

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"

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.


Contact

Oguzhan Kose - @twitter - koseo16@itu.edu.tr

Project Link: https://github.com/oguzhankose/px4-multi-sitl

Releases

No releases published

Packages

No packages published