System Architecture
The robotic arm system follows a modular, event-driven architecture with clear separation of concerns. The system is built using Python and communicates with the VEX robotic arm hardware through serial communication.Architecture Diagram
Core Modules
Robot Controller (main.py:8-276)
The central control system that orchestrates all operations:
Communication Module
CommunicationManager (communication/serial_manager.py:16-236) handles:
- Serial communication with VEX Brain
- Camera integration
- Object detection coordination
- Event-driven message processing
Perception Module
Composed of:- CameraManager (
perception/vision/camera/main.py:5-29) - Image capture - ImageProcessor (
perception/vision/image_processing.py:8-95) - Detection pipeline - DetectionModel (
perception/vision/detection/main.py:15-22) - YOLO11 inference
Mapping Module
OccupancyGrid (mapping/occupancy_grid.py:5-111) provides:
- Probabilistic occupancy mapping
- Bayesian sensor fusion
- World-to-grid coordinate transformations
Data Flow
Message Protocol
All communication uses JSON messages over serial:Threading Model
The system uses multiple threads for concurrent operations:Communication Thread (serial_manager.py:68-69)
_read_loop continuously monitors the serial port for incoming messages from the VEX Brain.
Detection Thread (serial_manager.py:153)
Thread Synchronization
Events coordinate between threads:The daemon thread ensures clean shutdown when the main program exits.
State Management
The system maintains multiple state dictionaries:Module Dependencies
Design Patterns
Observer Pattern (Callbacks)
The callback system allows decoupled event handling:Event-Driven Architecture
Events signal completion of asynchronous operations:State Machine Pattern
Movement execution follows a state machine:The architecture prioritizes safety with timeout handling and error recovery mechanisms throughout the system.
Error Handling
Each module implements robust error handling:Next Steps
Communication
Learn about serial protocol and message handling
Perception
Explore vision and object detection systems
Control
Understand movement execution and sequencing
Mapping
Dive into occupancy grid mapping