Ask Your Question

Roslaunch API refusing connection

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

RayBor gravatar image


I'm having trouble using the roslaunch python api in my scripts, which is quite boring. According to I should be able to use roslaunch in python script, but I'm always having this error :

Traceback (most recent call last):
  File "", line 9, in <module>
    launch = roslaunch.scriptapi.ROSLaunch()
  File "/opt/ros/hydro/lib/python2.7/dist-packages/roslaunch/", line 61, in __init__
    uuid = master.getParam('/run_id')
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rosgraph/", line 206, in getParam
    return self._succeed(self.handle.getParam(self.caller_id, key))
  File "/usr/lib/python2.7/", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/", line 1578, in __request
  File "/usr/lib/python2.7/", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/", line 1292, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/", line 1439, in send_content
  File "/usr/lib/python2.7/", line 954, in endheaders
  File "/usr/lib/python2.7/", line 814, in _send_output
  File "/usr/lib/python2.7/", line 776, in send
  File "/usr/lib/python2.7/", line 757, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/", 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 ?



edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 1,359 times

Last updated: Oct 29 '14