Robotics StackExchange | Archived questions

How to use services in Android Studio?

Hello,

I want to build an Android app for visualization and configuration of my node running on a PC or robot. The idea is to set rosparams on the Android device and notify the running node on the PC via a service call to go through the parameters and check for updates. To be sure that the service call gets processed I want to use a service and check the response on the Android device. Until now I had success in creating an App using rosjava and android_core in Android Studio.

In the tutorial http://wiki.ros.org/rosjavabuildtools/Tutorials/indigo/UsingServices there is only a description how to use services using catkin_style. My question is: Is there a way to include custom services using rosjava in Android Studio without rebuilding rosjava?

Asked by PASulz on 2019-03-01 08:06:57 UTC

Comments

Answers

Hi @PASulz,

You may try calling genjava directly, but I'd recommend you to do the following:

  • Create a separate package with your message / service definitions as in the tutorial.
  • Source rosjava_build_tools (from binaries or from source), and build the package with catkin.
  • Source the resulting develspace with the built artifacts for your custom message / service
  • From the same terminal, launch Android Studio.

By doing the steps above you should be able to develop your applications with your custom Java artifacts (messages / services).

My question is: Is there a way to include custom services using rosjava in Android Studio without rebuilding rosjava?

Note that you don't need to rebuild the whole rosjava from source, just the package with the custom message / service definitions.

Hope it helps!

Asked by jubeira on 2019-03-06 12:12:05 UTC

Comments