0
$\begingroup$

Rosanswers logo

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.


Originally posted by rb on ROS Answers with karma: 130 on 2014-03-15

Post score: 1


Original comments

Comment by rb on 2014-03-15:
note: had to add spaces after "http://" because it said insufficient karma to post links

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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....


Originally posted by Wolf with karma: 7555 on 2014-03-17

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by rb on 2014-03-17:
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...

Comment by Wolf on 2014-03-17:
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.

Comment by burakekincioglu on 2018-09-09:
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 .

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.