SITL on Windows in a VMWare VM (Manual Setup)¶
This article explains how to manually set up the SITL ArduPilot Simulator in a virtual machine environment on Windows, and connect it to a Ground Control Station
See Setting up SITL using Vagrant for a more automated setup process.
The SITL (Software In The Loop) simulator allows you to run Plane, Copter or Rover without any hardware. The simulator runs the normal ArduPilot code as a native executable on a Linux PC. SITL can also be run within a virtual machine on Windows, Mac OSX or Linux.
This article shows how to manually set up SITL on a Linux environment hosted in a VMware virtual machine.
The instructions were tested on Windows 8 with VMware ver 7.1.0 build-2496824 and Ubuntu 14.10.
Step #1 - Install VMWare and create an Ubuntu Virtual Machine¶
1. Download and install VMware (look for VMware Player and VMware Player Plus for Windows)
- Download the Ubuntu iso
3. Start VMware and create new ubuntu machine by selecting Player > File > New Virtual Machine
- Enter your Full name, user name and password for the virtual machine. you will use these later when you log onto this virtual machine
- Name your virtual machine (i.e. Copter-SITL)
- Specify Disk Capacity - leave Max disk size as default 20GB, and “Split virtual disk into multiple files” checked
- On next page of “New Virtual Machine Wizard” click the “Customize Hardware..” button
- On the Hardware tab set Memory: 3GB,Processors: 4,Hard Disk: 20GB,Network Adapter: NAT
Step #2 - Start the VM for the first time¶
Power on the machine by double clicking on item just created in the VMware Player
Press “No” to any questions like “Cannot connect to the XXX device because no corresponding device is available on the host”
Enter your password when the login screen appears
Say “no” to any options to upgrade versions
Open firefox and make sure it can access some web page like www.ardupilot.org
Set the clock by double clicking on the top right corner, select your location on the map and “Set the time:” to “Automatically from the internet”
Setup a terminal short by clicking on the Dash Home icon on the top left, Type “terminal” and then drag the terminal applicatoin to the left start pane
Step #4 - install packages on your VM¶
Most of these same dependencies will be installed when you do the next step (SITL instructions for Linux).
Open up a terminal and type the following to update the list of packages in the software center:
sudo apt-get update
Then install the following packages (reply ‘y’ if it prompts you re additional disk space used)
sudo apt-get install python-dev dos2unix python-wxgtk2.8 python-matplotlib python-opencv python-pip g++ g++-4.7 gawk git ccache sudo pip install pymavlink sudo pip install mavproxy
If you wish to run Plane you will also need to install these packages:
sudo apt-get install libexpat1-dev auto.conf libtool automake
Step #5 - Follow the Linux instructions¶
Now that you have a Linux VM you should follow the SITL instructions for Linux
Connecting with the Mission Planner¶
In addition to using the mavproxy ground station (the command line style
ground station written in python) it should be possible to connect with
the Mission Planner by appending the
--viewerip=XXX.X.X.X to the end
of the start up command where the Xs are replaced with your machine’s IP
address. This address can be found by typing “ipconfig” into a command
You will likely see many more than one IP address listed so you may need to try a few different addresses to find one that works.
So for this example the following would then be entered into the terminal on the Ubuntu VM:
./Tools/autotest/autotest.py build.Copter fly.Copter logs.Copter --map --viewerip=192.168.184.1
Next connect with the mission planner after first setting the “COM Port” to “UDP”.
After the simulation is run, dataflash logs named “Copter.flashlog” or “CopterAVC.flashlog” will be created the “buildlogs” directory. This directory is created at the same level as the ardupilot directory (i.e. the top level directly that holds the “Copter”, “Plane” and “libraries” directories). Because of the inconvenient name you’ll need to change the file extension to ”.log” before opening in Mission Planner.