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

"Unable to connect to move_group" when running another machine

asked 2021-08-20 07:11:55 -0500

Kiwi_gamer01 gravatar image

updated 2021-08-20 09:53:41 -0500

gvdhoorn gravatar image

I wanted to controll my RobotArm via Rviz, followed a tutorial and everything works fine.

In the end: I ran rviz on an external device with the Rosmaster sitting on the robot itself.

For testing purposes i used the intern Rosmaster and then to try it for "real" i got to connect to the Rosmaster of the Robot "export ROS_MASTER_URI = http: //hostname:11311")".

Everything is the same except that when i run the demo.launch on the "real" Rosmaster i got:

[ERROR] [1629309314.819565696]: Unable to connect to move_group action server 'move_group' within allotted time (30s)

I already checkt the connection: both machines are connected to the internet via eth0. Both can be pinged. They also can ping each other(Hostname and IP works) and both can get access to them via ssh(Hostname and IP works). The ROS_MASTER_URI is definitive the same. There is no time difference between the machines (same timezone). I've also checked the docs wiki/ROS/NetworkSetup and wiki/ROS/Tutorials/MultipleMachines.

That's it. Nothing more shows up or happens and i am not able to find something that helps. If you do have have any questions about my setup. I'll try to answer asap.

External Device (Virtual Machine):

  • Ubuntu 16.04.7 LTS
    • /rosdistro: kinetic
    • /rosversion: 1.12.17
    • Network connection: Bridged

Robot (Raspberry Pi 4 B):

  • Ubuntu 16.04.7 LTS
    • /rosdistro: kinetic
    • /rosversion: 1.12.17

Thanks, Kiwi

edit retag flag offensive close merge delete


Since you don't mention it: you've checked wiki/ROS/NetworkSetup  and  wiki/ROS/Tutorials/MultipleMachines?

gvdhoorn gravatar image gvdhoorn  ( 2021-08-20 07:35:00 -0500 )edit

yeah i've run threw this pages.

Kiwi_gamer01 gravatar image Kiwi_gamer01  ( 2021-08-20 07:38:50 -0500 )edit

Ok. So that all worked? Without having to set ROS_IP or ROS_HOSTNAME anywhere? Bi-directional rostopic echo etc?

gvdhoorn gravatar image gvdhoorn  ( 2021-08-20 07:46:52 -0500 )edit

I seems that connected finally because when i look at (rostopic echo /rosout) this comes up(definitive not what the host is showing): (image of /rosout on VM)

Kiwi_gamer01 gravatar image Kiwi_gamer01  ( 2021-08-20 08:23:42 -0500 )edit

Right. So:

  1. do not post screenshots of terminals. It violates the support guidelines and is also unnecessary: it's all text, so just copy-paste it into your original question text as an update (use the edit button/link to edit)
  2. please perform the test as described in the multi-machine terminal (using talker and listener), or run rostopic echo /chatter on the first host and rostopic pub -r1 /chatter std_msgs/String 'ping' on the second. Then switch the roles (ie: pub on the second host, and echo on the first)

Don't use random topics, and be very clear about what you're running where.

Additionally: please update your question with the values of ROS_IP, ROS_HOSTNAME and ROS_MASTER_URI for all involved hosts.

Edit: I'm getting a feeling I understand why things don't work for you, but you should have run into that when doing the test (which you claim ...(more)

gvdhoorn gravatar image gvdhoorn  ( 2021-08-20 08:29:08 -0500 )edit

Ok, no matter which machine I run the pub or echo on, the listener does not receive anything. Also no error is showing up.

Kiwi_gamer01 gravatar image Kiwi_gamer01  ( 2021-08-20 09:06:33 -0500 )edit

I've posted an answer.

You do agree with me that this problem should have shown up if you'd run the tests described on the wiki pages I linked in an earlier comment?

gvdhoorn gravatar image gvdhoorn  ( 2021-08-20 09:14:00 -0500 )edit

Yeah fully

Kiwi_gamer01 gravatar image Kiwi_gamer01  ( 2021-08-20 10:15:22 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2021-08-20 09:13:20 -0500

gvdhoorn gravatar image

In the image you shared earlier we see this:

ros_hostname set to localhost

I expect the fact you set ROS_HOSTNAME to localhost is the cause of your problems.

localhost will resolve to, which is the loopback IP. No host can contact another host on that IP.

If your Pi tries to reach your VM, it will be told it can do that on localhost. But the Pi's localhost is not the VM's localhost. So it tries to connect to itself and that will obviously fail.

I believe the networking and multi-machine tutorials are pretty clear: set that variable only if needed, and if you set it, make sure to set it to a hostname that all involved hosts can resolve.

Unfortunately that was ambiguous, as ping localhost will obviously work on all hosts. It just won't work when trying to connect to remote hosts.

I suggest setting ROS_HOSTNAME to the actual hostname of your machines (so not localhost) and trying again. If that doesn't work, unset ROS_HOSTNAME and set ROS_IP to the IP address of the machines.

edit flag offensive delete link more


It worked, when i unset the HOSTNAME and only used the IP.

Thank you @gvdhoorn

Kiwi_gamer01 gravatar image Kiwi_gamer01  ( 2021-08-20 09:32:21 -0500 )edit

Please make sure you're not using DHCP.

if you are, your IP may change the next time you boot up your Pi or VM and whatever you've configured ROS_IP with could become incorrect. That would again lead to connection problems.

Using DHCP is fine, but then you'd have to make an IP reservation for your two host or use ROS_HOSTNAME and make sure your hostnames can be resolved by all involved hosts.

gvdhoorn gravatar image gvdhoorn  ( 2021-08-20 09:33:35 -0500 )edit

I've already sorted everything out. Thanks

Kiwi_gamer01 gravatar image Kiwi_gamer01  ( 2021-08-20 10:21:00 -0500 )edit

Question Tools

1 follower


Asked: 2021-08-20 07:11:55 -0500

Seen: 380 times

Last updated: Aug 20 '21