Ask Your Question

(rosjava) class files of custom messages cannot be found

asked 2011-10-19 13:55:19 -0500

130s gravatar image

I'm making a custom stack using rosjava. After writing some code, rosmake successfully ends but I can't find the message class that I made.

This page says as quoted below. If so, where can I put .msg files, and where the .class files of those messages are generated in?

you cannot place msg or srv files in a rosjava-based package. They have to be in a separate package. This is not considered a major issue as this is generally best practice anyway.

.msg file I made (it is placed under %STACK_HOME%/msg currently though I know this doesn't work. Just had no idea where to put it.):

uint32 clockValue
geometry_msgs/Point[] points

.jar files of geometry_msgs and other messages provided by ROS are already generated under .ros/rosjava/lib as expected.

I need to know this because I can't use the custom message unless I know the class name and (Java's) package name of the .class file of the message. Thanks!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-10-19 15:18:16 -0500

joq gravatar image

I think the message is telling you to create another (non-java) package within your stack that contains only the message definitions.

Have you tried that?

edit flag offensive delete link more


@joq thank you, I've never thought about it (nor seen the direction like that). I'll try see how it works.
130s gravatar image 130s  ( 2011-10-20 03:57:39 -0500 )edit
I tried referring to .msg in the existing .cpp package based on your hint (because I already tried similar stuff in .cpp so that I defined .msg in that package), and it worked. @joq 's suggestion should also work if you haven't made .msg definition. Thank you!
130s gravatar image 130s  ( 2011-10-24 10:03:21 -0500 )edit
Good. Keeping all the messages in a separate package is a good idea, anyway. It minimizes dependencies between the other packages.
joq gravatar image joq  ( 2011-10-24 14:33:15 -0500 )edit
@joq oh that sounds like a good/best practice that I haven't found so far anywhere in ROS related documents!
130s gravatar image 130s  ( 2011-10-26 12:13:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-10-19 13:55:19 -0500

Seen: 305 times

Last updated: Oct 19 '11