Quadruped Behaviour Architecture — Senithu Dampegama
SYS-02 / FLAGSHIP 5-PERSON TEAM — OWNERSHIP SHOWN CDIO / SCRUM 2026

QUADRUPED
BEHAVIOUR ARCHITECTURE.

A four-legged walking robot with biologically-inspired behaviours: walk, avoid obstacles, seek light, and react to predators. I owned the sprint that turned assembled hardware into an autonomous system — and the leg mechanism that makes it walk.

GAIT / CRAWL — STATICALLY STABLE MODULES / 08
PHYSICAL PLATFORM — LOCOMOTION TEST
Quadruped locomotion assembly in NVIDIA Isaac Sim
SIMULATION — NVIDIA ISAAC SIM, GAIT DESIGNED HERE FIRST
FIRMWARE
8 MODULES · ~1,700 LINES MICROPYTHON
GAIT
CRAWL — FL → RR → FR → RL
COMPUTE
RASPBERRY PI PICO + PCA9685 I²C
SIMULATION
NVIDIA ISAAC SIM — GAIT FROM SCRATCH
TECHNICAL DOSSIER SCRUM_PROJECT / QUADRUPED
01 — MISSION

Build an autonomous quadruped that walks on servo-driven legs and demonstrates four biologically-inspired behaviours in a controlled test environment.

LOCOMOTION OBSTACLE AVOIDANCE PHOTOTAXIS — STOP ~20 CM PREDATOR RESPONSE — HALT + WINGS
02 — CONSTRAINTS
PROCESSCDIO framework, Scrum-managed: five sequential one-topic sprints, each with its own Scrum Master, mirroring real engineering dependencies.
COMPUTERaspberry Pi Pico running MicroPython — every behaviour shares one small microcontroller.
ACTUATION10× SG90 + 2× MG996R servos through a PCA9685 I²C driver — 8 leg joints with per-servo mechanical variation.
TEAM BOUNDARYFive people, divided ownership — my scope below is exactly what I authored, no more.
03 — MY OWNERSHIP
TEAM SIZE / 05
ROLE / SCRUM MASTER — SPRINT 4: PROGRAMMING & BEHAVIOUR CONTROL (2 WEEKS)
OWNERSHIP / FULL FIRMWARE STACK · BEHAVIOUR ARBITRATION · GAIT DESIGN + ISAAC SIM · LEG & LOCOMOTION CAD · REPOSITORY INTEGRATION
SPRINTFOCUSSCRUM MASTER
01CAD Design — 4 weeksDhanip Modi
02Electronics Integration — 2 weeksAdwil Joshy
03Robot Build — 1 weekDinuli Jayaweera
04Programming & Behaviour Control — 2 weeksSenithu Dampegama
05Testing & Validation — 1 weekMisba Babu

Outside the software sprint, I independently designed the leg and joint mechanism — hip, knee, ankle, left/right legs and the locomotion sub-assembly with its engineering drawing — and managed the repository structure and the majority of its commit/PR history.

04 — SYSTEM ARCHITECTURE

A priority-based arbitration loop over adapter-wrapped behaviours. Every behaviour exposes check() / execute(); higher priorities interrupt lower ones — a detected predator halts a walk cycle mid-stride.

main.py / architecture.py
Behaviour arbitration layer — priority loop, adapter pattern (LocomotionAdapter, PhototaxisAdapter…), interruption semantics
locomotion.py
QuadrupedLocomotion gait engine — 4 legs × 2 servos via PCA9685, per-leg JSON calibration, crawl sequence, walk_forward_interruptible() API
light_sensor.py / bh1750.py
Phototaxis — directional “leak” signal from BH1750 lux readings, steer to light, stop at target distance
obstacle_avoidance.py · predator_avoidance.py
Ultrasonic threshold detection · dual-sensor rapid-motion/proximity predator trigger · SharedUltrasonicReader classifying CLEAR / OBSTACLE / PREDATOR / BOTH
calibration.json + tooling
Per-leg home angles and direction signs tuned without touching code
CRAWL GAIT — ONE LEG MOVES AT A TIME FL → RR → FR → RL
FL
FR
RL
RR

Statically stable: three feet planted at all times. Sequence and per-leg timing iterated in Isaac Sim, then transferred to the physical calibration.

05 — ENGINEERING DECISIONS
Simulate before stressing hardware.

The gait was designed from scratch in NVIDIA Isaac Sim — leg-swing timing, stride sequencing and stability iterated in simulation rather than tuned blind on servos. The crawl sequence and per-leg timing came out of that loop.

Priorities, not flags.

One arbitration loop owns the robot. Behaviours don't negotiate with each other — they declare priority, and the loop interrupts lower-priority work cleanly, including mid-stride.

One reader for shared sensors.

Obstacle and predator logic consume the same SharedUltrasonicReader instead of polling sensors twice — one source of truth classifying CLEAR / OBSTACLE / PREDATOR / BOTH.

Calibration is data, not code.

Per-leg home angles and direction signs live in calibration.json with a tuning utility — servo replacement or mechanical drift never requires a firmware edit.

06 — FAILURE MODES
SERVO ALIGNMENT DRIFT
Eight joints with different home positions and sign conventions — solved with the per-leg JSON calibration system and tooling rather than hard-coded offsets.
BLIND MID-STRIDE HAZARDS
A conventional blocking gait loop can't react while a leg is in the air — the interruptible walk API lets predator and obstacle responses pre-empt a stride safely.
DUPLICATE SENSOR POLLING
Two behaviours polling the same ultrasonics caused timing contention — replaced with the shared reader utility and a single classified state.
LINE / BACKGROUND AMBIGUITY (LIGHT)
Raw lux readings alone were noisy for steering — the directional leak computation and thresholds were tuned on the bench before integration.
07 — VALIDATION SPRINT 5 TEST FOOTAGE — ALL FOUR BEHAVIOURS
T-01 / LOCOMOTION — CRAWL GAIT ON HARDWARE
T-02 / OBSTACLE AVOIDANCE — ULTRASONIC THRESHOLD
T-03 / PHOTOTAXIS — SEEK LIGHT, STOP AT DISTANCE
T-04 / PREDATOR RESPONSE — HALT + DEPLOY WINGS
08 — PHYSICAL BUILD & SIMULATION
Single leg mechanism simulated in Isaac Sim
ISAAC SIM — SINGLE-LEG SWING TIMING
Isaac Sim environment during gait iteration
ISAAC SIM — GAIT ITERATION SESSION
Senithu soldering the light sensor subsystem at the bench
BENCH — LIGHT-SENSOR SUBSYSTEM BRING-UP
Senithu testing the motor controller
BENCH — MOTOR-CONTROLLER TESTING
System block diagram
ORIGINAL ARTEFACT — SYSTEM BLOCK DIAGRAM
Electronics circuit diagram
ORIGINAL ARTEFACT — CIRCUIT DIAGRAM
09 — OUTCOME

The behaviour stack was delivered on time for the validation sprint, and the robot demonstrated all four behaviours on hardware — walking with the crawl gait, avoiding obstacles, steering to light, and interrupting everything for a predator response.

10 — NEXT REVISION
IMU feedback for gait stability instead of purely open-loop timing
Faster gaits (trot) once closed-loop stability exists
Sim-to-real workflow formalised — Isaac Sim scenes versioned with firmware