AUTO · Group Project · 2026 S1

Five tasks.One robot.Real time.

A QBot Platform that follows a line, reads traffic signals, avoids obstacles, builds a live occupancy map, and stops at a coloured target — all driven by a Simulink behaviour-arbitration model on real hardware.

5
Behaviours
501×501
Grid px
8 min
Talk time
3 min
Demo cap
QBot Platform
RealSense D435
Leishen M10P LIDAR
LED [0 1 1] cyan
scroll

01 / THE PROBLEM

Five tasks to completein three minutes.

The course requires sequential autonomous operation through five distinct phases — from initial line detection through to target acquisition. All within a hard 3-minute run cap.

3 min
3-minute run cap
Hard limit — robot must complete all tasks
Demo course top-down view

Demo course — top-down view

01

Blue Line Follow

Detect the blue floor strip with the downward camera and follow it onto the course using proportional centroid control.

02

Build a Map

Fuse RealSense depth point clouds into a persistent 501×501 uint8 occupancy grid as the robot navigates.

03

Traffic Compliance

Detect red (stop) and yellow (slow) traffic signals with the forward RGB camera and respond with the correct motion command.

04

Obstacle Avoidance

Detect and avoid obstacles using depth imagery — with a 0.8-second reverse-escape manoeuvre for cornered situations.

05

Target Approach & Stop

Detect the pink target, approach it proportionally, and stop precisely when target area exceeds 1500 px².

02 / SYSTEM ARCHITECTURE

Four sensors.Five behaviours.One arbiter.

Every control tick, each behaviour module produces a wheel-velocity vector and a status flag. The arbiter selects exactly one winner and drives the motors. No behaviour holds the motors directly.

Sensors

Wheel Encoders
→ x, y, θ (Forward Kinematics)
RealSense Depth
→ local point cloud, obstacle avoidance
RealSense RGB
→ pink target, red/yellow traffic
Downward Camera
→ blue line follower
LIDAR
→ workspace log only (not navigation)

Behaviour Modules

Traffic (Red/Yellow)S1
Pink TargetS2
Obstacle AvoidanceS3
Blue Line FollowS4
Default Cruisealways
Occupancy Map
PC2Map fuses point clouds into a persistent 501×501 grid (20×20 m, ~4 cm/px)

Arbiter → Motors

Behaviour_Control
9 inputs → 1 winner
Output: [vL; vR]
QBot Motors
vL · vR → Stream Client

S2 == 2 (pink goal reached) sits above all flags — it fires a hard stop before any other behaviour can respond.

Why Subsumption?

Priority-based arbitration is deterministic and transparent — exactly one behaviour wins every tick with no ambiguous transitions. Easier to debug and tune than a state machine with explicit transition guards.

Two Sample Rates

Motor commands run at the QBot step size. Perception, mapping, and the arbiter run at 10× slower. Rate Transitions bridge the boundary — fast enough for smooth control, slow enough for vision processing.

LIDAR: Logged Only

LIDAR data is logged to workspace via To Workspace blocks but not used for navigation. Deliberate choice: the RealSense depth gives forward-facing obstacle data sufficient for the course, and fusing LIDAR mid-semester would have introduced more integration risk than gain.

03 / KINEMATICS & ODOMETRY

From encoder pulsesto world-frame pose.

Wheel encoder readings are zeroed at startup, scaled to arc lengths, smoothed by a 2nd-order low-pass filter, differenced to extract Δr and Δθ, then integrated into a continuous (x, y, θ) pose estimate.

Processing pipeline

  1. 1
    Wheel Encoders
    Position pair, zeroed at t = 0 via sample-and-hold
  2. 2
    × Wheel Radius
    r_wheel = 0.04445 m (Quanser spec) → arc lengths
  3. 3
    2nd-Order LPF
    Smooths quantisation noise independently on each wheel
  4. 4
    RL2Centre
    Differential drive geometry → Δr (linear), Δθ (heading)
  5. 5
    Integrate
    Three integrators → x, y, θ in world frame
QBot top-down kinematics view

Top-down — wheel separation visible

QBot isometric kinematics view

Isometric — drive train geometry

Wheel Velocity
v = ω × r
r_wheel = 0.04445 m
Centre Velocity
v_c = (v_R + v_L) / 2
RL2Centre block
Heading Rate
Δθ = (v_R − v_L) / L
L = wheel separation
Position Update
x += v_c cos θ · Δt
y += v_c sin θ · Δt
Integrated each tick
Low-pass Filter on Encoder Velocities

