Skip to main content
Unlisted page
This page is unlisted. Search engines will not index it, and only users having a direct link can access it.

Docker

Docker is a useful tool when working with ROS2 and the SENSUS SDK as it allows you to containerise your workflow and manage dependancies to ensure reproducibility.

tip

Currently we only support Docker on Linux platforms as GPU and USB passthrough functionally requires work arounds on Windows and Mac Systems.

Install Docker Engine​

Follow the instruction shown here to install docker on your Linux system, https://docs.docker.com/engine/install/ubuntu/

If you have a NVIDIA GPU that you want to use for processing please also install the NVIDIA container-toolkit -> https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/supported-platforms.html

This allows you to use additional command when running docker (e.g. --gpus=all) to give the container access to this hardware.

sensus-docker​

Internally we use a docker repo to serve these image alternatively the images can be download and loaded manually.

# cd Cran-ROS-Docker
docker load -i cuda-ros2.tar

Check this worked with

docker images ls

# Should see this in the list: calyo/debug:latest-new

Place some datasets in the datasets folder:

📦Cran-ROS-Docker
┣ 📂workspace
┃ ┣ 📂datasets
┃ ┃ ┣ !!!!! ADD DATASET FOLDERS HERE !!!!!!! (e.g ./3/)
┃ ┗ 📂rosdist
┃ ┃ ┣ 📂config
┃ ┃ ┃ ┣ 📜listener_legacy.json
┃ ┃ ┃ ┣ 📜listener_legacy_2.json
┃ ┃ ┃ ┣ 📜listener_legacy_3d.json
┃ ┃ ┃ ┗ 📜listener_legacy_3d_2.json
┣ 📜cuda-ros2.tar
┗ 📜launch.sh

Using the image​

To launch this container you need to use the docker run command along with some options. I have made you a script to do all of this.

tip

I forgot to add this to the script so please edit line 38 of the script to use the correct folder name of your dataset:

tmux send-keys -t ros_session:ros2bag 'ros2 bag play /robot_ws/datasets/2/ --loop' ---> tmux send-keys -t ros_session:ros2bag 'ros2 bag play /robot_ws/datasets/<NAME OF YOUR DATASET FOLDER/ --loop' C-m &&

Just run ./launch.sh and it should all run if setup correctly.

You can now view with foxglove or rviz !!!

Ignore the rest please :)

docker run --name robot-replay --gpus all -it --rm --network=host --device=/dev/bus/usb -v <host-system-path>:/robot_ws/ calyo/debug:latest-new bash
--gpus all -> Fowards the CUDA gpu to the container
-it -> Starts an interactive docker session allowing us to connect to it
--rm -> Deletes the containers filesystem when close (Only store thing you want to keep in the mounted folder)
--device=/dev/bus/usb --> Fowards the USB bus for live sensors to work
-v <host-system-path>:/robot_ws/ --> Mounts a volume (Important allows this local folder to be used inside the container, required code and file should be put here)
--network=host --> Uses hosts networking (Useful for ROS)
calyo/debug:latest-new --> Name of the image (repository:tag)

New Dataset Corruption​

Volume

​