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

ROS across machines: cant echo topics/visualize rviz (NOT DUPLICATE)

asked 2019-09-04 10:47:56 -0600

Syrine gravatar image

updated 2019-09-05 02:09:08 -0600

Hello,

I'm running ROS across two machine, 1 is robot (master) and 2 my desktop. I want to visualize its scan on my desktop but when I run rviz I get this message

"ROS_HOSTNAME / ROS_IP is set to only allow local connections, so a requested connection to '192.168.10.105' is being rejected."

When I make rostopic list, I get the list normally but when I try to echo a topic on my desktop I see nothing.

Thanks for helping

edit retag flag offensive close merge delete

Comments

Please show us the exact values you are using for ROS_HOSTNAME, ROS_IP and ROS_MASTER_URI on all machines.

And just to make sure: you're setting these variables in all terminals that you open, correct?

gvdhoorn gravatar image gvdhoorn  ( 2019-09-05 03:37:45 -0600 )edit

3 Answers

Sort by ยป oldest newest most voted
1

answered 2019-09-06 03:59:47 -0600

Syrine gravatar image

@gvdhoorn

Hi, sorry for the late reply.

I did solve this by adding the export lines directly to the bashrc files of each computer. And yes I set these variables for all open terminals but that didn't seem to work.

edit flag offensive delete link more

Comments

I had the same problem. Exporting in all shells doesn't seem to help despite being able to get info and echo the required topic. I believe the reason to be that the RVIZ starts a new shell that isn't sourced by default.

The answer @this issue [https://answers.ros.org/question/2449...] describes how the launch works, and how it starts a new process.

krebsalad gravatar image krebsalad  ( 2019-12-06 02:16:15 -0600 )edit
0

answered 2019-09-04 13:57:15 -0600

SamsAutonomy gravatar image

On the robot master did you run:

export ROS_MASTER_URI=http://192.168.10.XXX:1131
export ROS_IP=192.168.10.XXX

Where XXX is the ip values of the master. You can get those by running:
ip a or ifconfig

On the robot slave (your laptop or computer) did you run:

export ROS_MASTER_URI=http://192.168.10.XXX:1131
export ROS_IP=192.168.10.CCC

Where XXX is the ip values of the master from above and CCC is the ip of your computer.

edit flag offensive delete link more

Comments

Hi,

I did run these commands, that's why I was able to see the rostopics from the slave computer; the problem is I want it to echo topics, and see rviz on the slave but I can't

Syrine gravatar image Syrine  ( 2019-09-05 02:07:22 -0600 )edit

See @gvdhoorn comment above and report back, I still feel this is the problem until we know for sure.

SamsAutonomy gravatar image SamsAutonomy  ( 2019-09-05 07:46:27 -0600 )edit
-1

answered 2019-09-06 13:46:09 -0600

I also have problems with multiple machines.

I tried the suggestions of this closed questions:

https://answers.ros.org/question/3869...

I just tried the suggested answer of SamsAutonomy from this questions and it also resulted in the same result as below (see below):

Master: cmd_vel topic published data can be seen

Slave: cmd_vel is rostopic list listed, but no data is coming in.

I can ping and netcat in both directions. ~/.bashrc is sourced.


Desktop computer: Master running roscore

IP: 192.168.178.34

Hostname: user-MS-7A32

Ubuntu 18.04 - ROS Melodic


/etc/hosts

127.0.0.1 localhost

127.0.1.1 user-MS-7A32

192.168.178.44 raspberrypi

::1 localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

Ff00::0 ip6-mcastnet

fe00::0 ip6-mcastprefic


~/.bashrc

export ROS_HOSTNAME=user-MS-7A32

export ROS_MASTER_URI=http://user-MS-7A32:11311

export ROS_IP=192.168.178.34


Raspberry Slave Robot: Not running roscore

IP: 192.168.178.44

Hostname: raspberrypi

Debian Buster - ROS Melodic


/etc/hosts

127.0.0.1 localhost

127.0.1.1 raspberrypi

192.168.178.34 user-MS-7A32

::1 localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters


~/.bashrc

export ROS_HOSTNAME=raspberrypi

export ROS_MASTER_URI=http://user-MS-7A32:11311

export ROS_IP=192.168.178.44


Setup 1:

Master:

$ roscore

$ rostopic echo /cmd_vel

Slave:

$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

$ rostopic echo /cmd_vel

Result:

cmd_vel topic published data can be seen on both machines.

Setup 2:

Master:

$ roscore

$ rosrun teleop_twist_keyboard teleop_twist_keyboard.py

$ rostopic echo /cmd_vel

Slave:

$ rostopic echo /cmd_vel

Result:

Master: cmd_vel topic published data can be seen

Slave: cmd_vel is rostopic list listed, but no data is coming in.

I also tried the suggestion:

Changes on Master:

~/.bashrc

export ROS_MASTER_URI=http://192.168.178.34:11311

Can somebody tell me where my configuration mistake is?

edit flag offensive delete link more

Comments

1

This is a question. Please post it as a new question; not as an answer. This question is already answered, so most users will not look here and will not see your question.

ahendrix gravatar image ahendrix  ( 2019-09-06 15:34:10 -0600 )edit

I thought it was somehow appropriate to post it as an answer to a more or less randomly choosen question on this topic, because I am facing the same problem as many have problems with multiple machines and there are many questions that somehow mostly never end up really solved!

arminf82 gravatar image arminf82  ( 2019-09-07 01:24:21 -0600 )edit
1

@ahendrix is correct: please don't post questions as answers.

I thought it was somehow appropriate to post it as an answer to a more or less randomly choosen question on this topic, because I am facing the same problem as many have problems with multiple machines and there are many questions that somehow mostly never end up really solved!

Then post a new question while referring to the ones you already found.

gvdhoorn gravatar image gvdhoorn  ( 2019-09-07 04:24:33 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-09-04 10:47:56 -0600

Seen: 1,573 times

Last updated: Sep 06 '19