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

Running rosjava Node

asked 2011-09-19 04:49:41 -0500

vbare gravatar image

updated 2011-09-19 12:16:22 -0500

tfoote gravatar image

I am using the pure java based rosjava not the JNI. To install rosjava I did:

hg clone https://rosjava.googlecode.com/hg/ rosjava_core

then

rosmake rosjava

I tried running an example rosjava Node by typing:

rosrun rosjava_bootstrap run.py rosjava ParameterServerTestNode

based on the info that

rosrun rosjava_bootstrap run.py < pkg > < node_class > [args ... ]

I get:

Buildfile: /home/tori/ros_workspace/rosjava_core/rosjava/dependencies.xml

get-dependencies:

BUILD SUCCESSFUL
Total time: 1 second
Executing command: ['java', '-classpath', u'/home/tori/ros_workspace/rosjava_core/rosjava/target/org.ros.rosjava-0.0.0.jar:/home/tori/.ros/rosjava/lib/org.ros.rosjava.test_ros-0.0.0.jar:/home/tori/.ros/rosjava/lib/org.ros.rosjava.roscpp-0.0.0.jar:/home/tori/ros_workspace/rosjava_core/apache_xmlrpc/target/org.ros.rosjava.apache-xmlrpc-3.1.3.jar:/home/tori/ros_workspace/rosjava_core/rosjava_bootstrap/target/org.ros.rosjava.rosjava_bootstrap-0.0.0.jar:/home/tori/.ros/rosjava/lib/org.ros.rosjava.std_msgs-0.0.0.jar:/home/tori/.ros/rosjava/lib/org.ros.rosjava.rosgraph_msgs-0.0.0.jar:/home/tori/ros_workspace/rosjava_core/apache_commons_util/target/org.ros.rosjava.ws-commons-util-1.0.2.jar:/home/tori/.m2/repository/com/google/guava/org.ros.rosjava.guava/r07/org.ros.rosjava.guava-r07.jar:/home/tori/.m2/repository/dnsjava/org.ros.rosjava.dnsjava/2.1.1/org.ros.rosjava.dnsjava-2.1.1.jar:/home/tori/.m2/repository/org/apache/commons/com.springsource.org.apache.commons.codec/1.3.0/com.springsource.org.apache.commons.codec-1.3.0.jar:/home/tori/.m2/repository/org/apache/commons/com.springsource.org.apache.commons.httpclient/3.1.0/com.springsource.org.apache.commons.httpclient-3.1.0.jar:/home/tori/.m2/repository/org/apache/commons/com.springsource.org.apache.commons.logging/1.1.1/com.springsource.org.apache.commons.logging-1.1.1.jar:/home/tori/.m2/repository/org/jboss/netty/netty/3.2.4.Final/netty-3.2.4.Final.jar', 'org.ros.RosRun', 'ParameterServerTestNode']
Loading node class: ParameterServerTestNode
Unable to locate node: ParameterServerTestNode

I went through the tutorial here

http://www.ros.org/wiki/rosjava/Build

and used the source from the rosjava_tutorial_pubsub (the rosjava publish subscribe tutorial)

and again was unsure as to how to run, for example, Listener.class.

Any help as to how to run a rosjava Node would be greatly appreciated.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2011-09-20 01:46:28 -0500

damonkohler gravatar image

The following should run Listener from the pubsub tutorial:

rosrun rosjava_bootstrap run.py rosjava_tutorial_pubsub org.ros.tutorials.pubsub.Listener

You need to use the full class name.

edit flag offensive delete link more
0

answered 2011-09-25 13:09:25 -0500

jonjake gravatar image

I am having a similar problem to this but the next step. I had the pubsub Listener code working eariler today and now it does not.

When I execute rosrun rosjava_bootstrap run.py rosjava_tutorial_pubsub org.ros.tutorials.pubsub.Listener the node appears to start fine.

When I try rostopic pub -1 /chatter std_msgs/String Hello a RosRuntimeException: java.net.ConnectException is thrown.

Is there something obvious here I am doing wrong? Any ideas?

edit flag offensive delete link more

Comments

Are you using the rosjava version of roscore? Could you provide the complete stack trace please?
damonkohler gravatar image damonkohler  ( 2011-09-25 17:56:54 -0500 )edit
0

answered 2011-09-26 06:56:14 -0500

jonjake gravatar image

I am using the standard roscore. Here is the stack trace. It works intermittently and I cannot tell why.

roscore

rosrun rosjava_bootstrap run.py rosjava_tutorial_pubsub org.ros.tutorials.pubsub.Listener

rostopic pub -1 /chatter std_msgs/String 'its working now'

... Loading node class: org.ros.tutorials.pubsub.Listener Sep 26, 2011 2:49:45 PM org.ros.internal.node.topic.UpdatePublisherRunnable run SEVERE: org.ros.exception.RosRuntimeException: java.net.ConnectException: connection timed out Sep 26, 2011 2:49:45 PM org.jboss.netty.channel.DefaultChannelPipeline WARNING: An exception was thrown by a user handler while handling an exception event ([id: 0x0064c34e] EXCEPTION: java.net.ConnectException: connection timed out) org.ros.exception.RosRuntimeException: java.net.ConnectException: connection timed out at org.ros.internal.transport.ConnectionTrackingHandler.exceptionCaught(ConnectionTrackingHandler.java:63) at org.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:432) at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:375) at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.run(NioClientSocketPipelineSink.java:283) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:636) Caused by: java.net.ConnectException: connection timed out at org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink$Boss.processConnectTimeout(NioClientSocketPipelineSink.java:371) ... 4 more

edit flag offensive delete link more

Comments

I have been playing with this a little bit more and determined the following: running both pieces of the pubsub example, Listener then Talker works correctly everytime. When I try running the Listener end and the using ros command line to publish to the node, like above, it rarely works and ends with the indicated exception. Hopefully this helps clarify the source of the problem a little more.
jonjake gravatar image jonjake  ( 2011-09-26 09:30:49 -0500 )edit

Question Tools

Stats

Asked: 2011-09-19 04:49:41 -0500

Seen: 1,030 times

Last updated: Sep 26 '11