This is the Dockerfile to setup the current public version of MAVSim in an Alpine Linux container with ArduPilot SITL. This uses ArduPlane.
Note: We all use Macs, so this by defaults work of MacOS, so you may have to tweak for Windows and Linux
For logging, a Postgres database is needed. If one is not setup then logging will not record anything.
- Click on the
+NEW
button and search for "postgres" - Use the Official postgres container (the one with the elephant logo below)
- Stop the container from running and add
POSTGRES_PASSWORD
to the Environmental Variables. Set it to something secure and rememberable.SAVE
this change. - With the container running, open a terminal using the
EXEC
button. In that shell, become the postgres user
# su postgres
then open postgres
# psql
psql (9.6.4)
Type "help" for help.
postgres=#
- Create a database then exit with
\q
postgres=# CREATE DATABASE apm_missions;
CREATE DATABASE
postgres=# \q
- Close the terminal, you now have a working local version of the Postgres database. Be mindful that it may not be persistent, so be sure to learn about
pg_dump
if you want to save and eventually restore data.
You can also setup a cloud hosted Postgres database on the Amazon Cloud, which can be persistent and backed-up regularly. See Amazon RDS for PostgreSQL for detailed information.
Note: MAVSim by default writes a lot of data to a database, so be careful of lag if using a remote database. They are better setup as a follower to a local database.
If you want to look at data on your database and edit or test access and data, then take a look at pgAdmin (highly recommended) or the FREE version of Valentina Studio.
This is pre-build on Docker Cloud, so if you need to adjust please look at the container/develop
in the MAVSim Public repository
Containers can be volatile, so please be sure setup to save changes if you want to preserve your work.
- Running the container will startup a running MAVSim instance. Configure via the container environment variables.
- Alternatively, one can open (i.e.,
EXEC
button on Kitematic ordocker exec
on command line) a shell for mavsim andcd /mavsim
(you should already be there, but just in case). Run./mavsim.py
in that shell. MAVSim will run ArduPilot and everything else for you. If you need to stop MAVSim, useControl-C
.
Note: You will have to kill all mavsim, simvehicle and jsbsim instances before running your own as described in 2.
The mavsim-arduplane Docker Container is maintained by G. Michael Youngblood at the Palo Alto Research Center (PARC, a Xerox company) in California. It is licensed under GPLv3.