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

ysg's profile - activity

2017-09-29 07:15:45 -0500 received badge  Famous Question (source)
2017-06-07 03:14:26 -0500 received badge  Popular Question (source)
2017-06-07 03:14:26 -0500 received badge  Notable Question (source)
2017-03-10 07:55:26 -0500 asked a question 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..