0
$\begingroup$

Rosanswers logo

Hello everyone,

I have the following setup:

  • The main thread which starts a ROS node with services, pubs, and subs
  • A multiprocessing.Process which also should start an (anonymous) ROS node that has pubs and subs

So far so good. When I start (fork) the new process before calling rospy.init_node, everything works fine when I start from the command line.

However, when I start the application via roslaunch, I get the following error:

shutdown request: new node registered with same name

It looks like roslaunch/node enforces a new name in every node started as a subprocess. Any ideas how to circumvent the problem?


Originally posted by machinekoder on ROS Answers with karma: 69 on 2018-07-19

Post score: 1


Original comments

Comment by machinekoder on 2018-07-19:
I found the culprit: https://github.com/strawlab/ros_comm/blob/master/clients/rospy/src/rospy/client.py#L223 Looks like the name mappings override even anonymous nodes.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I found a workaround:

try:
    del rospy.names.get_mappings()['__name']
except KeyError:
    pass

However, I would prefer if rospy would have an option to force anonymity.


Originally posted by machinekoder with karma: 69 on 2018-07-19

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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