Retrieve package and binary/script of running ROS node [closed]

asked 2020-08-05 10:12:15 -0500

dcconner gravatar image

updated 2020-08-06 04:44:25 -0500

gvdhoorn gravatar image

rosgraph and other tools in ros_comm provide access to much data, but there are two pieces of data I cannot figure out how to access.

In https://github.com/ros/ros_comm/blob/... , roslaunch defines a Node object that has the package name and the source file of node stored as attributes

questions:

  1. Does "roscore" store this information in a centralized place, or is this only used for start up?
  2. Is the same information available for nodes started with "rosrun"
  3. How can I query this information using the remote tools (e.g. XMLRPC via rosgraph)
  4. Given a running ros deployment, is there any way to find out what package and file a running node is from?
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by gvdhoorn
close date 2020-08-07 02:13:59.633146

Comments

Just a comment, as I'm not 100% sure it's all correct:

  1. no
  2. no
  3. you can't
  4. no, not that I know of (or at least, not authoritatively. You could use the Slave API, ask for the PID of the process, and then use something like ps -p $PID_OF_ROS_NODE -o args and process that. But that's not really an answer I feel. #q271777 and #q271776 show how to use these APIs with Python)

And by this:

and the source file of node

I guess you mean the binary or the script? The source (for compiled languages) would be useless, as it typically cannot be executed directly.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-06 04:22:24 -0500 )edit

If your last question is actually what you're after, I believe your question is a duplicate of #q162251.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-06 04:33:56 -0500 )edit

@gvdhoorn Thank you for reply. These were the answers I expected based on my research, but wanted to make sure I didn't miss something. Your linked questions were helpful.

dcconner gravatar image dcconner  ( 2020-08-06 19:56:55 -0500 )edit

Assuming #q162251 answers this, I'm closing your question as a duplicate.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-07 02:14:23 -0500 )edit