ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

roslaunch python api access node class

asked 2021-03-02 04:49:19 -0500

joao.aguizo gravatar image

updated 2021-03-03 12:51:57 -0500

Hello, I have been trying to use the roslaunch python API ( to instantiate a node and launch it. My question is, is it possible to access the node to be dispatched variables using this API? I tried applying this example to my use-case but without any success:

import roslaunch

package = 'rqt_gui'

executable = 'rqt_gui'

node = roslaunch.core.Node(package, executable)

launch = roslaunch.scriptapi.ROSLaunch()


process = launch.launch(node)

print process.is_alive()



EDIT: Is there any way of getting the launched node name? That would work as well for my use-case.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2021-03-03 12:52:51 -0500

joao.aguizo gravatar image

updated 2021-03-29 18:31:32 -0500

jayess gravatar image

Found out that in the "process" variable you can access the name of the node in the name property.

process = launch.launch(node)

It does not answer the original question, but it works well enough for my use-case, just needed the node name, which is anonymous, in order to subscribe to an output topic generated by that same node.

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: 2021-03-02 04:49:19 -0500

Seen: 132 times

Last updated: Mar 29 '21