User Tools

Site Tools


rosjava

Installing and using rosjava

rosjava is a collection of tools that provide java bindings to the Robotic Operating System (ROS). This article will describe how I got rosjava working for my ROS Ubuntu installation. Note that I assume you will already have ROS installed to your Ubuntu system (even though it isn't completely necessary).

Note: I was a bit confused initially when going through the online documentation as each time I connected to the source (github) repository I found an empty source tree. I then noticed that the links from the ROS documentation project to github link to the “readme” branch of the source tree which is void of anything other than a “Readme” file. You will always need to switch to the branch appropriate for your ROS distribution. For me, this was the indigo branch. So I selected the branch from the top and selected the indigo branch (the latest branch – note I compiled these packages for use with jade without any issue) to get the source appropriate for my ROS distro.

Ok. Now for installing things, I needed to install all of the basic rosjava packages. These packages depend heavily on java (of course) and the build tool gradle. Hence, you should install gradle if you don't already have it using the commmands below:

bash$ sudo apt-get install gradle

Once installed create a ROSJava folder and populate it with the needed packages. For me, I did the following:

bash$ mkdir ROSJava
bash$ cd ROSJava
bash$ mkdir ros_ws
bash$ cd ros_ws
bash$ wstool init src

This should create a basic ROS workspace (“ros_ws”) with a package folder holding source files in the “src” subfolder of the “ros_ws” folder.

I then downloaded all the needed rosjava packages for a basic rosjava install.

bash$ cd src
bash$ git clone -b indigo https://github.com/rosjava/rosjava_build_tools.git
bash$ git clone -b indigo https://github.com/rosjava/rosjava_core.git 
bash$ git clone -b indigo https://github.com/rosjava/rosjava_test_msgs.git
bash$ git clone -b indigo https://github.com/rosjava/genjava.git
bash$ git clone -b indigo https://github.com/rosjava/rosjava_messages.git

I then compiled all these packages until using catkin_make until the build completed successfully.

Then I wanted to build my own rosjava node, i.e., create a ROS node using Java.

I did this using the scripts in the compiled rosjava_build_tools folder. Specifically, the “catkin_create_rosjava_pkg” script.

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src$ source /opt/ros/jade/setup.bash
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src$ source ../devel/setup.bash
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src$ rosjava_build_tools/scripts/catkin_create_rosjava_pkg rosjava_reef
Created repo file: /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/settings.gradle
Created repo file: /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/build.gradle
Created repo file: /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/CMakeLists.txt
Created repo file: /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/package.xml
Creating gradle wrapper: /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_build_tools/src/rosjava_build_tools/gradle/gradlew -p /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef wrapper
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
:wrapper

BUILD SUCCESSFUL

Total time: 5.161 secs

I now create a project inside my package.

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src$ cd rosjava_reef
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef$ source ../../devel/setup.bash 
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef$ ../rosjava_build_tools/scripts/catkin_create_rosjava_project test_java

Creating rosjava project 
  Name      : test_java
  File      : build.gradle
  File      : settings.gradle
  File      : Talker.java
  File      : Listener.java
  File      : CMakeLists.txt (gradle task update)
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef$ ls

The project is populated with two java files when created (Talker.java, Listener.java). Hence, I wanted to build these files. There seems to be several ways to build the project. I first tried to use catkin_make but it did not work. Afterwards I found this web page: http://wiki.ros.org/rosjava_build_tools/Tutorials/hydro/Building%20RosJava%20Libraries I decided to use the local build command “../gradlew” which is shown below. Note: I did eventually get catkin_make to work with the project as well. Also, the command “../gradlew build” would have built the code.

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef$ cd test_java/
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/test_java$ ../gradlew publishMavenJavaPublicationToMavenRepository
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
:test_java:generatePomFileForMavenJavaPublication
:test_java:compileJava UP-TO-DATE
:test_java:processResources UP-TO-DATE
:test_java:classes UP-TO-DATE
:test_java:jar UP-TO-DATE
:test_java:publishMavenJavaPublicationToMavenRepository
Uploading: com/github/rosjava/rosjava_reef/test_java/0.1.0/test_java-0.1.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 4K from remote
Uploaded 4K

BUILD SUCCESSFUL

Total time: 5.373 secs

I then built the binaries of the sub-project using gradlew. I believe one could also issue the “./gradlew installApp” command to get a similar result.

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws$ source /opt/ros/jade/setup.bash 
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws$ source devel/setup.bash 
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws$ roscd rosjava_reef/
arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef$ ./gradlew install
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
:test_java:compileJava UP-TO-DATE
:test_java:processResources UP-TO-DATE
:test_java:classes UP-TO-DATE
:test_java:jar UP-TO-DATE
:test_java:install

BUILD SUCCESSFUL

Total time: 5.444 secs
bash$ 

I verified that the nodes would run from the command line. I did this with the following commands:

  * Run roscore  
  * Run the Talker node
  * Run the Listener node

Run roscore:
<code>
bash$ source /opt/ros/jade/setup.bash; roscore

Run the Talker node

~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/test_java$ ./build/install/test_java/bin/test_java com.github.rosjava.rosjava_reef.test_java.Talker
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Loading node class: com.github.rosjava.rosjava_reef.test_java.Talker
Sep 19, 2015 1:56:38 AM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://localhost:11311/
Sep 19, 2015 1:56:39 AM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</rosjava/talker, http://127.0.0.1:52404/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:56:39 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/rosjava/talker] as publisher of [/rosout], [http://Willis-Lenovo-pc:37354/]>
Sep 19, 2015 1:56:39 AM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</rosjava/talker, http://127.0.0.1:52404/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:56:39 AM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</rosjava/talker, http://127.0.0.1:52404/>, TopicIdentifier</chatter>>, Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>>
Sep 19, 2015 1:56:39 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/rosjava/talker] as publisher of [/chatter], [http://127.0.0.1:59801/]>
Sep 19, 2015 1:56:39 AM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</rosjava/talker, http://127.0.0.1:52404/>, TopicIdentifier</chatter>>, Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>>

Run the Listener node

~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/test_java$ ./build/install/test_java/bin/test_java com.github.rosjava.rosjava_reef.test_java.Listener
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Loading node class: com.github.rosjava.rosjava_reef.test_java.Listener
Sep 19, 2015 1:52:13 AM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://localhost:11311
Sep 19, 2015 1:52:13 AM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</rosjava/listener, http://127.0.0.1:59801/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:52:13 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/rosjava/listener] as publisher of [/rosout], [http://Willis-Lenovo-pc:37354/]>
Sep 19, 2015 1:52:13 AM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</rosjava/listener, http://127.0.0.1:59801/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:52:13 AM org.ros.internal.node.client.Registrar onSubscriberAdded
INFO: Registering subscriber: Subscriber<Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>
Sep 19, 2015 1:52:13 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Subscribed to [/chatter], []>
Sep 19, 2015 1:52:13 AM org.ros.internal.node.topic.DefaultSubscriber$1 onMasterRegistrationSuccess
INFO: Subscriber registered: Subscriber<Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>
Sep 19, 2015 1:56:40 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 1"
Sep 19, 2015 1:56:41 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 2"
Sep 19, 2015 1:56:42 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 3"
Sep 19, 2015 1:56:43 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 4"
Sep 19, 2015 1:56:44 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 5"
Sep 19, 2015 1:56:45 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 6"
Sep 19, 2015 1:56:46 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 7"
Sep 19, 2015 1:56:47 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 8"
Sep 19, 2015 1:56:48 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 9"
Sep 19, 2015 1:56:49 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 10"
Sep 19, 2015 1:56:50 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 11"
Sep 19, 2015 1:56:51 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 12"
Sep 19, 2015 1:56:52 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 13"

Great! Now I would like all these things to run from a standard ROS launch file. To accomplish this, an additional target had to be added to the build.gradle files per the post here: http://answers.ros.org/question/145461/can-i-roslaunch-a-rosjava-node/

I added this stanza to my build.gradle file in my “test_java” project, i.e., I modified the build.gradle file in the test_java folder to have the contents shown below:

/* This plugin is necessary for creating installApp tasks (i.e. executables) */
apply plugin: 'application'
mainClassName = 'org.ros.RosRun'

/* 
 Dependencies can be on external maven artifacts (such as rosjava_core
 here) or on sibling subprojects. Fpr external maven artifact dependencies
 it's convenient to use an open ranged dependency, but restrict it to
 cover the patch version only to avoid breakages due to api changes
 which usually occur on minor and major version numbers.
*/

dependencies {
  /* An external maven artifact dependency */
  compile 'org.ros.rosjava_core:rosjava:[0.2,0.3)'
  /* Example of a local subproject dependency */ 
  /* compile project(':sibling_gradle_project') */
}

/*
 * Create a deploy task to make an executable named "execute",
 * that can be used from the roslaunch .launch files.
 * To run this from this directory, do:
 * ../gradlew deployApp
 *
 * see: https://code.google.com/p/rosjava/issues/detail?id=140
 */
task deployApp(dependsOn: 'installApp') << {
  File binDir = new File(project.projectDir, '/bin')
  if (! binDir.isDirectory()) {
    println "Creating $binDir directory"
    binDir.mkdirs()
  }
  File link = new File(binDir,"execute")
  File target = new File(project.projectDir, "build/install/$project.name/bin/$project.name")
  println "Creating symlink from $link.absolutePath to $target.absolutePath"
  ant.symlink(link: link.absolutePath, resource: target.absolutePath, overwrite: true)
}

I then ran the new target to create the “execute” binary needed by roslaunch to run my nodes.

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef$ ./gradlew deployApp
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
:test_java:compileJava UP-TO-DATE
:test_java:processResources UP-TO-DATE
:test_java:classes UP-TO-DATE
:test_java:jar UP-TO-DATE
:test_java:startScripts UP-TO-DATE
:test_java:installApp UP-TO-DATE
:test_java:deployApp
Creating symlink from /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/test_java/bin/execute to /home/arwillis/NetBeansProjects/ROSJava/ros_ws/src/rosjava_reef/test_java/build/install/test_java/bin/test_java

BUILD SUCCESSFUL

Total time: 7.0 secs

I then created a launch file “test_java.launch” with the contents shown below:

<?xml version="1.0" encoding="UTF-8"?>
<launch>
<node pkg="rosjava_reef" type="execute" 
      name="test_java_talker" args="com.github.rosjava.rosjava_reef.test_java.Talker"/>
<node pkg="rosjava_reef" type="execute" 
      name="test_java_listener" args="com.github.rosjava.rosjava_reef.test_java.Listener"/>
</launch>

I can then run my nodes using roslaunch! I show my console session below:

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava$ roslaunch rosjava_reef test_java.launch                                                                           
... logging to /home/arwillis/.ros/log/847f102a-5e95-11e5-9eb7-2c337af163fd/roslaunch-Willis-Lenovo-pc-32723.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://Willis-Lenovo-pc:55160/

SUMMARY
========

PARAMETERS
 * /rosdistro: jade
 * /rosversion: 1.11.13

NODES
  /
    test_java_listener (rosjava_reef/test_java)
    test_java_talker (rosjava_reef/test_java)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[test_java_talker-1]: started with pid [32741]
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
process[test_java_listener-2]: started with pid [32756]
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://localhost:11311
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar <init>
INFO: MasterXmlRpcEndpoint URI: http://localhost:11311
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</test_java_talker, http://127.0.0.1:58990/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</test_java_listener, http://127.0.0.1:52203/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/test_java_talker] as publisher of [/rosout], [http://Willis-Lenovo-pc:37354/]>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</test_java_talker, http://127.0.0.1:58990/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar onPublisherAdded
INFO: Registering publisher: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</test_java_talker, http://127.0.0.1:58990/>, TopicIdentifier</chatter>>, Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/test_java_talker] as publisher of [/chatter], []>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</test_java_talker, http://127.0.0.1:58990/>, TopicIdentifier</chatter>>, Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Registered [/test_java_listener] as publisher of [/rosout], [http://Willis-Lenovo-pc:37354/]>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.topic.DefaultPublisher$1 onMasterRegistrationSuccess
INFO: Publisher registered: Publisher<PublisherDefinition<PublisherIdentifier<NodeIdentifier</test_java_listener, http://127.0.0.1:52203/>, TopicIdentifier</rosout>>, Topic<TopicIdentifier</rosout>, TopicDescription<rosgraph_msgs/Log, acffd30cd6b6de30f120938c17c593fb>>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar onSubscriberAdded
INFO: Registering subscriber: Subscriber<Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.client.Registrar callMaster
INFO: Response<Success, Subscribed to [/chatter], [http://127.0.0.1:58990/]>
Sep 19, 2015 1:46:35 AM org.ros.internal.node.topic.DefaultSubscriber$1 onMasterRegistrationSuccess
INFO: Subscriber registered: Subscriber<Topic<TopicIdentifier</chatter>, TopicDescription<std_msgs/String, 992ce8a1687cec8c8bd883ec73ca41d1>>>
Sep 19, 2015 1:46:36 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 1"
Sep 19, 2015 1:46:37 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 2"
Sep 19, 2015 1:46:38 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 3"
Sep 19, 2015 1:46:39 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 4"
Sep 19, 2015 1:46:40 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 5"
Sep 19, 2015 1:46:41 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 6"
Sep 19, 2015 1:46:42 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 7"
Sep 19, 2015 1:46:43 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 8"
Sep 19, 2015 1:46:44 AM org.ros.internal.node.RosoutLogger info
INFO: I heard: "Hello world! 9"
...

Generating Messages

Soon after you get rosjava working for the first time you will want to generate the messages you need for your project. This is accomplished using a script “genjava_message_artifacts” inside the “genjava” package. When you run this script it will generate a java version of many ROS messages. An example of the message generation process is shown below:

arwillis@Willis-Lenovo-pc:~/NetBeansProjects/ROSJava/ros_ws/src/genjava$ scripts/genjava_message_artifacts 

Generating message artifacts for: 
['std_msgs', 'actionlib_msgs', 'bond', 'diagnostic_msgs', 'geometry_msgs', 'nav_msgs', 'rosgraph_msgs', 'rosjava_test_msgs', 'sensor_msgs', 'map_msgs', 'pcl_msgs', 'shape_msgs', 'smach_msgs', 'std_srvs', 'stereo_msgs', 'tf2_msgs', 'trajectory_msgs', 'control_msgs', 'gazebo_msgs', 'visualization_msgs', 'roscpp', 'nodelet', 'roscpp_tutorials', 'dynamic_reconfigure', 'polled_camera', 'rospy_tutorials', 'topic_tools', 'actionlib', 'actionlib_tutorials', 'driver_base', 'tf', 'gazebo_ros', 'laser_assembler', 'theora_image_transport', 'turtlesim', 'turtle_actionlib', 'gazebo_plugins']
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/std_msgs/0.5.9/std_msgs-0.5.9.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 15K from remote
Uploaded 15K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/actionlib_msgs/1.12.3/actionlib_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/bond/1.7.16/bond-1.7.16.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 2K from remote
Uploaded 2K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/diagnostic_msgs/1.12.3/diagnostic_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 4K from remote
Uploaded 4K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/geometry_msgs/1.12.3/geometry_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 15K from remote
Uploaded 15K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/nav_msgs/1.12.3/nav_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 11K from remote
Uploaded 11K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/rosgraph_msgs/1.11.1/rosgraph_msgs-1.11.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 6K from remote
Uploaded 6K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/sensor_msgs/1.12.3/sensor_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 26K from remote
Uploaded 26K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/map_msgs/1.13.0/map_msgs-1.13.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 10K from remote
Uploaded 10K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/pcl_msgs/0.2.0/pcl_msgs-0.2.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 2K from remote
Uploaded 2K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/shape_msgs/1.12.3/shape_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/smach_msgs/2.0.0/smach_msgs-2.0.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/std_srvs/1.11.1/std_srvs-1.11.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/stereo_msgs/1.12.3/stereo_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 2K from remote
Uploaded 2K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/tf2_msgs/0.5.12/tf2_msgs-0.5.12.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 6K from remote
Uploaded 6K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/trajectory_msgs/1.12.3/trajectory_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/control_msgs/1.3.1/control_msgs-1.3.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 26K from remote
Uploaded 26K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/gazebo_msgs/2.5.1/gazebo_msgs-2.5.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 41K from remote
Uploaded 41K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/visualization_msgs/1.12.3/visualization_msgs-1.12.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 12K from remote
Uploaded 12K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/roscpp/1.11.13/roscpp-1.11.13.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 4K from remote
Uploaded 4K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/nodelet/1.9.3/nodelet-1.9.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 4K from remote
Uploaded 4K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/roscpp_tutorials/0.6.0/roscpp_tutorials-0.6.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 2K from remote
Uploaded 2K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/dynamic_reconfigure/1.5.39/dynamic_reconfigure-1.5.39.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 7K from remote
Uploaded 7K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/polled_camera/1.11.7/polled_camera-1.11.7.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 3K from remote
Uploaded 3K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/rospy_tutorials/0.6.0/rospy_tutorials-0.6.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 4K from remote
Uploaded 4K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/topic_tools/1.11.13/topic_tools-1.11.13.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 9K from remote
Uploaded 9K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/actionlib/1.11.4/actionlib-1.11.4.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 11K from remote
Uploaded 11K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/actionlib_tutorials/0.1.8/actionlib_tutorials-0.1.8.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 8K from remote
Uploaded 8K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/driver_base/1.6.8/driver_base-1.6.8.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 2K from remote
Uploaded 2K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/tf/1.11.7/tf-1.11.7.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 2K from remote
Uploaded 2K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Uploading: org/ros/rosjava_messages/gazebo_ros/2.5.1/gazebo_ros-2.5.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 0K from remote
Uploaded 0K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/laser_assembler/1.7.3/laser_assembler-1.7.3.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 4K from remote
Uploaded 4K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/theora_image_transport/1.9.2/theora_image_transport-1.9.2.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 1K from remote
Uploaded 1K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/turtlesim/0.6.0/turtlesim-0.6.0.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 7K from remote
Uploaded 7K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
warning: [options] bootstrap class path not set in conjunction with -source 1.7
1 warning
Uploading: org/ros/rosjava_messages/turtle_actionlib/0.1.8/turtle_actionlib-0.1.8.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 5K from remote
Uploaded 5K
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
Uploading: org/ros/rosjava_messages/gazebo_plugins/2.5.1/gazebo_plugins-2.5.1.jar to repository remote at file:/home/arwillis/NetBeansProjects/ROSJava/ros_ws/devel/share/maven/
Transferring 0K from remote
Uploaded 0K

Once you have generated your messages you must then explicitly list your message dependencies in your package.xml, CMakeLists.txt file as you would for any (Java or non-Java) ROS package. For the “package.xml” file you must add the appropriate <depends></depends> tags (if <package format=“2”>) or the <build_depend></build_depend> and <run_depend></run_depend> otherwise. For the CMakeLists.txt file you must add the messages to the list of packages in the “find_package( …. )” directive. Finally, you must edit the build.gradle file for your rosjava project and insert the appropriate dependency in the dependencies {} part of the file. Here's my process for adding the java version of the sensor_msgs messages to my rosjava project.

Inside typical package.xml
  <build_depend>sensor_msgs</build_depend>
  <run_depend>sensor_msgs</run_depend>
Modified find_package() inside CMakeLists.txt
find_package(catkin REQUIRED 
    rosjava_build_tools
    geometry_msgs
    nav_msgs
    rosjava_test_msgs
    rosgraph_msgs
    sensor_msgs
    tf2_msgs
)
Modified dependencies{} inside build.gradle
dependencies {
  /* An external maven artifact dependency */
  compile 'org.ros.rosjava_core:rosjava:[0.2,0.3)'
  compile 'org.ros.rosjava_messages:sensor_msgs:1.10.+'
  /* Example of a local subproject dependency */ 
  /* compile project(':sibling_gradle_project') */
}
rosjava.txt · Last modified: 2015/09/21 13:23 by arwillis