Docker Images for auxiliary tools
Welcome. In this section you will find useful information about Docker images used to run tools useful for visualizing and debugging applications. Below is a table presenting in a compact form Docker images enabling quick launch of a given tool. Below the tables, you will also find a chapter Minimal Setup showing the minimum configuration of the container that is needed for proper startup (e.g. in the case of a camera, specify the device port).
If you are not sure how to launch images you can learn it form Examples section.
Available images
Here's the list of Docker images hosted on Husarion's Docker Hub profile:
Name | Image | Description | Tags | Architectures | |
---|---|---|---|---|---|
Husarnet | |||||
husarnet/husarnet | Peer-to-Peer VPN to connect your computers, microcontrollers and containers with zero configuration. | ||||
2.0.180 | amd64 arm arm64 | ||||
2.0.178 | amd64 arm arm64 | ||||
Foxglove | |||||
husarion/foxglove | Foxglove Studio image customized for running on Husarion robots directly | ||||
1.84.0 | amd64 arm64 | ||||
1.83.0 | amd64 arm64 | ||||
Joy2Twist | |||||
husarion/joy2twist | Controlling a mobile robot using a gamepad | ||||
humble | amd64 arm64 | ||||
noetic | amd64 arm64 | ||||
Micro-ROS | |||||
husarion/micro-ros-agent | |||||
humble | amd64 arm64 | ||||
PlotJuggler | |||||
husarion/plotjuggler | PlotJuggler ROS 2 tool for visualizing time series | ||||
humble | amd64 arm64 | ||||
ROS Bridge | |||||
husarion/ros1-bridge | |||||
galactic | amd64 arm64 | ||||
foxy | amd64 arm64 | ||||
RViz2 | |||||
husarion/rviz2 | Prebuild Docker image with RViz2 and Nav2 plugin | ||||
humble | amd64 arm64 | ||||
galactic | amd64 arm64 | ||||
foxy | amd64 arm64 | ||||
RViz | |||||
husarion/rviz | RViz for visualizing state of ROS 1 system in a nice GUI | ||||
noetic | amd64 arm64 |
Minimal setup
In this section you can find the minimum configuration to run specific program.
Husarnet
Husarnet is a low-latency, peer-to-peer VPN allowing you to connect your ROS 2 powered devices not only in LAN but also over the Internet.
All Husarion ROS 2 Docker Images are based on the husarnet/ros
images. They are slightly modified official ROS docker images with an addition of the Husarnet-DDS that is launched in the ros_entrypoint.sh
. Thanks to Husarnet-DDS the XML configuration file for Fast DDS or Cyclone DDS is created automatically and therefore you don't need to bind mount it to the container.
You can run Husarnet natively on your host operating system (recommended for physical robots) or inisde a separate Docker network namespace (very handy if you want to embed Husarnet into your SAAS application that requires a separate Husarnet host for each user)
Docker Network Namespace
In this configuration hnet0
network interface is NOT AVAILABLE on the level of your host OS, but only inside the Docker container. To share hnet0
network interface with other containers, you need to run them with a custom network_mode
:
network_mode: service:<name-of-your-husarnet-service>
Note that the Husarnet Docker image allows you to define the WAIT_HOSTNAMES
environment variable containing the list of other Husarnet hosts that are required by your system. Thanks to that the Husarnet service is considered healthy only if all other hosts are available in the network. You can use that feature to postpone the start of the ROS 2 based Docker containers by the time all required hosts are available with this lines added to ROS Docker service:
depends_on:
<name-of-your-husarnet-service>: { condition: service_healthy }
Additionally you need to choose the DDS implementation and define the environment variable with the path to its XML DDS configuration file(read more about those files in Fast DDS or Cyclone DDS ). This path MUST CONTAIN husarnet
text inisde.
Why we need a custom DDS configuration?
DDS by default discovers other hosts in the network by using the multicasting. It doesn't work nor scale well while using VPN, and therefore we need to specify the list of all hosts in the ROS 2 network in the DDS configuration file.
Here is a basic talker/listener demo that you can run on two separate machines, in different networks:
- Talker
- Listener
# Launching:
# find Husarnet Join Code from app.husarnet.com and execute:
#
# export JOINCODE=<paste-your-joincode-here>
# docker compose up
services:
husarnet-talker:
image: husarnet/husarnet:2.0.170
volumes:
- /var/lib/husarnet # This will persist your Husarnet Client keys, thus IP of the container will be stable/the same between (re)boots
sysctls:
- net.ipv6.conf.all.disable_ipv6=0 # Husarnet is using IPv6 for the internal connections
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
environment:
- WAIT_HOSTNAMES=talker,listener
- HOSTNAME=talker
- JOINCODE
talker:
image: husarion/ros2-demo-nodes:humble
network_mode: service:husarnet-talker
depends_on:
husarnet-talker: { condition: service_healthy }
environment:
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
- FASTRTPS_DEFAULT_PROFILES_FILE=/husarnet-fastdds.xml
command: ros2 run demo_nodes_cpp talker
# Launching:
# find Husarnet Join Code from app.husarnet.com and execute:
#
# export JOINCODE=<paste-your-joincode-here>
# docker compose up
services:
husarnet-listener:
image: husarnet/husarnet:2.0.170
volumes:
- /var/lib/husarnet # This will persist your Husarnet Client keys, thus IP of the container will be stable/the same between (re)boots
sysctls:
- net.ipv6.conf.all.disable_ipv6=0 # Husarnet is using IPv6 for the internal connections
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
environment:
- WAIT_HOSTNAMES=talker,listener
- HOSTNAME=listener
- JOINCODE
listener:
image: husarion/ros2-demo-nodes:humble
network_mode: service:husarnet-listener
depends_on:
husarnet-listener: { condition: service_healthy }
environment:
- RMW_IMPLEMENTATION=rmw_fastrtps_cpp
- FASTRTPS_DEFAULT_PROFILES_FILE=/husarnet-fastdds.xml
command: ros2 run demo_nodes_cpp listener
Click here for more information about using the Husarnet Docker image.
Using Host Network Namespace
To have a hnet0
network interface on your host OS, you can install Husarnet natively (available for Linux, Windows and MacOS) or run the Docker container this way:
# Launching:
# find Husarnet Join Code from app.husarnet.com and execute:
#
# export JOINCODE=<paste-your-joincode-here>
# docker compose up
services:
husarnet:
image: husarnet/husarnet:2.0.170
network_mode: host
volumes:
- /var/lib/husarnet # This will persist your Husarnet Client keys, thus IP of the container will be stable/the same between (re)boots
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
environment:
- HUSARNET_DEBUG=true
- HOSTNAME=my-robot
- JOINCODE
If you do so, the hnet0
network interface will be available on you host OS:
user@my-laptop:~$ ip addr show
...
3: hnet0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1350 qdisc fq_codel state UNKNOWN group default qlen 500
link/none
inet6 fc94:7781:50d4:bb97:cb4c:167a:c5b9:9a50/16 scope global
valid_lft forever preferred_lft forever
inet6 fe80::9887:3237:251b:4c16/64 scope link stable-privacy
valid_lft forever preferred_lft forever
If you want to share hnet0
network namespace from your host OS with the ROS 2 containers you just need to run them with the network_mode: host
, eg:
services:
listener:
image: husarion/ros2-demo-nodes:humble
network_mode: host
environment:
- RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
- FASTRTPS_DEFAULT_PROFILES_FILE=file:///husarnet-cyclonedds.xml
command: ros2 run demo_nodes_cpp talker
Note that we no longer need:
depends_on:
husarnet: { condition: service_healthy }
because before starting our ROS 2 services in Docker, the host operating systems are already in the same Husarnet network and therefore Husarnet-DDS operating inside the ROS 2 container can create a correct DDS XML file with all needed hosts.
PlotJuggler
plotjuggler-ros:
image: husarion/plotjuggler:humble
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- /dev/dri:/dev/dri
command: ros2 run plotjuggler plotjuggler
RViz
rviz:
image: husarion/rviz:noetic
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- /dev/dri:/dev/dri
RViz2
rviz2:
image: husarion/rviz2:humble
environment:
- DISPLAY=${DISPLAY}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
- /dev/dri:/dev/dri