Loading repository data…
Loading repository data…
AleSMC / repository
Vehículo RC controlado vía WiFi (UDP) con transmisión de video en tiempo real. Firmware en C++ (PlatformIO) e interfaz de control en Python/OpenCV.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Hybrid WiFi RC vehicle with MJPEG video transmission and UDP control.
This project implements a remote-controlled rover using an ESP32-CAM (AI Thinker). The system operates under a "Solid Axle" topology (Unified Rear Traction) to ensure startup stability and resource efficiency, featuring Ackermann steering via a servo motor.
📌 Project Status: Archived / Completed. Phase A & Python Client v1.0 are fully functional. No active hardware development is planned as the physical prototype has been decommissioned.
Want to build this? Check out the complete hardware tutorial on Instructables.
ESP32-Video-Rover/
├── firmware/ # C++ Source Code (PlatformIO)
│ ├── src/ # Main Logic (.cpp)
│ ├── include/ # Headers (.h) and Configuration
│ ├── lib/ # Modular Libraries
│ │ ├── SolidAxle/ # Traction Driver (Solid Axle Topology)
│ │ ├── SteeringServo/ # Steering Driver (Ackermann Servo)
│ │ ├── NetworkManager/ # Connectivity Manager (WiFi STA/AP + mDNS)
│ │ ├── CameraServer/ # Video Driver (OV2640 + MJPEG Web Server)
│ │ └── RemoteControl/ # UDP Protocol & Failsafe Logic
│ ├── examples/ # Preserved Unit Tests (Motors, Servo, LED)
│ └── platformio.ini # Build Environment Configuration
├── software/ # PC Client (Python + OpenCV + UDP)
│ ├── modules/ # Decoupled Logic Modules
│ │ ├── __init__.py # Python Package Initializer
│ │ ├── KeyboardPilot.py # Keyboard Driver (pynput + Priorities)
│ │ └── VideoStream.py # Asynchronous Video Decoder (Threading)
│ ├── main.py # Main Executable (Control Loop)
│ └── requirements.txt # Dependencies (opencv, pynput, numpy)
├── docs/ # Technical Documentation, Diagrams, and Notes
└── README.md # This file
Platform: ESP32-CAM (AI Thinker Model) with modified external antenna. Traction Topology: Parallel (Solid Axle). Both rear motors receive the same PWM signal.
ℹ️ Full Details: See the setup guide, netlist, and warnings in docs/hardware_setup.md.
| Logic Signal | ESP32 Pin | L298N Connection | Technical Notes |
|---|---|---|---|
| PWM (Speed) | GPIO 13 | ENA + ENB | Bridged. Power Control (0-100%). |
| Dir Fwd | GPIO 14 | IN1 + IN3 | Bridged. Forward Gear. |
| Dir Rev | GPIO 15 | IN2 + IN4 | Bridged. Reverse Gear. |
| Steering Servo | GPIO 2 | PWM Signal | Shares line with Flash LED. |
| Reserved (R&D) | GPIO 12 | NC | Not Connected to avoid Boot Fail. |
Note: The Brownout Detector has been disabled in software to prevent resets caused by motor current spikes.
firmware/include/secrets_example.h to firmware/include/secrets.h and fill in your WiFi details.# From PlatformIO Terminal
cd firmware
pio run -t upload
If upload fails: Hold the IO0 button (or connect GPIO0 to GND) and press Reset before uploading.
To see debug logs (Assigned IP, Motor State):
pio device monitor -b 115200
rover.local.UDP_PORT in config).⚠️ SAFETY NOTE (REVERSE): Reverse logic is disabled in base firmware (Phase A) to prevent Back-EMF current spikes. Safe reverse implementation (with Dynamic Dead Time) is handled via the Python Client in advanced stages.
The Rover relies on a custom low-latency communication protocol designed to prioritize responsiveness over reliability, a standard approach in FPV robotics.
Unlike the video stream which uses HTTP (TCP), the control link utilizes UDP (User Datagram Protocol) over port 9999.
Byte[0]: Traction State (0=Coast, 1=Brake, 2-255=PWM Speed).Byte[1]: Steering Angle (0-180 degrees).| Key / Combination | Function | Mechanical Action | Technical Description |
|---|---|---|---|
| NONE (Release) | Inertia (Coast) | Motors Disconnected | High Impedance (Hi-Z). H-Bridge disables output. Current drops to 0A, allowing the rover to roll freely. |
| W | Forward | Normal Speed | Applies standard PWM duty cycle (e.g., ~70%) to the traction motors. |
| W + SPACE | Turbo Boost | Max Speed | Bypasses speed limiter, increasing PWM to 100% (255). Ideal for straightaways. |
| S | Reverse / Brake | Active Braking | Short Brake Mode. Driver pulls motor terminals to Ground (LOW/LOW), using Back-EMF to stop rotation. |
| A / D | Steering | Ackermann Turn | Maps Servo to STEERING_LEFT_MAX or RIGHT_MAX. Includes software end-stops. |
| ESC | Emergency Stop | System Halt | Sends a "Kill Signal" packet and terminates client connection. |
To prevent conflicting commands, the firmware implements strict Priority Logic:
S): Overrides acceleration. Safety first.A vs D): If both pressed -> Center (90°).W): Active only if Brake is released.9999 (Configurable).Byte[0] Traction: 0 (Coast), 1 (Brake), 2-255 (PWM Forward).Byte[1] Steering: 0-180 (Servo Angle).pynput (Hardware Input) supporting diagonals (W+A) and combos (Shift/Space).The Python client (software/main.py) is designed following Real-Time System patterns to decouple vision from control.
VideoStream.py)Unlike basic OpenCV examples that block the main loop, this system uses threading:
buffer_size=1). If processing is slow, it drops old frames to ensure we always see the "present".KeyboardPilot.py)Uses the pynput library:
S (Brake) > W (Throttle).Shift (Precision) > Space (Turbo) > Normal.The ESP32 has a single antenna (Half-Duplex). To prevent collisions between Video Upload and Command Download:
License: MIT License. See LICENSE file for full text.