Ros2router short tutorial

In this commit (and in your home directory) you’ll find a couple of files helpful with your ros2router setup. (We’ve introduced some fixes here and there over the last couple of days, it’s only a resulting summary.)

The instructions are similar to what was published in the previous post (Ros2router short tutorial, but with some tweaks to make your life easier, namely:

  • there’s a decompressor compose file meant to be used on your local machine (i.e. not an on-site VM) - so you can copy it alongside your superclient.xml

  • there’s a ros2router directory in your home folder (some Teams already had one so we haven’t touched these) - with a compose config and updated filter/superclient generators

  • there’s an example filter config, with a list of topics you can expect from the robot

As per the usage instructions:

  • on your VM, cd ~/ros2router && docker compose up -d (network tweaks are already in place in case of a VM)

  • on your VM, docker compose exec ros2router cat /var/tmp/superclient.xml > ~/superclient.xml to generate a superclient.xml file containing your Husarnet IPv6 address

  • from your VM to your local machine, copy superclient.xml and compose.decompressor-ros2router.yaml files

  • on your local machine, apply networking tweaks:


# increase socket buffers

sudo sysctl -w net.core.wmem_max=12582912

sudo sysctl -w net.core.rmem_max=12582912

sudo sysctl -w net.core.wmem_default=16384000

sudo sysctl -w net.core.rmem_default=16384000

# avoid IP fragmentation issues

sudo sysctl -w net.ipv4.ipfrag_high_thresh=134217728 # 128 MB

sudo sysctl -w net.ipv4.ipfrag_time=3

sudo sysctl -w net.ipv6.ip6frag_high_thresh=134217728 # 128 MB

sudo sysctl -w net.ipv6.ip6frag_time=3

# adapt Husarnet interface

sudo ip link set dev hnet0 txqueuelen 500

sudo ip link set dev hnet0 mtu 1350

  • on your local machine, setup ROS (this can i.e. be added to .bashrc if you know what are you doing):

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp

export FASTRTPS_DEFAULT_PROFILES_FILE=$HOME/superclient.xml

  • on your local machine, restart DDS ros2 daemon stop

  • on your local machine, docker compose -f compose.decompressor-ros2router.yaml up -d to start the decompressor

  • on your local machine - you now should have access to both the robot topics and the decompressed camera streams

1 Like