ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

rosjava subscriber unreliable

asked 2012-01-12 12:16:09 -0600

ahendrix gravatar image

updated 2014-01-28 17:11:07 -0600

ngrennan gravatar image

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:

  1. My code
  2. IP selection in, although I think I've corrected this. See: for more details.
  3. 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) {
   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));
edit retag flag offensive close merge delete


I've updated rosjava_core, rosjava_android, and appmanandroid to head (as of about 10am PST), and I'm still seeing the same problem.
ahendrix gravatar image ahendrix  ( 2012-01-13 09:19:26 -0600 )edit
I cleaned and rebuilt everything (rm -rf ~/.ros/rosjava ~/.m2) and can no longer reproduce this. I guess it's fixed?
ahendrix gravatar image ahendrix  ( 2012-01-13 11:50:30 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-01-12 18:49:10 -0600

damonkohler gravatar image

This doesn't appear to be a problem at head. It's possible there is a bug in the currently released version of rosjava. I've added a regression test which you can see here:

edit flag offensive delete link more


Nice! It's always good to see more regression tests. Sadly, in my case the master and the publisher are running on a separate machine (the PR2) from the subscriber. Could this make a difference?
ahendrix gravatar image ahendrix  ( 2012-01-13 11:27:38 -0600 )edit
I suppose it's possible, but it shouldn't matter. All those tests are integration style and use the network interface.
damonkohler gravatar image damonkohler  ( 2012-01-14 03:57:36 -0600 )edit

Question Tools


Asked: 2012-01-12 12:16:09 -0600

Seen: 558 times

Last updated: Jan 12 '12