How to get publisher info from a message?
Can anyone tell me if it's possible to get publisher information in the callback of a particular message?
For the system I'm trying to setup, I've implemented a node that publishes odometry messages (type: nav_msgs/Odometry) and am using a launch file to start multiple instances of this node, under different name spaces. Another node type (call it the coordinator node) will listen for the odometry messages from the multiple publishers. The point of the coordinator node is that it will coordinate the movement of multiple robots based on their reported locations. I'm new to ROS, so I've started by implementing my nodes using the basic templates shown in the tutorials, but I'm now realizing that the example callback method doesn't allow for identifying which particular node broadcasted a given message.
For now, I'm programming in Java and using the client_rosjava_jni library. I was hoping there would be another callback class that would include the publisher info, along with the published message, but I'm not seeing that option, at least in the JNI wrappers. I can imagine getting around this by making my first node type publish a custom message type that includes the pedigree information along with the basic odometry message type, but it seems like this should already be available in the core system. Does anyone know if that's true? Am I not seeing this option because I'm using the JNI wrappers?
Thanks in advance for any help-suggestions.
Hung
Thanks for the two suggestions, tfoote. I haven't had any success getting the remapping feature working, so that may be another short-coming of the Java JNI wrappers I'm using. Been thinking about switching to the full Java core implementation and it looks like it's time. Appreciate your help with both of my recent questions. :)