Skip to content

Ubuntu ‐ Setup Drone Environment

Marshall Vielmetti edited this page Oct 17, 2024 · 11 revisions

Clone Drone Repository

mrover
cd ../

Running pwd should tell you you're in the folder ros2_ws/src

After confirming this, clone the repository:

git clone [email protected]:umrover/mrover-drone.git --recurse-submodules mrover_drone && cd mrover_drone

If submodules / dependencies change:

git submodule update --recursive

Initialize ROS2 Dependencies

ROSDEP Wiki Page Initialize ROSDEP:

sudo rosdep init
rosdep update

Install Dependencies:

cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y

Build External Dependencies

Based on PX4 Build Guide

With Build Script

TODO

Manual Build

Manual build process copied from the above link

Build PX4

cd ~/ros2_ws/src/mrover_drone/deps/
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
cd PX4-Autopilot/
make px4_sitl

Build uXRCE-DDS-Agent

cd ~/ros2_ws/src/mrover_drone/deps/Micro-XRCE-DDS-Agent
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib

Test Installation

Start by running the DDS agent. In a new terminal, run:

MicroXRCEAgent udp4 -p 8888

This will start a MicroXRCE DDS agent on port 8888.

We can now start the PX4-sitl ("software in the loop") simulator.

This will start a uXRCe-DDS client automatically on localhost port 8888.

In a new terminal, run the following command:

cd ~/ros2_ws/src/mrover_drone/deps/PX4-Autopilot
make px4_sitl gz_x500

You should now see output in the DDS agent terminal, and Gazebo should launch.

Install MAVROS

MAVROS GitHub

MAVROS should be added by rosdep. However, you must run the following to download a required dataset:

cd ~/ros2_ws/src/mrover_drone
chmod +x ./scripts/install_geographiclib_datasets.sh
sudo ./scripts/install_geographiclib_datasets.sh