Skip to main content

Getting Started

Prerequisites

All development happens on Ubuntu 22.04 (Jammy Jellyfish). If you are running Windows, the easiest way to install it is through WSL2.

If you prefer to work in Docker, you can use image docker.io/osrf/ros:humble-desktop-full.

You need to have a basic understanding of ROS2. Follow ROS2 tutorials before you continue.

First time setup

### Download the code
git clone https://github.com/RoboTeamTwente/erc-software-rover
cd erc-software-rover
git submodule update --init --recursive

### Launch ROS2 in Docker (only if you don't have Ubuntu 22.04)
#docker run --rm -it -v $PWD:/src -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY osrf/ros:humble-desktop-full
#cd /src

### Install dependencies
apt update
rosdep install -iy --from-path src

### Compile RealSense depth cam driver with custom flags
# It is a good time to grab some tea.
# Compilation will take about 5 minutes on a reasonably modern laptop,
# or about 30 minutes on Jonny Boi.
colcon build --packages-select librealsense2 --cmake-args \
  -DCHECK_FOR_UPDATES=OFF                                 \
  -DFORCE_RSUSB_BACKEND=ON

librealsense2 is built from source to switch it to the RSUSB backend. We use this backend because it does not require a kernel patch, unlike the default one. See the RealSense installation guide for details. We also disable the update checker, because it fails to build for some reason.

Common operations

Compile

While working on a package, you'll frequently want to compile it and all its dependencies:

colcon build --packages-up-to=$PACKAGE
source install/local_setup.bash

Don't forget to cd to the root of the repo!

local_setup.bash doesn't need to be sourced most of the time.

Run your code

There are two different things you can run in ROS2: A node, and a launch file. For more details see Understanding nodes and Launching nodes.

ros2 run $PACKAGE $EXECUTABLE
# -- or --
ros2 launch $PACKAGE $LAUNCH_FILE