rosjava communication exception: org.ros.exception.RosRuntimeException: Connection exception
Hi everyone, I'm new in rosjava. I'am now wrtting a subscriber in rosjava in rosjava node named mynode to "reveive" message type sensor_msgs/JointState from a publisher named /joint_states written in C++. The registering process was ok but there was an exception like the following:
Jul 20, 2012 4:12:50 PM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/mynode] as publisher of [/rosout], [http://auburn:46838/]>
Jul 20, 2012 4:12:50 PM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</mynode, http://127.0.0.1:33391/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Jul 20, 2012 4:12:50 PM org.ros.internal.node.client.Registrar onSubscriberAdded
INFO: Registering subscriber: Subscriber<Topic<TopicIdentifier</joint_states>, TopicDescription<sensor_msgs/JointState, 3066dcd76a6cfaef579bd0f34173e9fd>>>
Jul 20, 2012 4:12:50 PM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Subscribed to [/joint_states], [http://auburn:56996/, http://auburn:41568/]>
Jul 20, 2012 4:12:50 PM org.ros.internal.node.topic.DefaultSubscriber$1 onMasterRegistrationSuccess
INFO: Subscriber registered: Subscriber<Topic<TopicIdentifier</joint_states>, TopicDescription<sensor_msgs/JointState, 3066dcd76a6cfaef579bd0f34173e9fd>>>
Jul 20, 2012 4:13:01 PM org.ros.internal.node.topic.UpdatePublisherRunnable run
SEVERE: org.ros.exception.RosRuntimeException: Connection exception: auburn/194.199.21.22:32880
Jul 20, 2012 4:13:01 PM org.ros.internal.transport.ConnectionTrackingHandler exceptionCaught
SEVERE: Channel exception: java.net.ConnectException: connection timed out
Jul 20, 2012 4:13:11 PM org.ros.internal.node.topic.UpdatePublisherRunnable run
SEVERE: org.ros.exception.RosRuntimeException: Connection exception: auburn/194.199.21.22:46961
Jul 20, 2012 4:13:11 PM org.ros.internal.transport.ConnectionTrackingHandler exceptionCaught
SEVERE: Channel exception: java.net.ConnectException: connection timed out
Jul 20, 2012 4:13:12 PM org.ros.internal.transport.ConnectionTrackingHandler exceptionCaught
**I wonder that why the subscribing process was ok while the message receiving was corrupted by an exception ? In the exception message below i saw an ip 194.199.21.22. This i not my computer ip address. Moreover the rosjava node ran on http://127.0.0.1:port but the roscore and other node in C++ ran on http://auburn:ports (auburn: name of my computer).
Everything was ok if i used a subscriber in C++.**
Thank,
I'm getting the same problem and haven't fixed it yet but I traced it to org.ros.internal.node.topic.UpdatePublisherRunnable.run(UpdatePublisherRunnable.java:73). This line contains "selected.getAddress()" which is returning a bogus address.
The problem occurs when the publisher is written in C++ and the subscriber is written in Java. See: http://pharos.ece.utexas.edu/wiki/index.php/How_to_Publish_and_Subscribe_to_a_Custom_Topic_and_Message_using_ROSJava#Troubleshooting:_Connection_exception
Thank you so much liangfok :D. Your answer are a lot of help. I solved my problem. Yeahhhhhhhhhhh