rosjava subscriber unreliable
I have a python node that publishes a latched topic, and a rosjava subscriber running on an android device. If I start the publisher first, the subscriber receives the latched message just fine. If I start the subscriber first, it doesn't receive any messages when I start the publisher.
This could be a problem in one of at least three places:
- My code
- IP selection in ros.android.util.MasterChooser, although I think I've corrected this. See: https://kforge.ros.org/appmanandroid/trac/ticket/26 for more details.
- The publisherUpdate XMR-RPC callback mechanism
I suspect #3, but I'm having a hard time tracing through the rosjava codebase to find the problem.
My subscriber code:
protected void onNodeCreate(Node node) {
super.onNodeCreate();
client_sub = node.newSubscriber("pr2_wifi/client_status",
"pr2_network_management/WifiStatus", new MessageListener<WifiStatus>() {
public void onNewMessage(WifiStatus arg0) {
Log.i("PR2WifiActivity", "Got client state. SSID: " + arg0.ssid);
Handler.sendMessage(mHandler.obtainMessage(CLIENT_MSG, arg0));
}
}
);
}