Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.

Gazebo PX4 SITL Setup

Mark Sherstan edited this page Aug 11, 2020 · 1 revision

Gazebo and PX4

There is decent documentation for how to set up a correct development environment and there are many helpful bash scripts. The following just summarizes the ones that I used. I would reccomend reading through the full documentation starting here.

Run $ sudo usermod -a -G dialout $USER and then restart your system.

Pixhawk/NuttX (and jMAVSim) install (acknowledge prompts as required and restart the system again upon completion):

$ cd
$ wget https://raw.githubusercontent.com/PX4/Devguide/v1.9.0/build_scripts/ubuntu_sim_nuttx.sh
$ source ubuntu_sim_nuttx.sh

Gazebo Simulation (the script installs Gazebo9 as this is what is supported. Do NOT install anything e.g. - Gazebo11 on your own):

$ cd 
$ wget https://raw.githubusercontent.com/PX4/Devguide/v1.9.0/build_scripts/ubuntu_sim.sh
$ source ubuntu_sim.sh

You should be in the correct directory already. Double check with $ cd ~/src/Firmware. Now run make px4_sitl gazebo and we should get a simulation working. This is most likely where all the errors will show so install the packages as required and read carefully.

A specific firmware can be tested, to see all the releases enter git tag -l and then switch the branch, e.g. git checkout v1.7.4beta. I had some issues with this and resorted to the beta release in Master. I think the issue may be the git submodules. Try the following (again not tested):

git submodule update --recursive

OR

git submodule update --init --recursive
Clone this wiki locally