0
$\begingroup$

Rosanswers logo

Hi, I am trying to view Kinect data in RVIZ on a remote client in ROS. I have exported the ROS_MASTER_URI to set to the machine with the roscore running but it won't send back any data. Rviz gives this error:

[ WARN] [1427845377.406032758]: ROS_HOSTNAME / ROS_IP is set to only allow local connections, so a requested connection to 'lukas-Inspiron-N7010' is being rejected.

How can I fix this? Both machines are running Ubuntu 14.04 with Indigo. I followed this tutorial and I couldn't get them talking to each other although I can see the topics being published with rostopic echo. All help is appreciated. Thanks, luketheduke


Originally posted by luketheduke on ROS Answers with karma: 285 on 2015-03-31

Post score: 1


Original comments

Comment by BennyRe on 2015-04-01:
Have you set ROS_IP to the IP of the interface connected to the other computer?

Comment by luketheduke on 2015-04-01:
So if bot is the computer I am running the roscore on, I should set the ROS_IP of the other computer to that of bot?

Comment by BennyRe on 2015-04-01:
No. Set it to the IP of your computer.

Comment by luketheduke on 2015-04-01:
OK! That clarifies it. I'll try it soon here when I get a minute. Another quick question: do I have to set these every time I boot or are they saved? Thanks, luketheduke

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Set the environment variable ROS_IPon your machine to the IP of your computer. If you have more than one network interfaces take the interface that connects to the network of the robot.

If you want to set this variable persistently append the export statement to your .bashrc.


Originally posted by BennyRe with karma: 2949 on 2015-04-02

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by jbb55 on 2019-11-15:
This doesn't work for me. I have a robot at 192.168.0.1 (with rosmaster running) and a laptop at 192.168.0.222. They can ping and communicate successfully

Robot has variables: ROS_IP=192.168.0.1 and ROS_MASTER_URI=http://192.168.0.1:11311 Laptop has variables: ROS_IP=192.168.0.222 and ROS_MASTER_URI=http://192.168.0.1:1311

But when launching rviz I also get [ WARN] [1573849670.099213432]: ROS_HOSTNAME / ROS_IP is set to only allow local connections, so a requested connection to '192.168.0.1' is being rejected.

$\endgroup$
0
$\begingroup$

Rosanswers logo

What solved it for me:

On the laptop, ROS_HOSTNAME wasn't set (nothing in .bashrc). After launching rviz on the laptop, I looked at the environmental variables again, and saw that something had set ROS_HOSTNAME=localhost, which seems to have the effect of causing it to reject remote connections.

Solution: on the laptop, set ROS_HOSTNAME=$ROS_IP (I added this to .bachrc, after ROS_IP=<ip addr of laptop>). Then remote connections are accepted.


Originally posted by jbb55 with karma: 31 on 2019-11-15

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by jayess on 2019-11-16:
ROS_HOSTNAME should be a hostname, not an IP address (which ROS_IP is). Also, if both ROS_HOSTNAME and ROS_IP are set, ROS_HOSTNAME will take precedence. See the Environment Variables page on the wiki

Comment by jbb55 on 2019-11-16:
@jayess can you clarify why launching rviz would result in the ROS_HOSTNAME variable getting set when it wasn't set before launching it?

In other words:

printenv | grep ROS # ROS_IP and ROS_MASTER_URI are set, ROS_HOSTNAME is not present
rviz # launches rviz
# control-C to stop rviz
printenv | grep ROS # now, ROS_HOSTNAME is set to localhost

Comment by jayess on 2019-11-16:
Not sure about rviz setting any environment variables. Perhaps you should create a question about that

$\endgroup$

Your Answer

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