ROS across machines: cant echo topics/visualize rviz (NOT DUPLICATE)
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
"ROSHOSTNAME / ROSIP 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
Asked by Syrine on 2019-09-04 10:47:56 UTC
Answers
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.
Asked by SamsAutonomy on 2019-09-04 13:57:15 UTC
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
Asked by Syrine on 2019-09-05 02:07:22 UTC
See @gvdhoorn comment above and report back, I still feel this is the problem until we know for sure.
Asked by SamsAutonomy on 2019-09-05 07:46:27 UTC
@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.
Asked by Syrine on 2019-09-06 03:59:47 UTC
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/244960/shell-bash-used-in-a-roslaunchsolved/] describes how the launch works, and how it starts a new process.
Asked by krebsalad on 2019-12-06 03:16:15 UTC
I also have problems with multiple machines.
I tried the suggestions of this closed questions:
https://answers.ros.org/question/38694/running-ros-across-multiple-machines/
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?
Asked by arminf82 on 2019-09-06 13:46:09 UTC
Comments
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.
Asked by ahendrix on 2019-09-06 15:34:10 UTC
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!
Asked by arminf82 on 2019-09-07 01:24:21 UTC
@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.
Asked by gvdhoorn on 2019-09-07 04:24:33 UTC
Comments
Please show us the exact values you are using for
ROS_HOSTNAME
,ROS_IP
andROS_MASTER_URI
on all machines.And just to make sure: you're setting these variables in all terminals that you open, correct?
Asked by gvdhoorn on 2019-09-05 03:37:45 UTC