Skip to content

darienmt/px4-sitl-ros-example

Repository files navigation

PX4 SITL ROS Example

This repo contains examples of PX4 SITL with Gazebo.

Cloning the repo

The PX4 firmware is installed as git submodule. The examples here assume to use that code without modifications, and it is separated from the src/ directory. To clone this repo, you need to use the following command instead of the regular git clone:

git clone --recursive <project_url>

Making the PX4.

Before running anything, you need to make the PX4 Firmware, follow the instruction here executed in the directory /px4-firmware. The last step of those instructions could be:

make px4_sitl gazebo

And then ctl+c to turn off the execution when successfully you see the drone on Gazebo.

More information about other targets could be found here

Dependencies

This code depends on a few packages most of them are already installed on a full-desktop-ROS installation and the compilation of the PX4 firmware. In addition to that, you need to install MAVROS.

Compiling the examples

To compile the examples use catkin:

catkin_make

Running the examples

Each example will have a launch-*.sh script that will set up the environment variables as described here to run the example package and PX4. Those common variables are expressed in launch-common.sh.

Examples description