0
$\begingroup$

Rosanswers logo

Hi all:

I have an issue launching a single talker and listener in two machines. It seems like one of the nodes is launched properly but with the other one (launched in the remote machine) is unable to start due to an error parsing the URI of the host. I tried to find some more information about the error but I have found nothing on the Internet.

This is the log of the roslaunch process: seems like both machines are connected properly and roslaunch tries to execute the listener node in the remote machine after launching the talker node successfully, and then it fails:

    [roslaunch][INFO] 2015-07-02 10:23:40,469: ... successfully launched [talker_java-1]
    [roslaunch][INFO] 2015-07-02 10:23:40,470: launch_nodes: launching remote nodes ...
    [roslaunch][INFO] 2015-07-02 10:23:40,568: [172.16.243.46-0]: launching nodes...
    [roslaunch][ERROR] 2015-07-02 10:23:40,633: error launching on [172.16.243.46-0, uri http://172.16.243.46:44845/]: ERROR: Traceback (most recent call last):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/server.py", line 331, in launch
    succeeded, failed = runner.launch()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/launch.py", line 646, in launch
    self._setup()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/launch.py", line 622, in _setup
    self._launch_master()
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/launch.py", line 386, in _launch_master
    validate_master_launch(m, self.is_core, self.is_rostest)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/launch.py", line 81, in validate_master_launch
    if not rosgraph.network.is_local_address(m.get_host()):
  File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/core.py", line 272, in get_host
    host, _ = rosgraph.network.parse_http_host_and_port(self.uri)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/network.py", line 91, in parse_http_host_and_port
    raise ValueError('not a valid URL')
ValueError: not a valid URL

[roslaunch][ERROR] 2015-07-02 10:23:40,633: Launch of the following nodes most likely failed: beginner_tutorials/listener
[roslaunch][INFO] 2015-07-02 10:23:40,633: ... launch_nodes complete
[more unrelated log lines here after the error...]
[roslaunch.pmon][INFO] 2015-07-02 10:23:47,637: ProcessMonitor exit: killing 172.16.243.46-0
[roslaunch][INFO] 2015-07-02 10:23:47,637: [172.16.243.46-0] killing on exit
[roslaunch.remoteprocess][INFO] 2015-07-02 10:23:47,651: remote[172.16.243.46-0]: closing ssh connection
[roslaunch.remoteprocess][INFO] 2015-07-02 10:23:47,729: remote[172.16.243.46-0]: ssh connection closed
[roslaunch][INFO] 2015-07-02 10:23:48,037: process[talker_java-1]: SIGINT killed with return value 130

This is the .launch file I am trying to test:

<launch>

<machine name="adrian-laptop" address="172.16.243.46" user="adrian" env-loader="rosws/adrian-laptop-envloader.sh"/>
<machine name="ctdesks50" address="172.16.243.5" user="adrian.gonzalez" />

<node pkg="rosjava_tutorial" name="talker_java" type="execute" args="com.github.rosjava.rosjava_tutorial.my_pub_sub_tutorial.Talker" machine="ctdesks50"/>
<node pkg="beginner_tutorials" name="listener_C" type="listener" output="screen" machine="adrian-laptop"/>

</launch>

And the env-loader in the remote machine is this one:

#!/bin/bash
export ROS_MASTER_URI=172.16.243.50:11311
export ROS_HOSTNAME=172.16.243.46
exec "$@"

Thank you in advance for your help, Adrian


Originally posted by AdrianGonzalez on ROS Answers with karma: 27 on 2015-07-02

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I guess the problem is you need that you need to use hostnames instead of IP adresses. IP addresses as URI never worked for me.

Try adding hostnames in each computer in the /etc/hosts file if you do not have DNS on your network. And use your hostname for the URIs


Originally posted by cyborg-x1 with karma: 1376 on 2015-07-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by AdrianGonzalez on 2015-07-02:
ok, i have substituted the IP by the hostnames and the result is the same

error launching on [ctdesks46-0, uri http://ctdesks46:52649/]
[...]
File "/opt/ros/indigo/lib/python2.7/dist-packages/rosgraph/network.py", line 91, in parse_http_host_and_port       

I can't see anything weird

Comment by cyborg-x1 on 2015-07-02:
A problem in parse_http_host_and_port ... How does your ROS Master URI look like (env-loader scripts and localhost) http://YourMasterMachine:11311 ?

Comment by AdrianGonzalez on 2015-07-02:
good point! All logs (as you see) show the http:// but it was not present in ROS_MASTER_URI. Correcting that made the trick. Thank you!

Comment by cyborg-x1 on 2015-07-02:
You're welcome

$\endgroup$

Your Answer

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