Sistem navigasi autonomous rover dengan line following, ArUco marker detection, dan obstacle avoidance menggunakan OpenCV dan STM32/Arduino integration.
# Compile project
cd build
cmake ..
make autonomous_rover -j$(nproc)
# Run dengan webcam
./autonomous_rover
# Atau gunakan script
cd ..
./scripts/run_rover.sh
# Run dengan custom camera URL
./scripts/run_rover.sh http://192.168.1.100:8080/video- 🔍 Line Following - White & yellow line detection dengan HSV filtering
- 🎯 ArUco Marker Navigation - Detection, tracking, dan decision making
- 🚧 Obstacle Detection - Black object detection untuk menghindari halangan
- 🎨 Boundary Detection - Edge detection untuk mencegah keluar jalur
- 🔊 Voice Guidance (eSpeak) - Text-to-speech untuk notifikasi realtime
- 📊 Decision Logging - CSV logging untuk analisis performa
- 🤝 Robot Integration - Serial communication dengan STM32/Arduino via HC-05 Bluetooth
- � Smart Control - Toggle-based command system untuk kontrol robot
- Path Planner - A* pathfinding algorithm
- Obstacle Detector - Real-time obstacle detection
- Robot Bridge - Hardware abstraction layer
- Serial Transport - Reliable serial communication
- YOLO Detector - Optional YOLOv5 object detection (jika ONNX Runtime tersedia)
- YAML-based configuration (
config/rover_config.yaml) - Runtime parameter tuning
- Multiple camera source support (webcam, IP camera, video file)
- ROVER_INTEGRATION.md - Panduan integrasi robot
- ROVER_QUICK_START.md - Quick start guide
- STM32_INTEGRATION.md - STM32 integration details
- STM32_ELECTRICAL_GUIDE.md - Wiring dan setup hardware
- PROGRAMMER_NEXT_STEPS.md - Development guide
sudo apt-get update
sudo apt-get install -y \
libopencv-dev \
libopencv-contrib-dev \
cmake \
g++ \
build-essential \
espeak \
libespeak-devNote: eSpeak + libespeak-dev diperlukan untuk fitur Text-to-Speech (TTS).
# Download ONNX Runtime
wget https://github.com/microsoft/onnxruntime/releases/download/v1.16.0/onnxruntime-linux-x64-1.16.0.tgz
tar -xzf onnxruntime-linux-x64-1.16.0.tgz
sudo cp -r onnxruntime-linux-x64-1.16.0/include/* /usr/local/include/
sudo cp -r onnxruntime-linux-x64-1.16.0/lib/* /usr/local/lib/
sudo ldconfig# Clone repository
git clone https://github.com/irsyad-a/ArUco-Detec-Autonomous.git
cd ArUco-Detec-Autonomous
# Create build directory
mkdir -p build
cd build
# Configure and compile
cmake ..
make autonomous_rover -j$(nproc)cd build
ls -lh autonomous_rover
./autonomous_rover --helpSaat menjalankan autonomous_rover, Anda akan mendapat prompt:
Aktifkan suara deteksi? [Y/n]:
- Tekan Enter atau
yuntuk mengaktifkan TTS - Masukkan
nuntuk mode silent
Sistem menggunakan metode toggle control:
- Karakter
w,a,s,d,q,e,g,pakan toggle ON/OFF - Sistem otomatis mematikan perintah lama sebelum aktivasi perintah baru
- Instruksi STOP mengirim ulang karakter yang sama
- Download "IP Webcam" dari Play Store
- Buka app → Scroll down → "Start server"
- Catat URL (contoh:
http://192.168.1.100:8080/video) - Run dengan URL:
./scripts/run_rover.sh http://192.168.1.100:8080/video
Edit config/rover_config.yaml:
camera:
source: "http://192.168.1.100:8080/video" # IP camera URL
# source: 0 # or use webcam
width: 640
height: 480
fps: 30./scripts/run_rover.sh
# Atau
cd build
./autonomous_rover./scripts/run_rover.sh http://192.168.1.100:8080/videocd build
./autonomous_rover /path/to/video.mp4Saat program berjalan:
q- Quit/keluar dari programr- Reset decision statem- Toggle map windowd- Toggle debug modev- Toggle verbose loggings- Save screenshotp- Pause/resume
Jika terhubung dengan robot via HC-05:
w- Maju (Forward)s- Mundur (Backward)a- Belok kiri (Turn Left)d- Belok kanan (Turn Right)q- Rotate kiri (Rotate Left)e- Rotate kanan (Rotate Right)g- Stop semua motorp- Pause toggle
Main script untuk compile dan run autonomous rover.
./scripts/run_rover.sh [camera_url]Kirim single character command ke robot via serial/bluetooth.
./scripts/send_char.sh w # Forward
./scripts/send_char.sh s # BackwardSetup dan konfigurasi HC-05 Bluetooth module.
./scripts/setup_bluetooth.shArUco-Detec-Autonomous/
│
├── 📁 src/ # Source code
│ ├── autonomous_rover.cpp # ⭐ Main autonomous system
│ ├── robot_bridge.{cpp,hpp} # Robot hardware abstraction
│ ├── serial_transport.{cpp,hpp} # Serial communication
│ ├── path_planner.{cpp,hpp} # A* pathfinding
│ ├── obstacle_detector.{cpp,hpp} # Obstacle detection
│ ├── yolo_detector.{cpp,hpp} # YOLO object detection
│ └── command_protocol.hpp # Command definitions
│
├── 📁 build/ # Compiled binaries
│ ├── autonomous_rover # ⭐ Main executable
│ ├── autonomous_navigation_log.txt
│ ├── decisions_log.csv
│ └── visited_markers.json
│
├── 📁 config/ # Configuration files
│ ├── rover_config.yaml # Main config
│ └── rover_config_examples.yaml # Example configs
│
├── � docs/ # Documentation
│ ├── ROVER_INTEGRATION.md # Integration guide
│ ├── ROVER_QUICK_START.md # Quick start
│ ├── STM32_INTEGRATION.md # STM32 guide
│ ├── STM32_ELECTRICAL_GUIDE.md # Wiring guide
│ └── PROGRAMMER_NEXT_STEPS.md # Development guide
│
├── � scripts/ # Utility scripts
│ ├── run_rover.sh # ⭐ Main launcher
│ ├── send_char.sh # Send BT command
│ └── setup_bluetooth.sh # BT setup
│
├── � firmware/ # Robot firmware
│ ├── stm32/ # STM32 code
│ └── arduino/ # Arduino code
│
├── 📖 README.md # This file
└── 📄 CMakeLists.txt # Build configuration
-
Clone & Build
git clone https://github.com/irsyad-a/ArUco-Detec-Autonomous.git cd ArUco-Detec-Autonomous mkdir build && cd build cmake .. make autonomous_rover -j$(nproc)
-
Test dengan Webcam
./autonomous_rover
-
Configure untuk Robot
# Edit config/rover_config.yaml # Setup Bluetooth (jika menggunakan HC-05) ../scripts/setup_bluetooth.sh
-
Read Documentation
docs/ROVER_QUICK_START.md- Quick start guidedocs/ROVER_INTEGRATION.md- Integration detailsdocs/STM32_INTEGRATION.md- Hardware integration
-
Understand Architecture:
src/autonomous_rover.cpp- Main state machine & logicsrc/robot_bridge.cpp- Hardware abstraction layersrc/path_planner.cpp- A* pathfinding algorithmsrc/obstacle_detector.cpp- Obstacle detection module
-
Modify Parameters:
# Edit config/rover_config.yaml line_following: white_line: h_min: 0 s_min: 0 v_min: 200
-
Build & Test:
cd build make autonomous_rover -j$(nproc) ./autonomous_rover
-
Debug:
# Enable verbose logging ./autonomous_rover --verbose # Check logs tail -f autonomous_navigation_log.txt
Solution:
# 1. Check camera device
ls -l /dev/video*
# 2. Test dengan v4l2
v4l2-ctl --list-devices
# 3. Try different camera index
./autonomous_rover 0 # atau 1, 2, dstSolution:
# 1. Check network connectivity
ping <IP_CAMERA>
# 2. Test di browser
firefox http://<IP>:8080/video
# 3. Try alternative URL
./autonomous_rover http://<IP>:8080/videofeedSolution:
- Sesuaikan HSV threshold di
config/rover_config.yaml - Pastikan pencahayaan cukup terang dan merata
- Test dengan debug mode:
./autonomous_rover --debug - Check HSV values: Window "HSV Adjustments"
Solution:
# Install all dependencies
sudo apt-get install -y libopencv-dev libopencv-contrib-dev \
cmake g++ build-essential espeak libespeak-dev
# Clean rebuild
cd build
rm -rf *
cmake ..
make autonomous_rover -j$(nproc)Solution:
# 1. Check bluetooth device
ls -l /dev/rfcomm*
# 2. Pair HC-05
./scripts/setup_bluetooth.sh
# 3. Test connection
./scripts/send_char.sh wSolution:
- Check serial port di
config/rover_config.yaml - Verify baud rate (default: 9600)
- Test dengan
./scripts/send_char.sh - Check firmware di robot (STM32/Arduino)
- ✅ Gunakan power supply yang stabil untuk robot
- ✅ Pastikan HC-05 terpasang dengan benar (TX->RX, RX->TX)
- ✅ Ground semua komponen ke common ground
- ✅ Test koneksi serial sebelum integration
- 🎯 Gunakan tape berwarna putih/kuning dengan kontras tinggi
- 📏 Lebar garis minimal 2-3 cm
- 💡 Pencahayaan merata, hindari shadow
- � Background gelap untuk white line, terang untuk yellow line
- 📐 Print marker minimal 5x5 cm
- 🖨️ Quality printing (hitam pekat, putih bersih)
- 📏 Jarak deteksi optimal: 20-100 cm
- � Pastikan marker flat (tidak terlipat)
- 🔧 Use configuration file untuk parameter tuning
- 📝 Enable logging untuk debugging
- 💾 Commit changes incrementally
- 🧪 Test di simulator sebelum real robot
- 📊 Monitor decision logs untuk analisis performa
- docs/ROVER_INTEGRATION.md - Complete integration guide
- docs/ROVER_QUICK_START.md - Quick start guide
- docs/STM32_INTEGRATION.md - STM32 programming guide
- docs/STM32_ELECTRICAL_GUIDE.md - Wiring & hardware
- docs/PROGRAMMER_NEXT_STEPS.md - Development guide
- OpenCV Documentation
- OpenCV ArUco Tutorial
- ArUco Original Paper
- STM32 HAL Documentation
- Serial Communication Guide
- A* Pathfinding: Path planning untuk navigasi
- HSV Color Filtering: Line detection
- Contour Detection: Obstacle & boundary detection
- ArUco Detection: Marker-based localization
- Line Following - White & yellow line detection
- ArUco Navigation - Marker detection & tracking
- Obstacle Detection - Black object detection
- Boundary Detection - Edge detection
- Voice Guidance - eSpeak TTS integration
- Robot Integration - Serial/Bluetooth communication
- Path Planning - A* algorithm implementation
- Decision Logging - CSV logging system
- Configuration System - YAML-based config
- Multiple Camera Support - Webcam, IP cam, video file
- YOLO Detection (Optional) - Object detection with YOLOv5
- SLAM (Simultaneous Localization and Mapping)
- Advanced obstacle avoidance with sensor fusion
- Multi-robot coordination
- Web dashboard untuk monitoring
- Mobile app remote control
- Machine learning untuk decision making
- GPS integration untuk outdoor navigation
- ROS2 integration
Repository: irsyad-a/ArUco-Detec-Autonomous
Version: 3.0.0
Last Updated: November 15, 2025
Core Technologies:
- OpenCV 4.x - Computer vision library
- C++17 - Main programming language
- CMake 3.0+ - Build system
- eSpeak - Text-to-speech engine
- YAML-CPP - Configuration parsing
- ONNX Runtime (Optional) - YOLOv5 inference
Hardware Support:
- STM32 - Microcontroller platform
- Arduino - Alternative microcontroller
- HC-05 - Bluetooth communication module
- Camera - Webcam, IP camera, or video file
Platform:
- Linux (Ubuntu/Debian)
- Tested on: Ubuntu 22.04 LTS
Libraries & Tools:
- OpenCV - Computer vision foundation
- ArUco - Fiducial marker system
- eSpeak - Open source TTS engine
- ONNX Runtime - ML inference engine
Resources:
- OpenCV documentation & tutorials
- ArUco research papers
- STM32 HAL libraries
- Community contributions
MIT License - Free to use for educational and commercial purposes.
See LICENSE file for details.
Need Help?
- ✅ Check docs/ROVER_QUICK_START.md
- ✅ Read docs/ROVER_INTEGRATION.md
- ✅ Look at Troubleshooting section above
- ✅ Check log files:
build/autonomous_navigation_log.txt
Found a Bug?
- Open an issue on GitHub: Issues
- Include log files and error messages
- Describe steps to reproduce
Want to Contribute?
- Fork the repository
- Create feature branch
- Submit pull request
- Follow coding standards
# 1. Clone & Build
git clone https://github.com/irsyad-a/ArUco-Detec-Autonomous.git
cd ArUco-Detec-Autonomous
./scripts/run_rover.sh
# 2. Configure (optional)
nano config/rover_config.yaml
# 3. Run!
./scripts/run_rover.sh# Setup IP Webcam app on Android
./scripts/run_rover.sh http://192.168.1.100:8080/video# Setup Bluetooth
./scripts/setup_bluetooth.sh
# Test command
./scripts/send_char.sh w
# Run autonomous
./scripts/run_rover.sh- Line Following dengan white/yellow line detection
- ArUco Markers untuk waypoint navigation
- Obstacle Avoidance dengan real-time detection
- Smart Decision Making dengan state machine
- Multiple Camera Sources - Webcam, IP camera, video file
- Serial/Bluetooth Support - HC-05 integration ready
- YAML Configuration - Easy parameter tuning
- Modular Architecture - Easy to extend
- Real-time Logging - CSV decision logs
- Voice Feedback - eSpeak TTS notifications
- Debug Windows - HSV tuning, contour display
- Performance Metrics - FPS, decision timing
# Build & Run
./scripts/run_rover.sh # ⭐ Main launcher
./scripts/run_rover.sh <camera_url> # With IP camera
# Build Only
cd build
cmake .. # Configure
make autonomous_rover -j$(nproc) # Compile
# Direct Run
cd build
./autonomous_rover # Default camera
./autonomous_rover 0 # Webcam
./autonomous_rover /path/to/video.mp4 # Video file
./autonomous_rover <camera_url> # IP camera
# Bluetooth/Serial
./scripts/setup_bluetooth.sh # Setup HC-05
./scripts/send_char.sh <command> # Send command (w/a/s/d)
# Configuration
nano config/rover_config.yaml # Edit config
cp config/rover_config_examples.yaml config/rover_config.yaml| Document | Description |
|---|---|
| README.md | Main documentation (this file) |
| docs/ROVER_INTEGRATION.md | Complete integration guide |
| docs/ROVER_QUICK_START.md | Quick start guide |
| docs/STM32_INTEGRATION.md | STM32 programming & setup |
| docs/STM32_ELECTRICAL_GUIDE.md | Wiring & electrical setup |
| docs/PROGRAMMER_NEXT_STEPS.md | Development guide |
Autonomous Rover System
Line Following • ArUco Navigation • Obstacle Avoidance
git clone https://github.com/irsyad-a/ArUco-Detec-Autonomous.git
cd ArUco-Detec-Autonomous
./scripts/run_rover.shMade with ❤️ using OpenCV & C++
Last Updated: November 15, 2025 | Version 3.0.0