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. This is only necessary if you want to publish/run services on your machine that you want to 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

Configure ARI Proxy

Follow these instructions to configure ARI's proxy (required to get internet access on ARI).

Before anything else, run

sudo overlayroot-chroot

or none of the following changes will persist once ARI is restarted.

Then, to get APT working so you can install and update stuff, run

sudo echo 'Acquire::http::Proxy "http://iot-proxy.misc.kth.se:8888";' >> /etc/apt/apt.conf
sudo echo 'Acquire::https::Proxy "http://iot-proxy.misc.kth.se:8888";' >> /etc/apt/apt.conf

Now APT should be working so you should be able to install for example Nano using sudo apt install nano if you are more familiar with Nano than Vim.

Second, to get general internet access working you run

sudo echo 'export http_proxy=http://iot-proxy.misc.kth.se:8888' >> /etc/environment
sudo echo 'export https_proxy=http://iot-proxy.misc.kth.se:8888' >> /etc/environment
sudo echo 'export ftp_proxy=http://iot-proxy.misc.kth.se:8888' >> /etc/environment
sudo echo 'export no_proxy="localhost,127.0.0.1,::1"' >> /etc/environment

These will come into effect next time someone logs into the system. To make it come into effect immediately, run

export http_proxy=http://iot-proxy.misc.kth.se:8888
export https_proxy=http://iot-proxy.misc.kth.se:8888
export ftp_proxy=http://iot-proxy.misc.kth.se:8888
export no_proxy="localhost,127.0.0.1,::1"

It can be worth noting that you can install things via APT using the proxy without the first two lines using

sudo 'http://iot-proxy.misc.kth.se:8888' apt-get install PACKAGE

Clone this wiki locally