A demo project that shows a proposed structure of a modularized and containerized ROS system. It includes two submodules, where module 1 includes a talker/listener node in two packages whereas module 2 includes a node that subscribes to the topic of the talker and outputs a colored image based on the message data.
- Docker Engine
- Docker Compose plugin (If you're using Compose version 1, you need to use "docker-compose" instead of "docker compose" in your commands!)
git clone --recursive https://github.com/KevS272/ros_demo_project.git
sudo docker compose up
The Docker images get built and after that, compose will start up a container that automatically builds the Colcon workspace and starts the launch file that was specified in docker/ros_entrypoint.sh
which gets copied into the image during the build process.
You can stop the nodes at any time using CTRL
+ C
in the command line. The compose will stop the container (it does not delete it!). This means you can start the container again using sudo docker compose up
.
If you want to run the container detached, add the -d
flag to the compose command like this:
sudo docker compose up -d
If you do this, you will have to sudo docker compose stop
to stop the container or sudo docker compose down
to completely remove it.
Module 1 automatically starts a Foxglove websocket for visualization purposes through its launchfile.
Go to the Foxglove website and follow the instructions for installation
Click on Open connection
and choose Foxglove WebSocket
. In the websocket URL field, paste the following URL, which is the one from the module1 container:
ws://localhost:8765
After that, click on open.
Click on the Layout dropdown menu in the top right corner of the Foxglove window and choose Import from file
.
Navigate to this repo and load the foxglove_demo_panel.json
. Now, you should see both the talker message as well as the changing color image in Foxglove.