8000 GitHub - causemx/ardupilot-sitl-docker: Ardupilot SITL running in docker with support for UI (MAVProxy console and map)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

causemx/ardupilot-sitl-docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ardupilot SITL docker

Run Ardupilot SITL in Docker in Ubuntu LTS 22.04, with SITL and MAVProxy UI using X11/XQuartz display

Screenshot of macOS running XQuartz showing 3 windows: ArduPlane SITL, MavProxy Map and MavProxy console

Quick usage

The quick approach skips setting up UIs and won't use docker-compose, but starts the SITL in one command, as long as Docker Desktop is installed.

docker run -it orthuk/ardupilot-sitl /home/docker/ardupilot/Tools/autotest/sim_vehicle.py -v ArduPlane --frame quadplane --map --console

Setup

  • Install docker desktop
  • Clone repo: git clone https://github.com/ben-xD/ardupilot-sitl-docker
  • Run cd ardupilot-sitl-docker
  • Either:
    • Download and run the images I publish: docker-compose -p sitl up -d remote
    • Build a local image: docker-compose -p sitl up -d local

Usage

  • Depending on if you're using locally buit or remote image, use sitl-remote-1 or sitl-local-1 as the container name

  • 1 command approach: Run SITL command from outside container: docker exec -it sitl-local-1 /home/docker/ardupilot/Tools/autotest/sim_vehicle.py -v ArduPlane --frame quadplane --map --console

    • Run any command from outside container: run docker exec -it sitl-local-1 $your_command
  • Enter container approach: Enter container: run docker exec -it sitl-local-1 bash

    • Once inside the container, start SITL: run sim_vehicle.py -v ArduPlane --frame quadplane --map --console

More specific usage examples

Pro tip: Read the help pages for sim_vehicle.py (sim-vehicle.help.md) and MAVProxy (MAVProxy.help.md).

  • Run alongside other GCSs by configuring MAVProxy to output to a port that your GCS listens on: run docker exec -it sitl-local-1 /home/docker/ardupilot/Tools/autotest/sim_vehicle.py -v ArduPlane --frame quadplane --map --console -w --mavproxy-args="--out udp:host.docker.internal:14550 --state-basedir=/tmp/mavlink-sitl"
    • Just install and start QGroundControl. QGroundControl will automatically detect UDP mavlink on 14550.
    • You can even connect your SITL to Android mission planner. Find out your android's IP address, and add --out :udp:$ANDROID_IP_ADDRESS:14550 and launch Mission Planner.

QGroundControl on macOS and Mission Planner on Android

To setup UI (MavProxy map, console and ArduPlane SITL) on macOS

  • Install Xquartz

  • Open Xquarts, go into preferences, Security, and enable "Allow connections from network clients" (credits to https://stackoverflow.com/a/72593701/7365866) XQuartz settings page

  • Restart your computer

  • In your terminal, run xhost + 127.0.0.1. You need to re-run this whenever XQuartz is restarted

  • Start SITL: run docker exec -it sitl-local-1 /home/docker/ardupilot/Tools/autotest/sim_vehicle.py -v ArduPlane --frame quadplane --map --console

Avoiding running xhost + everytime

You could automatically run by adding the following to your .zshrc:

# Ardupilot SITL Docker, see https://github.com/ben-xd/ardupilot-sitl-docker
# Allow docker containers to access X11/XQuartz
xhost + 127.0.0.1 >/dev/null 2>&1

Resources I used

Alternative approaches

You could consider adding ardupilot to the repo, and copying that in. That will allow you to make changes to Ardupilot and test them on a SITL conveniently.

About

Ardupilot SITL running in docker with support for UI (MAVProxy console and map)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 100.0%
0