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.
Set the default version to WSL 2 and install Ubuntu 20.04:
wsl --set-default-version 2
wsl --install -d Ubuntu-20.04
First, clone the repository to get access to the setup script:
git clone https://github.com/Shival-Gupta/drones-workshop.git
cd drones-workshop
setup.sh ScriptThe 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
./setup.sh./setup.sh --uninstall./setup.sh --reinstall./setup.sh --force-install./setup.sh --full-installation./setup.sh --wslAfter installation, it’s recommended to verify that everything is set up correctly:
chmod +x verify.sh
./verify.sh
After the installation, you can run PX4 SITL (Software In The Loop) with Gazebo:
cd ~/PX4-Autopilot
make px4_sitl_default gazebo
To run Ardupilot with Gazebo:
gazebo --verbose ~/ardupilot_gazebo/worlds/iris_arducopter_runway.world
cd ~/ardupilot/ArduCopter
sim_vehicle.py -v ArduCopter -f gazebo-iris --console
To launch IQ Sim and get telemetry data from the drone:
roslaunch iq_sim runway.launch
cd ~
./startsitl.sh
./QGroundControl.AppImage
To monitor telemetry data:
roslaunch iq_sim apm.launch
rostopic echo /mavros/global_position/local
mode guided
arm throttle
takeoff 10
setup.sh script.source ~/.bashrc
verify.log) for details about your installation status.