Ask Your Question

How can I connect to a ROS master and the internet via two different networks?

asked 2020-01-06 02:54:41 -0600

gerald_tug gravatar image


I am a student and we are currently working on a project where we use the RethinkRobotics Baxter robot. Our self-made ROS-nodes run on a computer that is connected with the Baxter via a router (the Baxter robot is the ROS master). We also need an inte^rnet connection for our application. Therefore, we connect the computer to a wireless network with an internet connection. This second wireless network is necessary because the University does not allow to connect routers to their existing network.

To sum things up, we have one wired connection to a router to be connected with the ROS-master (Baxter robot) and a wireless network connection to get internet access. Our problem is that we are not able to communicate with the Baxter robot if we are connected with both networks. If we disconnect with the wireless network, everything works fine.

Can anybody help is in that case? Is this a ROS-problem or simply a network setting in ubuntu? We already tried many things but we did not solve the problem.

We are using ROS-kinetic and Ubuntu 16 LTS.

Best regards, Gerald

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-01-06 03:31:57 -0600

gvdhoorn gravatar image

updated 2020-01-06 03:36:22 -0600

Is this a ROS-problem


or simply a network setting in ubuntu?


Try enabling the "Use this connection only for resources on its network" setting for the NIC connected to Baxter.

This setting (image from here):

Use this connection only for resources on its network

Using the command line (from How to toggle NetworkManager's “Use this connection only for resources on its network” option via command line):

nmcli connection modify enp3s0 ipv4.never-default true

make sure to use the correct name for the connection of course.

edit flag offensive delete link more


Note that you'll also need to make sure -- if using hostnames instead of IPs -- that the DNS server you're using knows how to resolve the hostname(s) for your robot(s) to their IPs, or this likely won't work.

gvdhoorn gravatar imagegvdhoorn ( 2020-01-06 03:37:14 -0600 )edit

At first, thank you for your quick answer!

We already tried that. The command "rostopic list" shows us all published topics from the robot. But when we start a ros-node that subscribes a topic from the robot (e.g. robot/state) we get the following error: OSError: [Errno 110] Failed to get robot state on robot/state.

gerald_tug gravatar imagegerald_tug ( 2020-01-06 05:17:52 -0600 )edit

It is a timeout error, so we do not receive messages from the robot, but the topics are known

gerald_tug gravatar imagegerald_tug ( 2020-01-06 05:22:58 -0600 )edit

The roswtf command tells us there is an unknown host for all the topics from the robot and these noded are unconnected. How can I solve that?

gerald_tug gravatar imagegerald_tug ( 2020-01-06 06:01:28 -0600 )edit

The roswtf command tells us there is an unknown host for all the topics from the robot

that would seem to connect to my comment about "make sure you have a working DNS server if using hostnames".

As a test, you could see whether adding the appropriate information to your /etc/hosts file makes thing work. If it does, you should probably use a local DNS to resolve your robot's hostname, and have it forward queries for all other hosts.

If you're absolutely sure the robot will never ever get a different IP, then using /etc/hosts could be acceptable.

gvdhoorn gravatar imagegvdhoorn ( 2020-01-06 07:11:13 -0600 )edit

We added the following line to /etc/hosts:
"Ros-master ip address" "hostname given by rostopic info" and it worked.

Thank you!

gerald_tug gravatar imagegerald_tug ( 2020-01-06 07:52:15 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2020-01-06 02:54:41 -0600

Seen: 43 times

Last updated: Jan 06