Automotive · RoboticsROS 2 HumbleOpenCVFail-safe

Vision guidance must know when the vehicle should stop.

The project refactors a ROS 1 single-file prototype into a ROS 2 Humble package with red/blue cone perception, non-blocking PID, chassis command adapters, mission states, camera watchdogs, emergency stop, and explicit fault reset.

Overview & context

Accurate tracking is not enough; the control chain must own failure.

Outdoor cone courses bring lighting changes, shadows, occlusion, single boundaries, camera interruption, and chassis protocol differences.

Problem

Continuing to drive after target or camera loss turns a perception problem into a safety problem. A single loop mixing perception, control, mission, and ROS communication is also difficult to test and tune.

Architecture

A single authority from image input to safe command output.

Each layer owns one core responsibility; parameters live in YAML.

01 · IMAGECamera Topic

Receive images and monitor startup/runtime timeouts.

02 · PERCEPTIONCone Boundaries

Segment colors, filter contours, estimate center and confidence.

03 · CONTROLPID & Limits

Compute steering, limit speed, and handle lost targets.

04 · MISSIONState Machine

Mapping, red light, navigation, parking, and safety states.

05 · OUTPUTTwist / PWM

Publish chassis commands and debug topics from one point.

Technical decisions

Remove stale state and competing command writers before chasing speed.

01

Confidence with perception

Dual- and single-boundary estimates use different rules and temporal smoothing.

02

Single command authority

Steering, speed, mission, and safety state are combined at one output.

03

Explicit adapter semantics

Standard Twist and legacy PWM modes remain clearly distinct.

04

Edge-triggered mission events

Lights, laps, parking, and e-stop events avoid repeated transitions.

Results

A modular ROS 2 stack with explicit safety test entry points.

4 core modulesPerception, control, mission, and ROS integration
2 outputsStandard Twist and legacy chassis PWM modes
Fail-safeWatchdogs, target loss, e-stop, and explicit reset
Validation boundary: the public repository states that the project has not been verified on the author's physical chassis, camera, and driver board. Software completion is not presented as a race result.
OPEN SOURCE

Review parameters, nodes, and the safety state machine.

The repository includes the ROS 2 package, YAML parameters, launch files, Python tests, and GitHub Actions.

Open GitHub