Skip to main content

Getting Started

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
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
# This is a good time to grab some tea.
# This will take about 10 minutes on a laptop.
# TODO: why from source; why CUDA flags; why not check for updates
colcon build --packages-select librealsense2 --cmake-args \
  -DBUILD_WITH_CUDA=ON                                    \
  -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc          \
  -DCHECK_FOR_UPDATES=OFF                                 \
  -DFORCE_RSUSB_BACKEND=ON

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

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

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