0
$\begingroup$

Rosanswers logo

I'm trying to follow the rosjava tutorials for creating my own node. This node needs to be both a publisher and a server.

I'm finding the rather brief notes on rosjava messages lacking the level of detail I need, being rather new to ROS and rosjava in particular. I have built .mgs and .srv files for other nodes using rospy, but the structure of rosjava seems sufficiently different that I'm unsure what to do.

I need to define two messages one is an arrays of ints, the other an array of floats

I also need to define services that are an array of int/floats pairs (or a single int/float pair), neither service returns anything.

I'm also unsure as to where to place my .java and externally linked library .jar files to have this node run correctly.

Any help would be appreciated.


Originally posted by DocSmiley on ROS Answers with karma: 127 on 2012-07-27

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I am not a java programmer, but I believe you need to create custom messages in a separate package, using the normal ROS message definition and generation tools.


Originally posted by joq with karma: 25443 on 2012-07-27

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by damonkohler on 2012-08-01:
The generation tools are not necessary for Java. Rebuilding the rosjava_messages package will generate all available ROS messages. This process is described in the documentation, albeit briefly. http://docs.rosjava.googlecode.com/hg/rosjava_core/html/getting_started.html#messages

Comment by PeterMilani on 2012-11-28:
I also found that if developing in eclipse, that I had to re-reference my rosjava_messages-0.0.0-SNAPSHOT.jar into my build path. If copied it into my libs folder, it would conflict with the ginerbread_mr2 jar of the same name. Must have same in both projects or import as external JAR to build path.

Comment by Robocop87 on 2015-02-21:
@damonkohler I tried doing what you suggested and I tried the instructions here: http://wiki.ros.org/rosjava/Tutorials/hydro/Unofficial%20Messages but unfortunately it still doesn't work for me. When I try to depend on the messages in my build.gradle I get the an error:

Comment by Robocop87 on 2015-02-21:
Could not resolve all dependencies for configuration ':project:compile'.

Could not find any version that matches org.ros.rosjava_messages:hsmrs_framework:0.1.+. Required by: org.ros.rosjava_core:project:0.1.0

Comment by Robocop87 on 2015-02-21:
I solved the problem from my comment, I didn't have the full group ID. It was org.ros.rosjava_messages.rosjava_pkg:msg_pkg:0.0.+

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.