I think you can do this by using the Master API to retrieve the list of service servers (using getSystemState(..)
) and then filtering that list by looking for all providers of any of the typical Nodelet manager
services (docs).
After you have that list, you could use the same approach as in #q271776 to get their PIDs.
To figure out which nodelets are running in which specific manager
s, you should be able to just ask the node by invoking the list
service and looking at the result.
As in #q271776, the rosgraph
, rosnode
and rosservice
libraries can help, but most of it is XMLRPC, so could be done without any ROS dependency. Invoking the service might be harder without any ROS, but not undoable.
Edit: perhaps the lookupService(..)
could also be used, but I'm not sure whether the documentation for that is correct:
Lookup all provider of a particular service.
this suggests that all provider(s) will be returned, but the return type docs say this:
(code, statusMessage, serviceUrl)
service URL is provides address and port of the service. Fails if there is no provider.
So that implies only a single serviceUrl
will be returned.
Edit: rosservice find <service-type>
does something similar, so you could probably take a look at that.