Simple Android app communication with ROS Kinetic
Hello,
I'm searching for a simple way, so that my android application can send and receive messages from my Laptop via ROS Kinetic. Simple double or string variables are enough. I found lots of tutorials but they are not working for me or to complicated for me or not with ROS kinetic. I hope you guys can help me.
Best regards
Asked by splash99 on 2019-05-29 07:09:27 UTC
Answers
Hi @splash99,
Take a look at https://wiki.ros.org/android. There are already sample apps out there showing how to do a simple pubsub: https://github.com/rosjava/android_core/tree/kinetic/android_tutorial_pubsub. I'd suggest you to compile that application and use it as a starting point for your purposes.
Hope it helps!
EDIT: Check this issue https://github.com/rosjava/rosjava_build_tools/issues/32 for a workaround to create an Android project. Note that the command line tool just creates a template for a new project, but nothing else that is very sophisticated. You can do the same editing an existing project instead of starting from scratch.
Asked by jubeira on 2019-05-30 12:57:39 UTC
Comments
I lost the track on this count of tutorials.. Could you maybe help me? I just need one tutorial that I can walk through, but every tutorial I find, is deprecated at any point and I cant fix this.. I just want a really simple connection betwenn my android tablet and a ros master on a pc that can send and receive simple double values.
Asked by splash99 on 2019-06-06 09:54:16 UTC
Just build pubsub tutorial: https://github.com/rosjava/android_core/tree/kinetic/android_tutorial_pubsub.
In two steps:
- Clone https://github.com/rosjava/android_core
- Go to
android_core
folder and run./gradlew build
That should build android_tutorial_pubsub
apk for you. Install it to your Android device using adb and that should be it.
Asked by jubeira on 2019-06-06 10:01:27 UTC
when i try to build it it says:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_warnings
Asked by splash99 on 2019-06-06 10:07:09 UTC
Is that a warning or an error? Look for an APK file inside your source directory, it should be there already.
Asked by jubeira on 2019-06-10 06:28:48 UTC
it's an error. I cant build. It says :
Build failed with exception
- Where: Build file '/home/USER/android_core/android_acm_serial/build.gradle' line: 21 US
What went wrong: A problem occurred evaluating project ':android_acm_serial'.
Failed to apply plugin [id 'com.android.library'] Minimum supported Gradle version is 5.1.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /home/USER/android_core/gradle/wrapper/gradle-wrapper.properties to gradle-5.1.1-all.zip
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/4.10.2/userguide/command_line_interface.html#sec:command_line_
Asked by splash99 on 2019-06-11 04:57:48 UTC
ok, i started the apk now on my emulated android device. And I can connect to the Ros Master, which runs on the same Laptop as the emulator. But how can I now send and receive messages? Is there any explanation of the pubsub app?
Asked by splash99 on 2019-06-11 07:02:01 UTC
That must be a local problem. Try an online search for that error; e.g: https://stackoverflow.com/questions/50646616/failed-to-apply-plugin-id-com-android-application-minimum-supported-gradle
Asked by jubeira on 2019-06-11 10:05:42 UTC
@jubeira btw thanks for your help. I solved the error but i dont understand how this application is working. Is there any explanation or something that explains the tutorial?
Asked by splash99 on 2019-06-12 04:05:54 UTC
@splash99 did you get to the point to build and run the application? I saw you asked the question again.
Asked by jubeira on 2019-06-21 10:25:59 UTC
Hi @jubeira,
thanks for your answer. When I start your tutorial it says after a few steps:
NOTE: Creating Android projects from the command line won't be supported with Build tools > 25.0.2. The tool supporting this command in Android's SDK has been officially deprecated, so to start a new project Android Studio has to be used.
Do you maybe have another Tutorial, that I can use?
Every Tutorial ends up in some tutorials for indigo like this:
It starts as tutorial for kinetic but the next site is indigo. Isnt there any tutorial which is only for kinetic?
Asked by splash99 on 2019-06-06 08:40:33 UTC
Comments
@splash99 please note that the idea behind ROS answers is not a forum; please use comments to ask for clarifications or open a new question if necessary; the answers section should only contain answers. I'll edit my answer with a workaround for that.
Asked by jubeira on 2019-06-06 08:49:25 UTC
@jubeira oh ok sorry.
Asked by splash99 on 2019-06-06 09:32:59 UTC
Comments