Ask Your Question
0

ros not communicating over sub-network

asked 2013-07-19 11:52:47 -0500

gregoiregentil gravatar image

updated 2013-07-22 05:42:00 -0500

dornhege gravatar image

Hello,

I have a PC running Ubuntu 12.04 with three subnets with two physical adapters:

eth0      Link encap:Ethernet  HWaddr XXX
          inet addr:192.168.11.2  Bcast:192.168.11.255  Mask:255.255.255.0

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0

wlan0     Link encap:Ethernet  HWaddr YYY
          inet addr:192.168.10.2  Bcast:192.168.10.255  Mask:255.255.255.0

eth0 is a private subnet. wlan0 is an Internet-connected subnet. I have ros Groovy on this PC which is acting as the server. It runs "roscore" which reports:

started roslaunch server http: // laptop:45332 
ros_comm version 1.9.44
SUMMARY
PARAMETERS
 * /rosdistro
 * /rosversion
NODES
auto-starting new master
process[master]: started with pid [13818]
ROS_MASTER_URI=http: // laptop:11311

I have a device connected over eth0 with the IP 192.168.11.3. I have run on this device:

export ROS_MASTER_URI=http: // 192.168.11.2:11311

I can publish a message from this device (192.168.11.3) to the PC (192.168.11.2). But I cannot publish any message from the PC (192.168.11.2) to the device (192.168.11.3).

It seems that ros on the PC doesn't use the 192.168.11.x subnet and it uses only the 192.168.10.x.

Last important point, in the Ubuntu connection settings for eth0 (192.168.11.x), I have checked the box "Use this connection for resources on this network".

Any idea what I could do to fix this problem?

Many thanks in advance.

edit retag flag offensive close merge delete

Comments

Can the device ping your pc by its name? ("laptop") Try setting ROS_IP to the IPs on both sides and use the IPs in the ROS_MASTER_URI.

Ben_S gravatar imageBen_S ( 2013-07-22 05:19:56 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-07-22 03:59:33 -0500

tbh gravatar image

In the past when I had problems like this, they went away when I used names instead of ips on all computers. I'd imagine your device knows the name and ip of the PC, but the PC doesn't know something about the device. Check out this page if you can't edit /etc/hosts files on both machines to make sure they know what to call each other.

edit flag offensive delete link more
0

answered 2013-07-22 06:22:17 -0500

gregoiregentil gravatar image

Yes, adding names to /etc/hosts on both sides fixed the problem. Thanks.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2013-07-19 11:52:47 -0500

Seen: 407 times

Last updated: Jul 22 '13