A 2nd-order discrete low-pass filter on each raw wheel velocity removes encoder quantisation spikes. Without it, the heading integrator accumulates micro-steps of noise that manifest as visible map drift after 2–3 m of travel.

04 / PERCEPTION PIPELINE

Same recipe for every colour.One map from depth.

All four colour behaviours share an identical 3-stage pipeline. The depth camera runs a parallel path that converts each frame into a local point cloud and fuses it into the persistent global grid.

Why chromaticity?

Standard RGB is sensitive to lighting changes — a well-lit pink card and a shadowed pink card have different R,G,B values. Chromaticity divides each channel by the total intensity, leaving only the colour ratio. The result is near-invariant to illumination, which was critical when the course lighting changed between calibration and demo day.

Normalisation formula
total = R + G + B + ε

r = R / total
g = G / total
b = B / total
ε prevents divide-by-zero on black pixels
Depth channel (blue line)

The RealSense D435 depth stream is reprojected into a local 3D point cloud each frame, then fused into the persistent 501×501 uint8 occupancy grid. New observations are blended with weight w = 0.01 to prevent single noisy frames from corrupting the map.

Blue intensity threshold: [80, 180] — raw intensity, not chromaticity, because the line colour is distinct enough in the brightness channel.
Pink (target)
Target approach
r[0.40, 0.49]
g[0.17, 0.27]
b[0.32, 0.34]
Triggers approach + stop
Red (traffic stop)
Traffic signal
r[0.78, 0.95]
g[0.00, 0.09]
b[0.04, 0.19]
Robot halts until signal clears
Yellow (traffic slow)
Traffic signal
r[0.47, 0.60]
g[0.31, 0.48]
b[0.01, 0.15]
Reduced speed, continues navigation
Blue (line)
Line following
rintensity
g[80, 180]
b
Raw intensity, not chromaticity
StopFlips Hysteresis — 0.3 s hold

When the pink target is visible on both sides, left/right oscillation can occur. A 0.3 s hold on the last steering command prevents the robot from flipping direction every tick.

05 / BEHAVIOUR ARBITRATION

One priority function.No ambiguity.

Every tick, the arbiter receives nine inputs — five velocity vectors, four status flags. Six lines of MATLAB select one winner. Priority is fixed: safety first, task second, nominal cruise as fallback.

1
Pink Goal Reachedsafety
Condition: S2 == 2
Output: V = [0 0]′ (full stop)
Highest-priority flag. Once the pink target area exceeds 1500 px², the robot is commanded to zero velocity permanently. No behaviour can override this.
2
Traffic (Red / Yellow)safety
Condition: S1 == true
Output: V = V1 (stop or slow)
Red signal → V1 = [0 0]. Yellow signal → V1 = reduced cruise. Both detected via forward RGB camera chromaticity.
3
Pink Target Approachtask
Condition: S2 == 1
Output: V = V2 (proportional steer)
Proportional controller steers toward centroid of pink mask. Centroid offset → differential wheel speed.
4
Obstacle Avoidancetask
Condition: S3 == true
Output: V = V3 (steer or reverse)
Far threshold (0.8 m) triggers steer-around. Close threshold (0.5 m) triggers reverse-escape: 0.8 s timed reversal toward the more open side.
5
Blue Line Followtask
Condition: S4 == true
Output: V = V4 (centroid track)
Centroid of blue mask drives proportional correction. BlueLock flag and last_turn memory handle momentary line loss.
6
Default Cruisenominal
Condition: else
Output: V = V5 (constant forward)
Fixed-speed forward drive when no other behaviour fires. Keeps the robot moving between task phases.
Reverse Escape Logic

When an obstacle is too close to turn around, the controller enters reverseMode. It backs up for 0.8 s, choosing direction based on which side has more clearance, then resumes forward navigation.

reverseModebool — currently reversing
reverseStarttimestamp — when reverse began
escapeDir±1 — locked on entry
duration0.8 s timed escape
Blue Line Follower State

The blue line follower uses a BlueLock flag and last_turn memory to handle intersections and momentary line loss. Once locked onto the line, it stays committed until task completion.

BlueLockbool — line acquired
last_turnmemory — last steering direction
priority4 of 5 — below stop/task/obstacle
Design Tradeoff: Obstacle < Pink

