Ask Your Question

Revision history [back]

Hi,

I did never use rosjava but by looking at the code I noticed two things:

1) If the topic is odom, you probably don't need that "/" prefix. (but this should not be the issue here) 2) I believe the second argument for newSubscriber is a Message type and not a String. Try using nav_msgs.Odometry (note: the type, not the string! so remove the "")

Cheers Felix

Hi,

I did never use rosjava but by looking at the code I noticed two things:

1) If the topic is odom, you probably don't need that "/" prefix. (but this should not be the issue here) 2) I believe Try using nav_msgs.Odometry._TYPE as the second argument message type for newSubscriber is a Message type and not a String. Try using nav_msgs.Odometry (note: the type, not the string! so remove the "")""). The documentation says it should accept a String, but the example you posted works with std_msgs.String._TYPE as well.

Cheers Felix

Hi,

I did never use rosjava but by looking at the code I noticed two things:

1) If the topic is odom, you probably don't need that "/" prefix. (but this should not be the issue here) here)

2) Try using nav_msgs.Odometry._TYPE as the message type for newSubscriber (note: the type, not the string! so remove the ""). The documentation says it should accept a String, but the example you posted works with std_msgs.String._TYPE as well.

If that does not help, it looks like someone else has similar problems (or even the same?): http://code.google.com/p/rosjava/issues/detail?id=121

Cheers Felix