Skip to content

Network

Gustav Bernpaintner edited this page Aug 18, 2023 · 9 revisions

ROS Network Setup

In order to get ROS to work over the network, there is a bit of setup you have to do. This is necessary for when you want to access the data published on ARI on your machine without ssh, like when you want to visualize ARI's topics in rviz.

Setup

Add this line to your /etc/hosts file:

192.168.128.28 ari ari-30c aric control embedded

Run these on the command line from which you want to interact with ARI, where you replace with your IP. IMPORTANT: It must be an IP ARI can reach you with, so not localhost.

export ROS_MASTER_URI=http://ari:11311
export ROS_IP=<your-ip>

Explanation

Setting ROS_MASTER_URI on your machine allows it to find the ROS master, allowing you to see all the available nodes and their topics. ROS_MASTER_URI is already set on ARI by default.

Adding the hostnames in /etc/hosts is necessary in order for your machine to communicate with the nodes on ARI. This is because they advertise themselves using a hostname (defined on ARI) and not ARI's IP address. Thus, if your machine doesn't understand the hostname, you will still be able to see the available nodes and topics (since this only requires you to see the ROS master, i.e. having set ROS_MASTER_URI), but you won't be able to communicate with them.

Setting ROS_IP allows ARI to communicate with nodes on your machine. Thus, this is only necessary if you want to publish/run services on your machine that should be reachable from ARI. If all you want is to be able to visualize ARI's topics with rviz, you do not need to set this.

Improving Latency

If you require a lower latency connection to ARI you can try turning off network power management on ARI:

sudo iwconfig wlan0 power off

To check the status of the power management, run

iwconfig wlan0

This change is not persistent on ARI. There might be some daemon that handles it, but it doesn't seem to be NetworkManager.

You can also try doing the same thing on the connecting machine. If you want to make the setting persistent and your machine uses the NetworkManager service, you can edit /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and change it (requires root) from

[connection]
wifi.powersave = 3

to

[connection]
wifi.powersave = 2

To make the new setting take effect immediately, run

sudo systemctl restart NetworkManager

Clone this wiki locally