Skip to content

addmessage

Salvo Virga edited this page Jun 21, 2016 · 2 revisions

How to create new messages

The modules in this repo use the same messages on the ROSCORE side and the CABINET side, but while the first uses a standard ROS version, the second uses ROS Java.
Therefore, we need to build the messages for both versions.

Standard ROS

This is straightforward, add a new msg file in the iiwa_msgs module and build it. Just as usually in ROS.

ROS Java

We are still going to use the same modules from the standard ROS version, but adding a ROS Java build.
Because for reasons, the simple tutorial presented here, seems not generating our custom messages (it generates an empty .jar file) and so does the indigo branch of ROS Java.
So, for the moment, we have to use the following to generate the ROS Java messages.

Create another workspace and clone the message generator for ROS Hydro Java :
git clone https://github.com/rosjava/rosjava_messages.git -b hydro src

open the package.xml just cloned in src and add the line
< build_depend>iiwa_msgs</ build_depend>

REMINDER : source the main workspace with the iiwa_msgs package

build the workspace

catkin build

you will find the create jar file in

src/iiwa_msgs/build/libs/

You can copy this file into the ROSJavaLib folder on your Sunrise project.

NOTE : you might build this jar file on top of a new version of its dependencies, so make sure you also copy the jar files of them (i.e. geometry_msgs, std_msgs)..

Clone this wiki locally