Native C++ with ROS on Android?
I'd like to run our existing ROS nodes on Android. This is all C++ code, and I've got the non-ROS parts working with the Android NDK already. However, using native ROS on Android doesn't seem very straightforward. I've found https://github.com/ekumenlabs/roscpp_..., but this is for ROS Hydro and NDK r9!
Any suggestions on running ROS Melodic (or later) with NDK r20? Do I really have to cross-compile the full ROS core myself, including all the dependencies? This is quite a bit of work. It includes cross-compiling python 2 for Android which isn't trivial itself. I was hoping to find something precompiled or at least pre-configured...
I don't think it makes sense to use rosjava, as then we would basically have to rewrite all our ROS code, no?
Might it make sense to migrate to ROS 2?
Hi! Have you found a solution to your problem? I'm facing a similar one.
Only partially and it's quite a bit of work: I've crosscompiled every C++ package I need into a bunch of libraries which I then include in my Android NDK app. You can easily include catkin packages in a normal CMakeLists.txt (which is what the Android NDK uses). This gives me all the functionality I need (mainly publishing and subscribing to topics), but it requires cross-compilation of a few dozen libraries (both ROS and its dependencies, some of which required a few fixes) and I don't have any python running at all, so things like "rostopic list" or anything else that relies on a full workspace like rospack don't work.
could you share any pointers/notes on what you did? I'd appreciate any guidance...
That heavily depends on how familiar you are with cmake, catkin and cross-compiling in general. Also, it's definitely not for the faint of heart... ;)
I have some experience with the above and cross-compiling as well.
Well then. What do you actually, really need? If you justwant to send and receive ROS messages on Android, then the rosjava stuff is by far the easiest thing to use: http://wiki.ros.org/android_core
I can't do Java since I have C++ library. This library is used in third-party framework (UnrealEngine). Yes, I need to create topics and publish to them, and subscribe to two topics.
I've wrote a longer answer to your question: https://answers.ros.org/question/3382...