A ready-to-go dev environment for using ROS2 in docker easily. Supports GUI tools, networking, almost like a standard ROS2 install.
This repo is essentially a ros2 version of ros_in_docker. I chose to install some of the "dotfile" dependencies(tmux, oh-my-zsh) from scratch to make the Dockerfile more understandable.
Works in WSL2 on Windows or Ubuntu. Assumes docker engine(recommended for Ubuntu) or docker desktop is installed. Note: Make is used here as a shortcut to typing out common commands, but it is not necessary
- Setup
- Clone any ros packages you want to use into
./src
- If you have additional dependencies, add them to the
Dockerfile
in the# Install ROS2/Additional dependencies
section- Note: By default, the
Dockerfile
will find all thepackage.xml
files undersrc/
and install any dependencies listed in them usingrosdep
- Note: By default, the
- Add any python requirements to
requirements.txt
- Any required rosbags can be placed in
bags/
- Clone any ros packages you want to use into
make docker
- Re-run this command whenever you make any changes to your dependencies or the
Dockerfile
- If you just create new ROS2 packages under
src/
, you don't need to re-build the docker container
- Re-run this command whenever you make any changes to your dependencies or the
make
- Builds the packages in
src/
and this repo will become your colcon workspace in the container
- Builds the packages in
- A tmux window will open and you can use any commands to run ROS2 scripts, build with colcon, and pretty much do anything you can do in a normal terminal.
make exit
to close the container
- For a nice dev environment, use VSCode with the remote development/devcontainers extension and you can remote into the docker container directly
- If you want to change the rosbag directory path, just update the
ROS_BAGS
variable in theMakefile
- You can hold right-click in the tmux window and drag the cursor to a desired command if you don't want to use tmux keyboard shortcuts
- Scrolling will also work in tmux windows by default
- You can edit any
zsh
,tmuxinator
, ortmux
configs by editing the files in docker_settings