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

Roslaunch API refusing connection

asked 2014-10-29 03:54:33 -0500

RayBor gravatar image

Hi,

I'm having trouble using the roslaunch python api in my scripts, which is quite boring. According to http://wiki.ros.org/roslaunch/API%20U... I should be able to use roslaunch in python script, but I'm always having this error :

Traceback (most recent call last):
  File "roslaunchtest.py", line 9, in <module>
    launch = roslaunch.scriptapi.ROSLaunch()
  File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/scriptapi.py", line 61, in __init__
    uuid = master.getParam('/run_id')
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rosgraph/masterapi.py", line 206, in getParam
    return self._succeed(self.handle.getParam(self.caller_id, key))
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1439, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 111] Connection refused

Is it normal that the simplest code isn't working ? Or am I doing something wrong ? I'd like to find a solution for that, since I need to launch a few files, like the turtlebot minimal, 3d sensors, and autodocking script. If it's not possible in this way, is there a workaround ?

Thanks

Ray

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-10-29 04:17:23 -0500

ahendrix gravatar image

I get the same error if the /run_id parameter isn't set, or if a roscore isn't already running.

I suspect the roslaunch API isn't able to start a roscore if one isn't already running. You may want to try your experiment again, with a roscore running.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-10-29 03:54:33 -0500

Seen: 1,694 times

Last updated: Oct 29 '14