How to use ROS2 on Android
ros2_java (https://github.com/ros2-java/ros2_java) is the java wrapper for ROS2. This project enables us to use ROS2 on Android. However, it is a little bit hard to build ros2 java and use it in your Android project. This article explains how to build and use ros2 on Android.
Build
You need docker on your system. (I only tested on Ubuntu.)
- Clone this project
- Run following commands
docker build -t ros2java-android-build ./
python3 run.py ./out/soOut ./out/jarOut
3. Check the results
.jar
file and .so
files are copied into out
directory.
Use
- Create a new Android project
- Copy
.so
files intoapp/src/main/jniLibs/arm64-v8a/
- Copy
.jar
files intoapp/libs
Example app: https://github.com/YasuChiba/ros2-android-test-app
— — — — —
Currently, I’m working on porting ROS-Mobile-Android to ROS2. (ROS2-Mobile-Android)
ROS-Mobile-Android is the Android app to publish/subscribe ROS topics and display them like rviz. To port this app to ROS2, I’m utilizing my ros-android-build
tool.