Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for Autonomous Mine Countermeasure Robot via Webots & OpenCV
Inspiration
Autonomous Guided Vehicles (AGVs) must operate reliably in hazardous environments without relying on heavy, resource-intensive computational hardware. This project was inspired by the challenge of building a highly responsive, tactical mine-clearing robot using lightweight, classical computer vision techniques rather than heavy deep-learning models. The goal was to see how far we could push real-time sensor-to-actuator control loops using deterministic algorithms in a simulated environment.
What it does
The primary mission of the robot is simple yet critical: Evade the blue obstacles (mines/hazards) and successfully navigate toward the red targets. Operating within the Webots simulation framework, the robot uses a real-time camera stream to actively track red targets. However, safety comes first—powered by a custom, priority-based finite state machine (FSM), the robot's control system instantly interrupts target tracking to execute emergency evasive maneuvers whenever a blue hazard blocks its path, prioritizing survival over mission progression.
How we built it
- Real-Time Image Processing Pipeline: Developed a low-latency data pipeline that captures raw byte streams from the e-puck differential drive robot's camera, converting them into multi-dimensional NumPy matrices for real-time OpenCV processing.
- HSV Color Space Segmentation: Implemented robust HSV color masking using
cv2.inRangefunctions to separate the dynamic objects, isolating "Red" for target acquisition and "Blue" for hazard avoidance. - Spatial Moments & Distance Filtering: Utilized spatial moments (
cv2.moments) to compute the object’s centroid (M₀₀ and M₁₀) for real-time X-coordinate tracking. The zeroth moment (M₀₀) acts as a scalar proximity filter to dynamically estimate how close a hazard or target is based on its perceived pixel area. - Priority-Driven State Machine: Designed a hard-coded decision loop where steering and velocity vectors (
setVelocity) dynamically override target tracking. If a blue obstacle's pixel area crosses a critical threshold (>3500 pixels), target tracking is immediately suspended until the path is clear. - Dynamic Velocity Scaling: Integrated an interactive OpenCV Trackbar interface to dynamically calibrate linear and angular velocity limits during runtime.
Challenges we ran into
Operating in a dynamic simulation environment brought real-world computer vision challenges that directly impacted the robot's core mission:
- The Giant Blue Blindspot (FOV Saturation Bug): We hit a major limitation when a blue obstacle got too close or was too large. As the blue object filled the frame, its boundary pixels hit the edge of the camera's narrow Field of View (FOV). This geometric saturation broke the contour integrity, causing
cv2.momentsto fail. Paradoxically, the robot would suddenly become "blind" to the blue hazard when it was closest to it, causing it to stop evading. - False Red Targets (Z-Axis Ground Texture Noise): Under specific illumination angles within Webots, the ambient floor texture reflected light in a way that bled directly into the red target HSV threshold parameters. This created background noise, causing the robot to mistakenly identify the ground plane as a red target and attempt to drive straight into the floor.
Accomplishments that we're proud of
We are incredibly proud of building a fully responsive, closed-loop control system that seamlessly translates raw camera pixel coordinates into real-time differential drive motor velocities. Achieving this fluid, real-time prioritization—where the robot successfully drops its red target lock to dodge a blue hazard and immediately resumes its mission afterward—was a massive milestone.
What we learned
This project provided deep insights into the fragility of deterministic computer vision. We learned firsthand how easily environmental noise, dynamic lighting, and camera FOV limitations can disrupt an autonomous vehicle's decision-making system. It taught us that writing a script that works on a perfect image is easy, but making it work on a moving robot in a changing world is the real engineering challenge.
What's next for Autonomous Mine Countermeasure Robot via Webots & OpenCV
The next phase of development involves deploying an adaptive thresholding pipeline or a lightweight shadow-removal filter to completely eliminate the ground texture bugs. Furthermore, we aim to integrate an Extended Kalman Filter (EKF) combining IMU data to minimize odometry drift, alongside a basic SLAM mapping algorithm using LiDAR to allow the robot to accurately map the minefield while safely avoiding hazards.
Log in or sign up for Devpost to join the conversation.