[Documentation] [TitleIndex] [WordIndex

TurtleBot Networking Setup

ROS requires bidirectional networking between all computers attached to the network and does not have security built in. Using a VPN is recommended.

For more information see ROS/NetworkSetup and ROS/EnvironmentVariables

For this tutorial you must know the IP of the netbook on TurtleBot (IP_OF_TURTLEBOT). You will also need the IP of your personal computer/workstation (IP_OF_WORKSTATION). If the hostname is properly resolved on both computers, you don't need to set this.

Determining IP address

To determine a computer's IP address and network interface in linux:

  • ifconfig

You will see something like:

  • lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:6658055 errors:0 dropped:0 overruns:0 frame:0
              TX packets:6658055 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:587372914 (587.3 MB)  TX bytes:587372914 (587.3 MB)
    
    wlan1     Link encap:Ethernet  HWaddr 48:5d:60:75:58:90  
              inet addr:10.0.129.17  Bcast:10.0.129.255  Mask:255.255.254.0
              inet6 addr: fe80::4a5d:60ff:fe75:5890/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:101983 errors:0 dropped:0 overruns:0 frame:0
              TX packets:37244 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:49326141 (49.3 MB)  TX bytes:7588044 (7.5 MB)
  • the network interface for the wireless card is wlan1

  • the IP address of the computer is 10.0.129.17

Confirm Connectivity

Ping from the laptop to the workstation and back by IP, or fully resolved hostname. From TurtleBot laptop ping workstation/desktop using IP_OF_WORKSTATION

From workstation ping TurtleBot using IP_OF_TURTLEBOT

TurtleBot Setup

ROS_MASTER_URI

On TurtleBot Laptop set ROS_MASTER_URI:

ROS_HOSTNAME

On the TurtleBot laptop set ROS_HOSTNAME to IP address of laptop.

Workstation Setup

ROS_MASTER_URI

The ROS master runs on the TurtleBot laptop, so on workstation set ROS_MASTER_URI to point to TurtleBot laptop:

ROS_HOSTNAME

On workstation set ROS_HOSTNAME to match IP address of workstation.

Verify ROS connectivity

The following section is not strictly necessary. However, if there is a problem with the ROS networking setup between the TurtleBot and workstation, it will be easier to identify it early.

Restart turtlebot service

After changing ROS_MASTER_URI and ROS_HOSTNAME on laptop, restart turtlebot server so it will use new settings. Open new command line terminal on TurtleBot laptop and run:

Verify connectivity from TurtleBot to ROS master

On TurtleBot laptop, make sure it can contact ROS master by running:

If you get the following error:

Check that the turtlebot service is started

Also make sure ROS_MASTER_URI is set correctly

Verify connectivity between ROS nodes on TurtleBot laptop

In new terminal on TurtleBot laptop run:

If you don't get a response a warning like

Check that ROS_HOSTNAME is set correctly on TurtleBot laptop.

Verify connectivity from workstation to ROS master

Open new command line terminal on workstation and run:

If you don't see list of topics check value of ROS_MASTER_URI.

Verify connectivity from workstation to TurtleBot laptop

On workstation run:

If you don't get a warning that topic has not been published, then verify that ROS_HOSTNAME is set correctly on TurtleBot laptop.

Verify connectivity from TurtleBot laptop to workstation

Finally, check that TurtleBot laptop can get data from ROS node running on workstation.

On workstation run:

On TurtleBot laptop run

The message "hello" begin printed about 10 times a second. If not, check the ROS_HOSTNAME setting on the workstation computer.

Troubleshooting

VPN

For convenience and security it is often recommended to setup up a VPN to which both your robot and workstation can connect. If you do so, set the ROS_HOSTNAME to be the address on the VPN. Once you have setup the VPN you can set the turtlebot service to use it by following the instructions for an alternate network interface.

Alternate Network Interface

Check - this may not be functional for groovy

If you are using a different network adapter besides wlan0 (the default wireless), such as the ethernet port or a USB dongle, expand the instructions below, regardless of whether you are using a VPN service.

Do the following

roscd turtlebot_bringup/upstart
sudo install.sh tun0

If you get an error that looks like:

sudo: install.sh: command not found

try typing:

sudo ./install.bash tun0

If you are using openvpn, the device is setup as tun0.

If you are using a wireless dongle or ethernet device identify the network interface you want to use and replace tun0 with it. Other common alternatives would be wlan1 and eth0.

What Next?


2024-02-24 12:22