Get dynamic reconfigure caller name
Hello,
I have some nodes which are reconfigurable using dynamic reconfigure. Some times some other node changes the parameters (and the behavior of the sensor which is dynamic reconfigurable) when it is not supposed to do so. Since the dynamic reconfigure calls are not saved in the rosbag I have no clue on who called the reconfiguration. Is there any way in the dynamic reconfigure callback that I can get the name of who called with the new parameters so I can print a ROSINFO and get it in the logs? I know that a first solution would be to do the ROSINFO where you call the dynamic reconfiguration, but some of this nodes are not programmed by me, so I need this in the dynamic reconfigure callback to be able to control it. For instance if instead of a dynamic reconfigure it is a normal service (the example is for the add two ints of the service tutorial) I do:
bool SomeClass::servicehandle(rospytutorials::AddTwoInts::Request &req, rospytutorials::AddTwoInts::Response &res) { std::string caller = (*req.connectionheader)["callerid"]; ROSINFO("%s: servicehandle called from %s with req = (%d, %d)", name.cstr(), caller.cstr(), staticcast(req.a), static_cast (req.b)); // rest of code ....
Thank you!
Asked by apalomer on 2015-07-13 03:00:38 UTC
Comments