# Setting up Environment & start SITL (Linux) ###### tags: `Drone` ## Get git tool ``` sudo apt-get update ``` ``` sudo apt-get install git ``` ## Download files Using git to download Ardupilot files from GitHub. ``` git clone https://github.com/ArduPilot/ardupilot.git ``` ## Install some required packages :::info If you are on a debian based system (such as ==Ubuntu== or ==Mint==), we provide a script that will do it for you. From ardupilot directory : ::: ``` Tools/environment_install/install-prereqs-ubuntu.sh -y ``` ``` . ~/.profile ``` :::warning :warning: When it all done you have to reboot the OS ! ::: ## Start SITL simulator >ex. multicopter ``` cd ardupilot/ArduCopter ``` >Use the -w option to wipe the virtual EEPROM and load the right default parameters for your vehicle. ``` sim_vehicle.py -w ``` ![](https://i.imgur.com/NdMziL2.png) >First kill the sim_vehicle.py you are running using ==Ctrl-C==. Then: ``` sim_vehicle.py --console --map ``` :::danger Problem : The map can't open. Solution : Use FlightGear 3D View. ::: ## FlightGear 3D View (Optional) 1. Install FlightGear from the terminal ``` sudo apt-get install flightgear ``` 2. Open a new command prompt and run the appropriate shell file for your vehicle in /ardupilot/Tools/autotest/: fg_plane_view.sh (Plane) and fg_quad_view.sh (Copter). ==This will start FlightGear.== 3. Start SITL in the terminal in the normal way. In this case we’re specifying the start location as San Francisco airport (KSFO) as this is an interesting airport with lots to see: ``` sim_vehicle.py -L KSFO ``` ![](https://i.imgur.com/uIYi3an.png) ## Reference * [Setting up SITL on Linux](https://ardupilot.org/dev/docs/setting-up-sitl-on-linux.html) * [Setting up the Build Environment (Linux/Ubuntu)](https://ardupilot.org/dev/docs/building-setup-linux.html#building-setup-linux) * https://github.com/Intelligent-Quads/iq_tutorials/blob/master/docs/Installing_Ardupilot.md