Run ROS 2 Humble, Micro-ROS ,Groq Cloud LLM and RIO ROS2 packages on your Android device using Termux and ROS2Sense Mobile App for sensor hub
- 📱 Android device running Android 7.0 or higher
- 💾 At least 16GB of free storage space
- 🌐 Internet connection
- 📱 Termux app (latest version)
- 📱 ROS2Sense Mobile App (latest version)
-
Download the latest Termux app from the official releases:
Download Links
- For Android 7+ devices: termux-app_v0.119.0-beta.2+apt-android-7-github-debug_universal.apk
- For Android 5/6 devices: termux-app_v0.119.0-beta.2+apt-android-5-github-debug_universal.apk
-
Install the downloaded APK on your device
-
Open Termux app and grant necessary permissions
Step 1: Setup Ubuntu (in Termux)
Update Termux and get required packages
termux-change-repo -y && pkg update -y && pkg upgrade -y && pkg install wget -yDownload and run Ubuntu setup script
wget https://raw.githubusercontent.com/botforge-robotics/ros2_android/refs/heads/humble/setup_ubuntu.sh && chmod +x setup_ubuntu.sh && ./setup_ubuntu.shStep 2: Install ROS 2 and RIO (in Ubuntu)
After Ubuntu is installed:
- Start Ubuntu environment in Termux(if not already started):
./start-ubuntu22.sh- Update and install required packages
apt update && apt upgrade -y && apt install wget -y- Download and run ROS 2 setup script
wget https://raw.githubusercontent.com/botforge-robotics/ros2_android/refs/heads/humble/setup_ros2.sh && chmod +x setup_ros2.sh && ./setup_ros2.shThe installation process will:
- 📦 Install Ubuntu 22.04 using Andronix
- 🔧 Set up ROS 2 Humble
- 🤖 Install Micro-ROS
- 🚀 Set up RIO ROS2 packages
- ⚙️ Configure all environments
📝 Note(CycloneDDS): By default
ros2_setup.shinstalls and configures CycloneDDS (rmw_cyclonedds_cpp) as the ROS 2 middleware for better performance, as it is lightweight and efficient for mobile.
📝 Note(Domain ID): For remote communication, ROS_DOMAIN_ID is set to 156 by default in
ros2_setup.sh.You can change it to any number between 0-232 inros2_setup.shline 144 and restart termux.
After successful installation:
- 🔄 Restart your Termux app
- 🔧 Your ROS 2 environment will be automatically sourced
- ✅ Run
ros2 --helpto verify the installation
ROS2Sense transforms your smartphone into a powerful ROS 2 sensor hub, providing:
- 📡 Accelerometer – Detect motion and orientation
- 🔄 Gyroscope – Measure angular velocity
- 🧭 Magnetometer – Get compass direction
- 📍 GPS – Track precise location for navigation
- 📸 Cameras – Use mobile cameras for vision-based applications
- 🌫 IR Sensor – Use infrared commands to control home appliances like ACs and TVs (Comming Soon)
- 💡 Ambient Light Sensor – Detect environment light
- 🔊 Microphone & Speaker – Enable voice interactions & Text to speech
- 🆔 Fingerprint/Face ID – Biometric security and authentication for robots
- 📲 Display Output – Use your mobile screen for animated robotic expressions
- Inbuilt Madgwick Filter for IMU data fusion, Hotword Detection.
- Hot word detection "RIO"
Download ROS2Sense from Google Play Store
To use voice interactive features in ROS2Sense Mobile App, you'll need a Groq API key:
-
Create an account at Groq API Console
-
Get your API key
-
Set the API key as an environment variable:
export GROQ_API_KEY=<your_groq_api_key>
-
Permanently add the API key to the environment variable GROQ_API_KEY in the ~/.bashrc file
echo "export GROQ_API_KEY=<your_groq_api_key>" >> ~/.bashrc
There are three ways to launch RIO nodes:
-
Mobile Nodes Launch
- Launches smartphone-related functionality
- Includes LLM, WebRTC, and WebSocket nodes
-
PCB Nodes Launch
- Launches hardware-related components
- Includes Micro-ROS agent and sensor nodes
-
Real Robot Launch
- Combines both mobile and PCB functionality
- Full robot system deployment
The mobile nodes launch file (mobile_nodes.launch.py) starts components related to the smartphone functionality:
# Launch mobile-related nodes
ros2 launch rio_bringup mobile_nodes.launch.py llm_backend:=groqThis launch file includes:
- Ollama LLM Node: Local LLM for robot voice interactions
- Groq LLM Node: Cloud LLM for robot voice interactions
- WebRTC Node: Video streaming server (port 8080)
- Rosbridge WebSocket: Enables ROS2-to-WebSocket communication
Mobile Node Launch Parameters:
| Parameter | Description | Default Value | Options |
|---|---|---|---|
llm_backend |
LLM backend | ollama |
ollama, groq |
📝 Note: Use
llm_backend:=groqto use groq cloud LLM for voice interactions as ollama is resource intensive.
📝 Note: If you encounter issues getifaddrs(): permission denied refer to troubleshooting section for more details.
The PCB nodes launch file (pcb_nodes.launch.py) manages hardware-related components:
# Launch PCB-related nodes
ros2 launch rio_bringup pcb_nodes.launch.py agent_port:=8888PCB Launch Parameters:
| Parameter | Description | Default Value |
|---|---|---|
agent_port |
Micro-ROS agent UDP port | 8888 |
This launch file includes:
- Micro-ROS Agent: Handles communication with ESP32
- Odometry TF Broadcaster: Publishes transform data
- LIDAR UDP Node: Manages LIDAR sensor data
# Launch real robot nodes
ros2 launch rio_bringup rio_real_robot.launch.py \
use_sim_time:=false \
agent_port:=8888 \
llm_backend:=groqReal Robot Parameters:
| Parameter | Description | Default Value | Options |
|---|---|---|---|
use_sim_time |
Use simulation clock (must be false for real hardware) | false |
true/false |
agent_port |
Micro-ROS agent UDP port | 8888 |
Any available port number |
llm_backend |
LLM backend | ollama |
ollama, groq |
📝 Note: Make sure to set up the domain and network configuration before launching any nodes to ensure proper communication between components.
- Enter
0.0.0.0as ROS2 Bridge IP on connecting screen (since ROS2 is running on same device) only ifmobile_nodes.launch.pyorrio_real_robot.launch.pyis launched.
export ROS_DOMAIN_ID=156
export ROS_LOCALHOST_ONLY=0📝 Note: ROS_DOMAIN_ID is set to 156 by default in
setup_ros2.shin termux.you can change it to any number between 0-232 insetup_ros2.shline 144.
or export to .bashrc for permanent use
echo "export ROS_DOMAIN_ID=156" >> ~/.bashrc
echo "export ROS_LOCALHOST_ONLY=0" >> ~/.bashrccheck topics published by mobile nodes
ros2 topic listTo enable communication between your mobile device (running ROS 2 in Termux/Ubuntu) and a remote PC running ROS 2:
-
On your remote PC 💻
export ROS_DOMAIN_ID=156 export ROS_LOCALHOST_ONLY=0
or export to .bashrc for permanent use
echo "export ROS_DOMAIN_ID=156" >> ~/.bashrc echo "export ROS_LOCALHOST_ONLY=0" >> ~/.bashrc
🔒 Note: ROS_DOMAIN_ID is set to 156 by default in
termux.You can change it to any number between 0-232 insetup_ros2.shline 144 and restart termux.
To remotely access your Termux environment via SSH from another device (like your computer), follow these steps:
-
Activate SSH in Termux
sshd
-
Get your Termux username 👤
whoami
This will display your Termux username that you'll need for SSH login.
-
Find your device's IP address 📍
ifconfig
Look for the
wlan0section and find theinetaddress - this is your device's IP address on the WiFi network. For example:inet 192.168.1.100 -
Connect via SSH from another device 🔌
ssh <username>@<ip_address> -p 8022
Example:
ssh u0_a572@192.168.1.100 -p 8022Note: Port 8022 is Termux's default SSH port, different from the standard port 22.
-
Enter your password 🔐
- You'll be prompted for the password you set during the Ubuntu installation
- Type your password (it won't be visible as you type)
- Press Enter to submit
-
Success! ✨ You should now see the Termux prompt, indicating a successful SSH connection.
-
Start Ubuntu 🚀
./start-ubuntu22.sh
This launches your Ubuntu environment within the SSH session.
- RIO Hardware - Hardware design files, BOM and assembly instructions
- RIO Firmware - Micro-ROS firmware for the RIO controller board
- RIO ROS2 - ROS2 packages for navigation, control, and sensor integration
If you encounter any issues:
-
getifaddrs(): permission denied 🔄 we have developed a patch to fix the getifaddrs error. Download the patch:
wget https://raw.githubusercontent.com/botforge-robotics/ros2_android/refs/heads/humble/patch_getifaddrs.c
Compile the patch:
gcc -shared -fPIC -o patch_getifaddrs.so patch_getifaddrs.c -ldl
Apply the patch temporarily:
export LD_PRELOAD=$PWD/patch_getifaddrs.so
Or apply permanently by adding to .bashrc:
echo "export LD_PRELOAD=$PWD/patch_getifaddrs.so" >> ~/.bashrc
Test the patch:
wget https://raw.githubusercontent.com/botforge-robotics/ros2_android/refs/heads/humble/test_getifaddrs.c
gcc -o test_getifaddrs test_getifaddrs.c
./test_getifaddrs
Output:
Network interfaces detected: Interface: wlan0 IPv4 Address: 192.168.0.195 Interface: lo IPv4 Address: 127.0.0.1 Interface: rmnet_data3 IPv4 Address: 100.65.187.41
-
🌐 Check your internet connection
-
🔄 If the first script fails:
- Try running
setup_ubuntu.shagain
- Try running
-
🔧 If the second script fails:
- Make sure you're in the Ubuntu environment
- Try running
setup_ros2.shagain
-
📝 Check the error messages in the script output
-
Permission Issues 🔒 If you encounter permission errors:
chmod +x setup_ubuntu.sh chmod +x setup_ros2.sh
- ⏳ The installation process may take some time depending on your device and internet connection
- 🔋 Make sure your device is plugged into a power source during installation
Feel free to submit issues and enhancement requests!
This project is licensed under the MIT License - see the LICENSE file for details.


