ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

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 reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2022-10-12 04:50:49.966730

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 image jubeira  ( 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 image rezenders  ( 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 image jubeira  ( 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 image rezenders  ( 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 image rezenders  ( 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 image rezenders  ( 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 image gautam_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 image rezenders  ( 2019-06-12 13:08:26 -0500 )edit

Question Tools

2 followers

Stats

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

Seen: 428 times

Last updated: Mar 19 '19