-
Notifications
You must be signed in to change notification settings - Fork 32
Setting up your simulator
Lucas Young edited this page May 25, 2019
·
29 revisions
We have two methods of setting up a simulator of ArduPilot's master branch. The first method is easier. The second method should be used if you cannot get the first method to work.
Method 1: Setting up Ardupilot simulator (easier)
- Install and launch the Ubuntu subsystem. In the Ubuntu terminal,
- sudo apt install g++
- sudo apt-get install python2.7
- sudo apt install python-pip
- pip install future Proceed to compiling the binary
- Clone the ardupilot repository. Cd into it.
- Set vehicle to SITL
./waf configure --board sitl
- Compile desired vehicle
./waf copter
./build/sitl/bin/arducopter -M QuadCopter
The vehicle can be connected to over TCP at port 5760.
- Open QGroundControl. Go to Comm Links and add a TCP connection to 127.0.0.1, port 5760.
- QGroundControl will now connect to your simulated vehicle. In the vehicle settings (tab with cog wheel icon), go to Airframe and ensure that frame class is a Quad and the frame type is X.
- Go to Safety and make sure none of the arming checks are checkedc.
- 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."
Method 2: Setting up a Vagrant simulator
- Git
Leave line endings untouchedgit config --global core.autocrlf false
- Install VirtualBox for your OS
- Install Vagrant for your OS
- Clone the autopilot repository
git clone https://github.com/ArduPilot/ardupilot.git
- Within the ardupilot directory add the following lines to your vagrantfile before the final "end"
config.vm.network "forwarded_port", guest: 5760, host: 5760, protocol: "tcp"
config.vm.network "forwarded_port", guest: 5761, host: 5761, protocol: "tcp"
config.vm.network "forwarded_port", guest: 5762, host: 5762, protocol: "tcp"
config.vm.network "forwarded_port", guest: 5763, host: 5763, protocol: "tcp" - Launch vagrant
vagrant up
- Initialize submodules
vagrant ssh
cd /vagrant
git submodule update --init --recursive
exit
vagrant ssh
-
cd
into ArduPlane sim_vehicle.py -l 35.328423,-120.752505,580,0 -j4 -f quadplane --console --map
- Project Overview
- Dependency List
- GCS JSON Message Formatting
- Dronekit mission_basic.py
- Continuous Integration with Travis
- Engineering Requirements
- Test Hierarchy
- Style Guide
- Glossary