ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Communicating with ROS over network - do not use host names

asked 2014-03-15 21:25:15 -0500

rb gravatar image

updated 2016-10-24 08:36:24 -0500

ngrennan gravatar image

I am trying have two computers communicate over a network as described here: wiki.ros.org/ROS/NetworkSetup

The problem is, no matter what I do, it seems that ros tries to communicate using hostnames. I want to use IP addresses only.

on both computers I have tried setting both ROS_IP and ROS_HOSTNAME to their own respective IP addresses.

-Both computers are able to ping eachother

  • ROS_MASTER_URI is set to http:// master.IP.Add.ress:11311 on both computers

  • upon running rospy_tutorials talker.py on the "other" computer, it shows up under node list on the "host" computer. However, if I run rosnode info on the talker, it says:

    contacting node http:// ubuntu:33802/ ...
    ERROR: Communication with node[http://ubuntu:33802/] failed!
    

Running the listener, or rostopic echo on the talker yields no results. Why can't I get rid of the "ubuntu" hostname? I just want IP addresses.

edit retag flag offensive close merge delete

Comments

1

note: had to add spaces after "http://" because it said insufficient karma to post links

rb gravatar image rb  ( 2014-03-15 21:25:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-03-17 07:50:50 -0500

Wolf gravatar image

Your error very much looks like you failed to set ROS_IP. You need to set

export ROS_MASTER_URI=http://192.168.1.10:11311/ # 192.168.1.10 IP of PC hosting roscore
export ROS_IP=192.168.1.15      # 192.168.1.15 own IP

And do not modify ROS_HOSTNAME. Tell me if it worked....

edit flag offensive delete link more

Comments

1

I did try it this way initially, and it did not work. One issue I feel like may be that I don't really understand the way environment variables work in linux. Are they per terminal window? Should I set them before or after I run ros? I've been trying all kinds of combinations blindly...

rb gravatar image rb  ( 2014-03-17 22:18:07 -0500 )edit
1

Yes, they are per terminal and yes, you have to set them before running any ros-related stuff. I personally prefer to add these two lines also to ~/.bashrc (same as source /opt/ros .... /setup.bash). After you added them you need to close and open again all terminals to have the env vars set.

Wolf gravatar image Wolf  ( 2014-03-17 23:50:06 -0500 )edit

if you dont write this codes((export ROS_MASTER_URI=http://192.168.1.10:11311/ # 192.168.1.10 export ROS_IP=192.168.1.15 # 192.168.1.15 own IP )) in /opt/ros .... /setup.bash file, you should write this codes before every running roscore .

burakekincioglu gravatar image burakekincioglu  ( 2018-09-09 05:29:45 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-03-15 21:25:15 -0500

Seen: 1,870 times

Last updated: Mar 17 '14