Rosjava ConnectException Eclipse without installing ROS
I'm running rosjava on Eclipse on a Mac without installing ROS, but just pulling in rosjava_core in my build.gradle, thinking this is possible after reading this tutorial http://wiki.ros.org/rosjava/Tutorials... . I create a RosTest class with a main method that just calls RosRun.main("ros.Talker"). Talker has code from the rosjava tutorial to publish Hello World every second. When Talker tries to instantiate a publisher or publish a message, not sure which, I get a ConnectException trying to connect to some socket. Any help is appreciated. I'm trying to avoid having to work on Linux and installing ROS, but since the code will eventually end up on a Raspberry Pi, it's not out of the picture. I would just love to believe that rosjava can be used like any other library without installing ros or pulling it down from github and running gradlew install.
My Build.gradle
repositories {
maven {
url "https://github.com/rosjava/rosjava_mvn_repo/raw/master"
}
}
dependencies {
compile 'org.ros.rosjava_core:rosjava:[0.2,0.3)'
compile 'org.ros.rosjava_messages:geometry_msgs:[1.11,1.12)' }
My Error Log
Oct 12, 2016 10:05:56 PM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationFailure
INFO: Publisher registration failed: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</Talker, http://127.0.0.1:57539/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Oct 12, 2016 10:06:01 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
Oct 12, 2016 10:06:01 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Oct 12, 2016 10:06:01 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
Oct 12, 2016 10:06:01 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Oct 12, 2016 10:06:01 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: I/O exception (java.net.ConnectException) caught when processing request: Connection refused
Oct 12, 2016 10:06:01 PM org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
INFO: Retrying request
Oct 12, 2016 10:06:01 PM org.ros.internal.node.client.Registrar callMaster
SEVERE: Exception caught while communicating with master.
java.lang.RuntimeException: java.net.ConnectException: Connection refused
at org.ros.internal.node.xmlrpc.XmlRpcClientFactory$1.invoke(XmlRpcClientFactory.java:157)
at com.sun.proxy.$Proxy0.registerPublisher(Unknown Source)
at org.ros.internal.node.client.MasterClient.registerPublisher(MasterClient.java:144)
at org.ros.internal.node.client.Registrar$1$1.call(Registrar.java:138)
at org.ros.internal.node.client.Registrar$1$1.call(Registrar.java:135)
at org.ros.internal.node.client.Registrar.callMaster(Registrar.java:111)
at org.ros.internal.node.client.Registrar.access$100(Registrar.java:51)
at org.ros.internal.node.client.Registrar$1.call(Registrar.java:135)
at org.ros.internal.node.client.Registrar$1.call(Registrar.java:132)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter ...