# How can I create a service on ROS java? Details?

I looked over the question: How can I create a service on rosjava?

but it seemed to be a bit dated and I wasn't able to add a new service.

I'm able to implement the AddTwoInts service but having difficulty on creating a new Service 'SendSmsMessage'.

I added a SendSmsMessage.srv to my local ~/rosjava_test_msgs git repo. I did a:

cmake .


but don't see any files to use else where.

I added SendSmsMessage.srv to my local ~/rosjava_bootstrap git repo:

 ~/rosjava_bootstrap/message_generation/src/test/resources/test_msgs/srv/
EmptyRespSrv.srv          ListReturn.srv           SendSmsMessage.srv     <<<----
TransitiveSrv.srv


and ran gradle which updated /opt/ros/indigo/share/maven/

I expected it to update: /opt/ros/indigo/share/rosjava_test_msgs/srv

but it still only has AddTwoInts.srv. Why is that?

I don't see any code for SendSms in /opt/ros/indigo but there are logs of files for AddTwoInts:

$find . -name "SendSms*" -print$ find . -name "AddTwo*" -print


in rosjava_core/rosjava/build.gradle whe have:

rosjava_core/rosjava/build.gradle:
compile 'org.ros.rosjava_messages:rosjava_test_msgs:[0.2,0.3)'


I assume that get a jar file from:

/opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar!/


but that jar file still only has AddTwoInts.class and not my new SendSmsMessage class:

AddTwoInts.class               AddTwoIntsResponse.class
CompositeB.class              TestArrays.class                      TestPrimitives.class


There is are two .idea files referring to rosjava_test_msgs-0.2.1.jar:

 .idea/workspace.xml
<option value="/opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar" />


and

   ./.idea/libraries/Gradle__org_ros_rosjava_messages_rosjava_test_msgs_0_2_1.xml
jar:///opt/ros/indigo/share/maven/org/ros/rosjava_messages/rosjava_test_msgs/0.2.1/rosjava_test_msgs-0.2.1.jar!/


So I suppose the most important problem is ~/rosjava_bootstrap not generating a java file for SendSmsMessage.srv. I do see a message_generation/src/test/java/org/ros/internal/message/Md5GeneratorTest.java mentioning testAddTwoInts but I doubt a bit this is the problem.

\$ git grep AddTwoInts