Android application for controlling the AntBot tank robot via Bluetooth with FPV camera streaming capability.
- Bluetooth Control - Connect to HC-05 module on robot
- Device Discovery - Automatic Bluetooth device scanning and pairing
- Motor Control - Forward, backward, left/right tank turns, stop
- Servo Control - Tilt camera/sensor mechanism
- Sensor Monitoring - Real-time ultrasonic distance readings
- Camera Streaming - FPV (First Person View) capability (planned)
- Experimentation Platform - Foundation for ML/RL experiments
- Android 5.0 (API 21) or higher
- Bluetooth-enabled Android device
- HC-05 Bluetooth module on robot (paired)
- Clone repository:
git clone <repository-url>
cd RobotController-
Open in Android Studio:
- File → Open → select
RobotControllerdirectory - Sync Gradle files
- File → Open → select
-
Connect Android device:
- Enable USB debugging (Settings → Developer Options)
- Connect via USB
- Allow USB debugging when prompted
-
Build and run:
- Click Run (green triangle) or Shift+F10
- App installs and launches on device
- Power on robot - Ensure Arduino and HC-05 are powered
- Launch app on Android device
- Scan for devices - Tap "Scan for Bluetooth Devices"
- Select HC-05 from list (may appear as "HC-05", "HC-06", or generic name)
- Pair if needed - Enter PIN 1234 or 0000 if prompted
- Tap device to connect
- Control robot - Use Forward, Backward, Left, Right, Stop buttons
Bluetooth Serial (9600 baud):
Commands sent to Arduino:
F<speed>\n- Forward (e.g.,F200\n)B<speed>\n- BackwardL<speed>\n- Turn leftR<speed>\n- Turn rightSTOP\n- Stop motorsS<angle>\n- Servo angle (e.g.,S90\n)
Data received from Arduino:
D:<distance>- Distance in inches (e.g.,D:15)
BluetoothManager.kt - Handles Bluetooth connection, device discovery, and serial communication
MainActivity.kt - UI and user interaction, sends commands and displays sensor data
Future Modules:
- Camera streaming (IP Webcam integration or custom implementation)
- Computer vision (TensorFlow Lite)
- Reinforcement learning agent integration
- Autonomous navigation modes
app/
├── src/
│ └── main/
│ ├── java/com/yourpackage/robotcontroller/
│ │ ├── MainActivity.kt
│ │ └── BluetoothManager.kt
│ ├── res/
│ │ └── layout/
│ │ └── activity_main.xml
│ └── AndroidManifest.xml
└── build.gradle
Required permissions in AndroidManifest.xml:
BLUETOOTH- Bluetooth communicationBLUETOOTH_ADMIN- Bluetooth device discoveryCAMERA- FPV streaming (future)INTERNET- Network streaming (future)ACCESS_NETWORK_STATE- Network status (future)
Language: Kotlin
Minimum SDK: 21 (Android 5.0 Lollipop)
Target SDK: 34 (Android 14)
Dependencies:
- AndroidX AppCompat
- Material Design Components
- Some Android versions hide Bluetooth MAC addresses in settings
- Bluetooth connection may require app restart if pairing fails
- Background Bluetooth may disconnect on some devices (Android battery optimization)
- Camera preview and streaming to remote device
- On-device TensorFlow Lite inference
- Autonomous navigation modes
- Joystick control (replace discrete buttons)
- Sensor data visualization
- Recording and playback of control sequences
- RL agent integration
Arduino sketches for robot controller available in separate repository.
MIT License - See LICENSE file for details
This is an experimentation platform. Feel free to fork and add your own features!