This documentation will guide you on how to set up a SITL (Software in the loop) on UBUNTU 20.04 LTS with PX4-Autopilot, QGroundControl paired with simulation software Gazebo 11.
Let's get started by opening up the Terminal on your system and entering the following commands:
cd ~
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
bash ./Tools/setup/ubuntu.sh
cd ~
curl -sSL http://get.gazebosim.org | sh
Visit Gazebo website for Alternative installation
Now cd into the PX4-Autopilot directory
cd PX4-Autopilot
make px4_sitl gazebo //QuadCopter
You can visit PX4 website for more models.
The terminal may prompt you to install some python modules during this installation,install it for example
pip3 install --user empy
pip3 install --user toml
pip3 install --user numpy
pip3 install --user jinja2
If you still get error and are not propmted to install any more dependencies, You have to install Gstreamer by entering this commands into Terminal
sudo apt install libgstreamer1.0-dev
sudo apt install gstreamer1.0-plugins-good
sudo apt install gstreamer1.0-plugins-bad
sudo apt install gstreamer1.0-plugins-ugly
It will take some time for the machine to open up Simulator for the first time.
- Before installing QGroundControl Enter the following in Terminal
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager -y
sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl -y
-
Logout and Login again to enable the change to user permissions on your Ubuntu Machine
-
Download QGroundControl
-
cd into the folder where QGroundControl is saved and execute this commands:
cd ~
cd Documents
chmod +x ./QGroundControl.AppImage
./QGroundControl.AppImage (or double click onto the file in documents)