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

Revision history [back]

The message means that the Rosjava publisher is trying to publish a message to a topic on which the C++ listener already listens, but the publisher's message type doesn't match the subscriber's message type. This can have two reasons:

  1. Publisher and subscriber use different message types (e.g., one uses std_msgs/String and the other std_msgs/Int8).

  2. Both use the same message type, but were built with different versions of it.

To debug (1), you can do the following:

  • start a new roscore (!)
  • start the subscriber
  • do a rosnode info on the subscriber
  • repeat the same for the publisher (after restarting the roscore) and see whether subscription and publication match up

To debug (2), you can

  • make sure that your ROS_PACKAGE_PATH and ROS_ROOT are set up correctly
  • rebuild your message package, if you are using custom messages
  • rebuild your subscriber and your publisher (that way you know that both used the same environment variables when they were build)

I don't have any experience with the newest rosjava build system using gradle, but before the switch to gradle, it usually also helped to do the following, then rebuild the rosjava nodes:

rm -rf ~/.m2/ ~/.ros/rosjava/
(cd $(rosstack find rosjava_core) && hg clean --all)