Skip to content

Setting up your simulator

Miles Cobb edited this page Oct 26, 2019 · 29 revisions

Motivation

It is easy to set up a simulation with DroneKit by using DroneKit's simulator, DroneKit-SITL. However, this simulator is insufficient because it runs on ArduCopter 3.3, which is very outdated. As a result, DroneKit-SITL does not support GPS denied functionality, which is an effort that our team specializes in. It is therefore necessary to set up a simulator that runs on the master branch of ArduCopter, which is 3.7.

Method 1: Setting up Ardupilot simulator

git clone https://github.com/ardupilot/ardupilot.git

Windows users

Follow these instructions , but instead of selecting all the dependencies for cygwin, you may run the installer again (within cygwin from your VTOL directory) with ./setup-x86_64 -P "awk 'NR==1{printf $1}{printf ",%s", $1}' simulator/packagelist"

Mac or Linux users

run sh setup.sh

Compiling the binary (windows only)

  1. Set vehicle to SITL ./waf configure --board sitl
  2. Compile desired vehicle ./waf copter

Start your sim

.simulator/arducopter -M Quad (mac) ./build/sitl/bin/arducopter -M Quad (pc) The vehicle can be connected to over TCP at port 5760.

  1. Open QGroundControl. Go to Comm Links and add a TCP connection to 127.0.0.1, port 5760.
  2. QGroundControl will now connect to your simulated vehicle. In the vehicle settings (tab with cog wheel icon)
  3. Go to Safety and make sure none of the arming checks are checked.
  4. Now the simulated vehicle is ready to fly with DroneKit. Execute whichever python script you need. The connection string that your script uses should be "tcp:127.0.0.1:5763" if you still have QGroundControl connected to the vehicle, otherwise "tcp:127.0.0.1:5760."