Repository containing ROS2 Docker images including core ROS2 packages for operation of soft robot
We have combined some convenience commands related to USB latency and X server access in the init.sh
script, which can be run as
source ./init.sh
docker compose build
docker compose build --build-arg PNEUMATIC=true
or alternatively
docker compose build sr-ros2-pneumatic-ubuntu
docker compose build --build-arg HSA=true
or alternatively
docker compose build sr-ros2-hsa-ubuntu
docker compose build --build-arg ELASTICA=true
docker compose build --build-arg PYTORCH=true
# Build with default SOFA version (21.06.02)
docker compose build --build-arg SOFA=true
# Build with specific SOFA version
docker compose build --build-arg SOFA=true --build-arg SOFA_VERSION=21.12.00
docker pull ghcr.io/tud-phi/sr-ros2-bundles:main
docker push ghcr.io/tud-phi/sr-ros2-bundles:main
Ubuntu host:
Make sure you have install the NVIDIA Container Toolkit if you are running on an Ubuntu host, if not follow these instructions. Please be aware, that the NVIDIA Container Toolkit sometimes requires sudo to run the commands below.
sudo docker compose run sr-ros2-core-ubuntu
macOS host:
docker compose run sr-ros2-core-macos
Windows host:
docker compose run sr-ros2-core-windows
An X server is required for any GUI usage. The X server is started automatically when the container is started. As an X client, Xming can be used on Windows and XQuartz on macOS. Please make sure that you allow connections from all clients and most of the time its better to disable OpenGL.
XQuartz can be started and all connections allowed with:
xhost +local:all
Most ROS2 GUI applications such as rviz2
, rqt
etc. require the Qt framework. For this to work on a macOS host, we need to run first on the host
socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\"
as explained in this tutorial.
The open-source software PlotJuggler can be used to plot time series and export CSV data from ROS topics. It can be launched as follows:
ros2 run plotjuggler plotjuggler --buffer_size 180
The buffer size flag determines the maximum size of the streaming buffer.
Please make sure to disable OpenGL on non-linux hosts:
ros2 run plotjuggler plotjuggler --disable_opengl
On Ubuntu:
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
On Windows:
set RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
On Windows:
call C:\dev\ros2_foxy\local_setup.bat
As soon as we run ROS2 on different hosts, containers etc. we need to set a domain id. On Ubuntu:
export ROS_DOMAIN_ID=25
On Windows:
set ROS_DOMAIN_ID=25
In Matlab:
setenv("ROS_DOMAIN_ID", "25")
Source Visual Studio Command prompt:
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
As explained in the Dynamixel documentation, the default USB latency is 16ms. Usually, we would want to reduce this to 1ms. On Ubuntu, the following command can be run:
echo 1 | sudo tee /sys/bus/usb-serial/devices/ttyUSB0/latency_timer