ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Using service in rosjava

asked 2018-10-14 23:04:50 -0500

Tom_Cruise gravatar image

Hello, I use the class Server from rosjava_tutorial_services in my android project, building is successful,but when I use rosservice call in terminal to test the service, get a ERROR: Unable to load type [rosjava_test_msgs/AddTwoInts]. Have you typed 'make' in [rosjava_test_msgs]? I use ubuntu16.04 kinetic and android 7.0. My questions are:- 1, how can i fix the problem. 2,how to use custom service and client in android project by using rosjava. Any ideas/recomendations/help are greatly apreciated.

Best Regards, -C.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-10-30 15:45:17 -0500

jubeira gravatar image

Hi @Tom_Cruise,

if you installed rosjava from source, you first need to source your rosjava workspace before calling the service (e.g source ~/rosjava/devel/setup.bash). The error happens because you don't have the message definition loaded in your environment. If you installed it from debians, sourcing the ROS distribution should do (e.g. source /opt/ros/kinetic/setup.bash).

To create custom services, try this tutorial as a first reference. As you can see, the service client / server are rosjava nodes that can be included in an Android project if needed.

Hope this helps!

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-10-14 23:04:50 -0500

Seen: 197 times

Last updated: Oct 30 '18