drones-workshop

Automated Drone Simulation Setup for Ubuntu 20.04 (with/without WSL)

This guide will help you set up a complete simulation environment for drones using PX4, Ardupilot, Gazebo, MAVROS, QGroundControl, and IQ Sim with minimal human intervention.

Requirements

  1. Ubuntu 20.04 LTS or Windows with WSL.
  2. An internet connection for downloading required packages.

Software Overview

Steps to Run the Setup Script

Step 0. (Optional for WSL)

Set the default version to WSL 2 and install Ubuntu 20.04:

wsl --set-default-version 2
wsl --install -d Ubuntu-20.04

Step 1. Clone the Repository

First, clone the repository to get access to the setup script:

git clone https://github.com/Shival-Gupta/drones-workshop.git
cd drones-workshop

Step 2. Run the setup.sh Script

The setup.sh script automates the installation and setup process for ROS, PX4, Ardupilot, Gazebo, MAVROS, and IQ Sim.

Make the script executable and run it:

chmod +x setup.sh
./setup.sh

Options

Step 3. Run the Verification Script

After installation, it’s recommended to verify that everything is set up correctly:

chmod +x verify.sh
./verify.sh

Step 4. Launch PX4 SITL with Gazebo

After the installation, you can run PX4 SITL (Software In The Loop) with Gazebo:

cd ~/PX4-Autopilot
make px4_sitl_default gazebo

Step 5. Launch Ardupilot SITL with Gazebo

To run Ardupilot with Gazebo:

  1. Launch Gazebo with the Ardupilot-Gazebo plugin:
    gazebo --verbose ~/ardupilot_gazebo/worlds/iris_arducopter_runway.world
    
    
  2. In another terminal, launch Ardupilot SITL:
    cd ~/ardupilot/ArduCopter
    sim_vehicle.py -v ArduCopter -f gazebo-iris --console
    
    

Step 6. Running MAVROS and IQ Sim

To launch IQ Sim and get telemetry data from the drone:

  1. In one terminal, launch the runway simulation:
    roslaunch iq_sim runway.launch
       
    
  2. In another terminal, run Ardupilot SITL:
    cd ~
    ./startsitl.sh
    
    
  3. Open QGroundControl:
    ./QGroundControl.AppImage
    
    

Step 7. Using MAVROS and Checking Telemetry Data

To monitor telemetry data:

  1. Start MAVROS:
    roslaunch iq_sim apm.launch
    
    
  2. View telemetry data from FCU:
    rostopic echo /mavros/global_position/local
    
    
  3. Interact with MAVProxy to control the drone:
    mode guided
    arm throttle
    takeoff 10
    
    

Troubleshooting

Additional Information