Ask Your Question
0

[rosjava] How can I use custom messages from 3rd party packages using rosjava without ROS workspaces?

asked 2019-03-18 15:30:04 -0500

rezenders gravatar image

I am using rosjava with no ROS workspace and it is working fine. However, now I want to use messages from mavros but I don't know how. I saw that it is possible to use genjava to convert messages to .jar, is it possible to use genjava without installing rosjava?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-03-19 07:58:08 -0500

jubeira gravatar image

Hi @rezenders,

You can follow this tutorial: http://wiki.ros.org/rosjava/Tutorials... from genjava. Note that you need to have mavros messages installed.

edit flag offensive delete link more

Comments

I haven't done that myself for a while, but it should work. If it doesn't please let me know.

jubeira gravatar imagejubeira ( 2019-03-19 07:58:13 -0500 )edit

Hello @jubeira, I'm having some trouble with genjava installation. Since I'm using ros melodic I can't use apt to install it so I'm trying to get it from sources. I'm doing the following steps:

mkdir -p ~/genjava/src
wstool init ~/genjava/src
wstool set --target-workspace=src  genjava --git https://github.com/rosjava/genjava --version=kinetic
wstool update  --target-workspace=src genjava
rosdep install --from-paths src -i -y

But I get the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
genjava: Cannot locate rosdep definition for [rosjava_build_tools]
rezenders gravatar imagerezenders ( 2019-03-19 10:10:15 -0500 )edit

Yes, for now nothing was released to melodic yet; I'd recommend you to proceed with the installation from source (all rosjava components; check http://wiki.ros.org/rosjava/Tutorials... )

jubeira gravatar imagejubeira ( 2019-03-19 10:43:16 -0500 )edit
1

Using the kinetic branch for source installation in Melodic I get the following errors. With the complete installation:

$ rosdep install --from-paths src -i -y
ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
rosjava_messages: Cannot locate rosdep definition for [world_canvas_msgs]
rezenders gravatar imagerezenders ( 2019-03-19 10:52:08 -0500 )edit

With the minimal installation when I run catkin_make:

geometry_experimental/tf2/CMakeFiles/tf2.dir/build.make:86: recipe for target 'geometry_experimental/tf2/CMakeFiles/tf2.dir/src/buffer_core.cpp.o' failed
make[2]: *** [geometry_experimental/tf2/CMakeFiles/tf2.dir/src/buffer_core.cpp.o] Error 1
CMakeFiles/Makefile2:10925: recipe for target 'geometry_experimental/tf2/CMakeFiles/tf2.dir/all' failed
Catkin generate tree: replacing older version of tf2_msgs[0.5.20->0.6.5]
[ 93%] Built target std_msgs_generate_messages_java_gradle
[ 93%] Built target std_srvs_generate_messages_java_gradle
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
rezenders gravatar imagerezenders ( 2019-03-19 10:52:48 -0500 )edit

Also posted this in the issue https://github.com/rosjava/genjava/is... Sorry for the cross posting

rezenders gravatar imagerezenders ( 2019-03-19 10:53:05 -0500 )edit

@rezenders were you able to figure out the issue with 'world_canvas_messages'? I'm running into the exact same error.

gautam_io gravatar imagegautam_io ( 2019-06-12 12:38:22 -0500 )edit

@gautam_io No, I did not. I used ros kinect to generate the messages .jar, and then used the .jar with ros melodic.

PS: I used the following dockerfile environment to generate the .jar https://github.com/jason-lang/jason-r...

rezenders gravatar imagerezenders ( 2019-06-12 13:08:26 -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

2 followers

Stats

Asked: 2019-03-18 15:30:04 -0500

Seen: 79 times

Last updated: Mar 19