Introduction
The Robotics Integration system provides hardware control and sensor management for the Trash Classification AI System. Built on the VEX IQ2 platform, it enables precise manipulation of objects and real-time environmental scanning through a coordinated robotic arm.VEX Controller Capabilities
The system leverages VEX IQ2 hardware to provide:- 4-Axis Robotic Arm Control: Base rotation, shoulder, elbow, and gripper motors
- Multi-Sensor Integration: Distance sensors, bumper switches, inertial measurement unit, and LED indicators
- Real-time Processing: Immediate sensor data processing and motor control responses
- Serial Communication: JSON-based protocol for Raspberry Pi integration
System Services
The robotics controller provides three core services managed by theRoboticServices class:
Check Service
Validates all motors and sensors are properly installed and operational before system startup
Safety Service
Performs sequential safety checks on shoulder and gripper mechanisms with emergency stop capabilities
Scan Service
Executes 360° environmental scan to detect and map objects with position and size data
Service Architecture
All services communicate via JSON messages over serial connection:Hardware Components
Motors (Port Configuration)
| Motor | Port | Function | Direction |
|---|---|---|---|
| Base Motor | PORT1 | 360° rotation for scanning | Reversed |
| Shoulder Motor | PORT2 | Vertical arm positioning | Reversed |
| Elbow Motor | PORT3 | Arm extension/retraction | Reversed |
| Gripper Motor | PORT4 | Object grasping | Reversed |
Sensors (Port Configuration)
| Sensor | Port | Function | Range |
|---|---|---|---|
| Gripper Distance | PORT7 | Object detection in gripper | 0-400mm |
| TouchLED | PORT10 | Visual status indicator | RGB color |
| Base Distance | PORT11 | Environment scanning | 50-300mm detection zone |
| Bumper | PORT12 | Shoulder collision detection | Binary pressed/not pressed |
| Inertial | Built-in | Rotation angle tracking | 0-360° |
LED Status Indicators
The system uses the TouchLED sensor for visual status feedback:| Color | Status | Meaning |
|---|---|---|
| Red | ERROR | System error or emergency stop activated |
| Orange | WARNING | Safety check in progress |
| Green | READY | System operational and ready |
| Blue | RUNNING | Active scanning or operation |
| Cyan | OBJECT_DETECTED | Object detected within range |
Module Architecture
The robotics system is organized into specialized modules:Quick Start
The VEX controller runs MicroPython and requires the VEX library. Ensure all hardware is properly connected before running services.
Next Steps
Arm Controller
Detailed RoboticServices class documentation
Serial Communication
JSON protocol and message handling
Safety System
Safety checks and emergency procedures