This guide is meant to replace the one on the official ArduPilot website, which appears to be somewhat deprecated.
- Cygwin with the required packages.
- MAVProxy for Windows
- GCC Compiler. Make sure to accept the license, install to default location, accept the SSL certificate, and check the option to "Add path to environment variable."
- FlightGear
- Download
setup-x86_64.exe
. - Run the following command in a DOS prompt where you downloaded
setup-x86_64.exe
.
setup-x86_64.exe -P autoconf,automake,ccache,gcc-g++,git,libtool,make,gawk,libexpat-devel,libxml2-devel,python27,python2-future,python27-libxml2,python27-pip,libxslt-devel,python27-devel,procps-ng,zip,gdb,ddd
Use the default options, clicking "Next" to continue.
This is only necessary if you want to simulate Pixhawk boards. Download from here.
- Accept license.
- Install to default location.
- Accept SSL certificate.
- Check option to "Add path to environment variable." Restart Cygwin if it hasn't been started.
Use git to clone the ArduPilot software.
In the folder where you want ArduPilot to be, type the following commands:
git clone https://github.com/ArduPilot/ardupilot.git
cd ardupilot
git submodule update --init --recursive
Adding New Locations
If you want to change the default location of FlightGear, open
the file ardupilot/Tools/autotest/fg_plane_view.bat
and add a few options:
--lat=20.819083 ^
--long=-100.414276 ^
--altitude=2023 ^
I then changed the locations.txt
file, adding this line:
MEX=20.819083,-100.414276,2023,360
Now, FlightGear Plane View defaults to the test location in Mexico.
Open the Cygwin64 Terminal and install extra packages with the following command:
pip2 install empy pyserial pymavlink
Download and install FlightGear from: https://www.flightgear.org/download/
It's a 1.6GB file, so it might take a while.
Once installed, make sure to enable the option to "Automatically download scenery", or FlightGear will give you untextured surroundings.
After determining that everything is configured correctly,
- Open two Cygwin windows. One window will be your FlightGear window, and the other will be your MAVProxy window.
- In both windows,
cd /your-ardupilot-directory/Tools/autotest
- In the FlightGear window
cd Tools/autotest
./fg_plane_view.bat
- In the MAVProxy window:
python sim_vehicle.py --console --out <YOUR_IP_ADDRESS>:14550 -L MEX -v ArduPlane
To find your IP address, simply run ipconfig
in cmd.exe
.