How to generate service .class files in rosjava?
I am new to ros and rosjava. I am going through basic tutrials of ros and rosjava. I have followed below steps. 1. Created a rosjava pakage.
> mkdir -p myjava/src
> cd myjava/src
> catkin_create_rosjava_pkg testpkg1
> cd ..
> catkin_make
> source devel/setup.bash
Then created rosjava project inside this package
>cd rosjava_catkin_package_a
>catkin_create_rosjava_project subproject1
>cd ../..
>catkin_make
So now I have testpkg1 inside which is java project subproject1. I want to try my own service example given in tutorials. So I created msg folder and srv folder inside my package testpkg1 but outside project subproject1. Inside the msg and srv are my .msg and .srv files respectivey. Structure below.
testpkg1
>msg
>Num.msg
>srv
>AddSum.srv
>subproject1
>package.xml,CmakeList.txt,gradlew,build.gradle etc
I made below changes in package.xml
<build_depend>message_generation</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>message_runtime</run_depend>
<run_depend>std_msgs</run_depend>
I made changes in CMakeList.txt
find_package(CATKIN REQUIRED std_msgs message_generation)
add_message_file(
DIRECTORY msg
Files
Num.msg
)
add_Service_files(
DIRECTORY srv
Files
AddSum.srv
)
generate_messages(DEPENDENCIES std_msgs)
catkin_package(DEPENDENCIES message_runtime std_msgs)
I didnot make any changes to build.gradle. After sourcing I am trying catkin_make. The build gets succeeded however I only see AddSum.h files, AddSumRequest.h, AddSumResponse.h and same, .py ,.js,.lisp files I am not able to see any .java files for same and .class files too. Should this files get generated in this same step or am I missing something? i have also tried
genjava_message_artifacts --verbose - p testpkg1
but it is still not generating any java related files.. I do see the .class files for Listener and Talker but not for AddSum srv.
Any help will appreciated! Thanks..
At a first glance I can't see what's wrong with the code. I guess that if you could create the rosjava pkg you have the build tools sourced. Have you found a solution? Take a look at this commit for reference: https://github.com/jubeira/tango_ros/...