I would like to create my own messages using rosjava but I don't know how to create it.
Example:
JointCommand.msg
string name
float64 effort
Later, how to set and get data from that message?
Currently, I know how to create simple messages and get data:
org.ros.message.std_msgs.String str = new org.ros.message.std_msgs.String();
str.data = "" + seq;
How to create a future complex message: JointCommand
Many thanks in advance.
Juan Antonio
Currently rosjava requires all .msg/.srv files to be defined externally and included as dependencies in the manifest file. I believe this was done to promote separation of msg packages and the packages that use them. Any packages included in the manifest will prompt java JAR generation for those foreign message types.
Do you have an example to undertand your idea?
I know how to use manifest to add external libraries but how to create a package with custom messages and later create that .jar?
Currently, I have a manifest with the following dependencies:
<depend package="rosjava" />
<depend package="std_msgs" />
If I add another dependencie:
<depend package="custom_msgs" />
How to store that folder and how to create that jar?
Does exist another way? For example creating a package in src folder or outside in the same folder with the messages?
Many thanks in advance.
Juan Antonio
Hi Jeff, I solved my doubt in the following way.
I wanted to use nxt_msgs: http://www.ros.org/wiki/nxt_msgs
so I copied that project, I compiled with rosmake and later, I added in manifest.xml from my last project the following line:
<depend package="nxt_msgs" />
I compiled with rosmake the project and later, I could add in my Java classes that messages.
Many thanks.
Juan Antonio
Jeff, I solved the doubt about how to use sensor_msgs in my projects with rosjava.
roslocate info sensor_msgs
- svn:
local-name: sensor_msgs
uri: https://code.ros.org/svn/ros-pkg/stacks/common_msgs/trunk/sensor_msgs
I donwloaded the project in my rosjava workspace and I did a rosmake. Later eclipse recognized messages from the package sensor_msgs.
Many thanks.
Juan Antonio
Asked: Jan 06
Seen: 236 times
Last updated: Jan 07
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.