Obstacle avoidance sits at priority 3, below pink approach (priority 2). This means a pink target approaching from the side can interrupt an avoidance manoeuvre. Deliberate choice: if the robot is already close enough to see pink, it is past the obstacle that triggered avoidance, so task completion wins.

06 / PARAMETER JUSTIFICATION

Every number has a reason.

These are not defaults. Each value was taken from the Quanser hardware specification or tuned through iterative lab testing. The rationale column records what we tried first.

ParameterValueUnitDescriptionCategory
r_wheel0.04445mWheel radius — encoder pulse → arc length. Quanser QBot Platform spec, verified by square-path test.Platform
L_wheel0.3928mWheel base — arc → heading change in RL2Centre differential drive model.Platform
v_cruise4rad/sDefault cruise speed (V5). Balance of run time vs odometry accuracy — 6 rad/s increased mapping artefacts noticeably.Control
w_localmap0.01Map update weight. Low weight prevents one noisy frame corrupting the grid. 0.2 caused severe artefacts in W12 lab.Mapping
wall_pad5×5pxNeighbourhood thickening on each occupied cell. Robot is ~4.5 px wide at 4 cm/px — 5×5 ensures planner clearance.Mapping
map_size501×501pxOccupancy grid dimensions. Covers 20×20 m at 4 cm/px resolution.Mapping
d_close0.5mClose obstacle threshold — triggers reverse-escape. Within braking distance at cruise speed.Behaviour
d_far0.8mFar obstacle threshold — triggers steer-around. 1.0 m steered too early and caused overcorrection on the wide course.Behaviour
t_reverse0.8sReverse-escape duration. Long enough to back out of a box corner at cruise speed. 0.5 s re-detected the same obstacle.Behaviour
t_stopflips0.3sStopFlips hysteresis. Holds last steering command before allowing a left↔right flip. Eliminates oscillation on centre obstacles.Behaviour
A_goal_pink1500px²Pink target area stop threshold. ~0.5 m standoff at typical target size. 800 → too far; 2000 → too close.Colour
A_min_pink50px²Minimum pink area for confident detection. Below this, centroid is unreliable.Colour
A_min_blue570px²Blue line minimum area before line-loss recovery. 300 triggered recovery too often on faded floor markings.Colour
blue_deadzone±5pxCentroid deadzone before proportional correction activates. ±5 px ≈ 3° heading error. ±2 caused snaking.Colour
r_pink[0.40–0.49]Pink chromaticity r-channel range.Colour
r_red[0.78–0.95]Red (stop signal) chromaticity r-channel range.Colour
r_yellow[0.47–0.60]Yellow (slow signal) chromaticity r-channel range.Colour
blue_intensity[80–180]Blue line raw intensity threshold (not chromaticity). Downward camera channel.Colour

18 of 18 parameters shown

07 / RESULTS & IMPROVEMENTS

What worked.What didn't.What's next.

Results will be updated after the Week 14 demo run. Task scorecard, timing, and map screenshots are placeholders pending the live evaluation.

Task Scorecard

TaskMetricResultStatus
Blue Line FollowLine acquired + followedTBDTBD
Occupancy MappingGrid populated, no artefactsTBDTBD
Traffic ComplianceStop on red, slow on yellowTBDTBD
Obstacle AvoidanceNo contact with obstaclesTBDTBD
Target Approach & StopStop ≤ 0.5 m from pinkTBDTBD

Timing Breakdown

~5 s
Line acquisition
From start to BlueLock
~8 s
First map update
After exiting blue line section
~30 s
Traffic zone
Variable — depends on signal duration
~20 s
Obstacle section
Nominal; reverse-escape adds ~2–3 s
~15 s
Pink approach
Proportional closure from far-field
< 3 min
Total
Hard limit
Lessons Learned
1

A map update weight of 0.01 sounds tiny but accumulates reliably over multiple passes — starting at 0.2 was our biggest early mistake.

2

The StopFlips hysteresis was not in the original design. One lab run revealed left-right oscillation so severe the robot barely moved. 0.3 s fixed it immediately.

3

LIDAR is already wired — we just don't fuse it. Every future team should fuse it from day one for full 360° awareness.

4

Chromaticity is genuinely robust to lighting. We tested under three different lab lighting conditions and the same thresholds worked each time.

5

The reverse-escape direction lock (escapeDir chosen once on entry) is critical. Without it, the robot re-evaluates each tick and spins in place rather than escaping.