Skip to main content

Setup SITL on Mac

Setup SITL using vagrant

Install VirtualBox and Vagrant

brew cask install virtualbox
brew install vagrant

Start Ubuntu VirtualBox VM

vagrant up

Login to the VM and start the simulator

vagrant ssh -j 2
# OR
vagrant ssh -c " -j 2"

When starting simulator for the first time, reset and load the parameters -w -j 2

The default is ArduCopter. To use other variants, use

vagrant ssh -c " -j 2 -v ArduPlane"

Use --aircraft option to specify the log directory. This will keep the logs in separate directory and keep each flight and it's parameters separate. -j 2 --aircraft sitlquad

The APM code will be automatically shared from your local machine and loaded to the VM. Any changes you make to the local files will be compiled by the script on the VM.

Once sim is running, connect to the simulator using MAVProxy --master= --sitl= --out=

# To forward mavlink messages to APM Planner, etc., use `--out` option or issue the following command at MAVProxy prompt and add a UDP connection to the port from APM Planner.
output add

Once finished, suspend the VM

vagrant suspend
# To resume a supended VM
vagrant resume
# OR to shutdown the VM
vagrant halt
# OR to remove the VM from your machine
vagrant destroy

Load RCSetup module to do RC Calibration in MAVProxy

module load rcsetup

Now help should list rccal as one of the options.

rccal start
rccal done

To use a joystic or RC transmitter, install pygame

brew install sdl sdl_image sdl_mixer sdl_ttf portmidi
# make sure hg is installed
brew install mercurial
pip install hg+

In MAVProxy, load joystick module

module load joystick

To make things easier, disable arm checking

arm safetyoff
arm uncheck all

wp load some_wp_file.txt

# Finally, arm the motors.
arm throttle
mode auto

log list
log download log# filename.bin