How to find a node type during runtime
I'd like to be able to find a node type (not user-defined name) of a currently running node. Basically, what file was actually being executed.
"Nodes also have a node type, that simplifies the process of referring to a node executable on the fileystem." -Wiki
This is relatively easy if the node is launched from a roslaunch command, I can simply look at the logging. From a rosrun command, I can't seem to find equivalent logging. Watching the loggers are a bit of a hack, and I'm sure there is a proper API to do this, but I can't seem to find it. Rosnode gets close.
The ideal solution is to use a getter to access elements of the Node class, a part of the roslaunch.core package. If this is not possible, is there a work-around?
A bit of background: we're trying to automatically record which nodes are being run. We've instrumented roslaunch (minimally) to do this, but we're looking for a similarly minimal way to do this with rosrun.
A related thought: what are the ramifications of rewriting rosrun to use the roslaunch machinery, rather than just exec'ing the node (other then automatically starting up a core if one isn't already running)?