Author: Dominik Zagórnik
Containerized version of my measurement station, including all necessary dependencies and a development container.
Install docker (I recommend using the apt repository) and vcstool.
sudo apt install python3-vcstool
Import station and sensors repositories.
vcs import < src/.repos src
Modify serial_port
parameter in the rplidar launch file (in this case rplidar_a2m8.launch
).
<param name="serial_port" type="string" value="/dev/rplidar"/>
Create udev rules on the host.
./src/rplidar/scripts/create_udev_rules.sh
./src/measurement_station/scripts/create_udev_rules.sh
./src/astra/scripts/create_udev_rules
Build the image and then run the measurement station launch files:
docker build -f docker/Dockerfile --target base -t station:base .
docker run --rm -it station:base bash -c "roslaunch measurement_station station_client.launch"
docker run --rm -it station:base bash -c "roslaunch measurement_station station_server.launch"
The station_client
should be started using run
instead of up
because it requires an interactive shell.
docker compose -f docker/docker-compose.yaml up station_server
docker compose -f docker/docker-compose.yaml run station_client
To develop inside container, run:
docker compose -f docker/docker-compose-dev.yaml up station-dev
Then attach a new terminal window:
docker exec -it station-dev-1 bash
Alternatively, you can use VS Code's DevContainer feature.
Tobit Flatscher ROS inside Docker
Allison Thackston VSCode, Docker, and ROS2
Sebastian Castro An Updated Guide to Docker and ROS 2