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.shdocker compose builddocker compose build --build-arg PNEUMATIC=trueor alternatively
docker compose build sr-ros2-pneumatic-ubuntudocker compose build --build-arg HSA=trueor alternatively
docker compose build sr-ros2-hsa-ubuntudocker compose build --build-arg ELASTICA=truedocker 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.00docker pull ghcr.io/tud-phi/sr-ros2-bundles:maindocker push ghcr.io/tud-phi/sr-ros2-bundles:mainUbuntu 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-ubuntumacOS host:
docker compose run sr-ros2-core-macosWindows host:
docker compose run sr-ros2-core-windowsAn 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:allMost 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 180The 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_openglOn Ubuntu:
export RMW_IMPLEMENTATION=rmw_cyclonedds_cppOn Windows:
set RMW_IMPLEMENTATION=rmw_cyclonedds_cppOn Windows:
call C:\dev\ros2_foxy\local_setup.batAs soon as we run ROS2 on different hosts, containers etc. we need to set a domain id. On Ubuntu:
export ROS_DOMAIN_ID=25On Windows:
set ROS_DOMAIN_ID=25In 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_amd64As 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