In this example we're setting up ros2
and its dependencies so we can debug a particular component, in this case rclpy.
To replicate this, you need to fork ros
so you can edit ros2.repos to point to your modified component (here forked rclpy).
See for example this commit on branch custom_rclpy
.
The devcontainer.json
file can be used to develop with VS code's devcontainer extension. If you're not using VS code, you can build the container using
docker build -f Dockerfile --build-arg GH_USER yourgithubhandle --build-arg GH_BRANCH=branchinyourforkedrepo
where GH_BRANCH
is the branch in the ros2
repo.
Latest instructions on building from source can be found here. Make sure you pick the right distro.
Note: I'm hoping there was a better/faster way to do this. I initially just started with base image ros:rolling
and cloned the forked rclpy
repo, but got an error with colcon complaining that two repos were installed.
This also means that all the other repositories need to be built from source rather than just the one you're trying to modify.