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

Problem communicating between computers using rosjava

asked 2011-11-04 10:06:18 -0500

Joe gravatar image

updated 2011-11-07 06:53:47 -0500

kwc gravatar image

EDIT: I apologize for not providing more information earlier. Here is what we have so far:

Both computers are running Ubuntu 11.04 32bit with ROS Electric and the latest rosjava. We installed ROS using the sudo apt-get install instructions listed in the tutorials, and rosjava with the mercurial instructions listed in its tutorial.

When running the basic pubsub tutorial on a single computer, everything works as is expected. The result of rosnode list -a is :

oryx@oryx-client:~$ rosnode list -a
http://127.0.0.1:52560 /listener
http://oryx-client:54630/ /rosout
http://127.0.0.1:34734 /talker

The trouble occurs when I try to run the pubsub tutorial across multiple computers. I run through the normal checklist of adding the appropriate ip addresses to each computers hostlist. On both the client (oryx-client) and the server (oryx-server) I export ROS_MASTER_URI to http://oryx-client:11311.

To test it, I ran the python pubsub tutorial between the two computers. Everything worked as expected. When I try to run the rosjava pub sub tutorials, the listener on oryx-client crashes, returning the error:

Loading node class: org.ros.tutorials.pubsub.Listener
Nov 7, 2011 1:25:19 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
Nov 7, 2011 1:25:19 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Nov 7, 2011 1:25:19 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
Nov 7, 2011 1:25:19 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Nov 7, 2011 1:25:19 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
Nov 7, 2011 1:25:19 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Nov 7, 2011 1:25:19 PM org.ros.internal.node.topic.UpdatePublisherRunnable run
SEVERE: java.lang.RuntimeException: java.net.ConnectException: Connection refused

Running a rosnode list -a, as suggested, yields :

http://127.0.0.1:40997 /listener
http://oryx-client:51694/ /rosout
http://127.0.0.1:39597 /talker

Running roswtf returns with:

Loaded plugin tf.tfwtf
No package or stack in context
Static checks summary:
No errors or warnings
Beginning tests of your ROS graph. These may take awhile...
analyzing graph...
... done analyzing graph
running graph rules...
ERROR: connection refused to [http://127.0.0.1:39597]
... done running graph rules

Online checks summary:

Found 2 warning(s).
Warnings are things that may be just fine, but are sometimes at fault

WARNING Node [/listener] is not connected to anything
WARNING The following nodes are unexpectedly connected:
* unknown (http://127.0.0.1:40997/)->/rosout (/rosout)

Found 3 error(s).

ERROR Communication with [/talker] raised an error:
ERROR Could not contact the following nodes:
* /talker

ERROR The following nodes should be connected but aren't:
* /talker->/listener (/chatter)

Again, it works perfectly fine with the python ... (more)

edit retag flag offensive close merge delete

Comments

Can you update your question (using 'edit') to include the output of "rosnode list -a"? I suspect that your rosjava processes are reporting a different network address, please follow the support guidelines and include information about the versions of what is installed, and how you installed it.
kwc gravatar image kwc  ( 2011-11-05 10:41:00 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-11-07 06:47:33 -0500

Ben_S gravatar image

Hi Joe, in rosjava you have to explicitly make sure, that the nodes bind to an external address. I dont know if the publisher and subscriber in the tutorial are getting configured that way.

How to bind a node to an external address is explained here: rosjava Node Tutorial

Another Testcase you could try is running the roscore on Computer A and both the listener and talker on Computer B. If my guess is correct that constellation should work...

edit flag offensive delete link more

Comments

Ben_S is correct. The rosjava client is binding to a local address (127.0.0.1) that cannot be accessed from other computers.
kwc gravatar image kwc  ( 2011-11-07 06:53:18 -0500 )edit

Question Tools

Stats

Asked: 2011-11-04 10:06:18 -0500

Seen: 1,826 times

Last updated: Nov 07 '11