Skip to content

Repository containing ROS2 Docker images including primary ROS2 packages for operation of soft robot

License

Notifications You must be signed in to change notification settings

tud-phi/sr-ros2-bundles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soft Robotics ROS2 Docker image

ci-main

Repository containing ROS2 Docker images including core ROS2 packages for operation of soft robot

Initialization and sourcing

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 Usage

Build image (standard)

docker compose build

Build image for pneumatic robots

docker compose build --build-arg PNEUMATIC=true

or alternatively

docker compose build sr-ros2-pneumatic-ubuntu

Build image for HSA robots

docker compose build --build-arg HSA=true

or alternatively

docker compose build sr-ros2-hsa-ubuntu

Build image (with Elastica)

docker compose build --build-arg ELASTICA=true

Build image (with PyTorch)

docker compose build --build-arg PYTORCH=true

Build image (with SOFA)

# 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

Pull Docker image

docker pull ghcr.io/tud-phi/sr-ros2-bundles:main

Push Docker image

docker push ghcr.io/tud-phi/sr-ros2-bundles:main

Compose Docker container

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

GUI

X Server

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

Running Qt Applications on macOS

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.

PlotJuggler

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

Some random advice

Set RMW implementation to Cyclon DDS

On Ubuntu:

export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

On Windows:

set RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

Sourcing of Workspace

On Windows:

call C:\dev\ros2_foxy\local_setup.bat

Domain ID

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")

Building on Windows

Source Visual Studio Command prompt:

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64

Set USB Latency for Dynamixel motors

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

About

Repository containing ROS2 Docker images including primary ROS2 packages for operation of soft robot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •