← Back to panelCase file · ST-05
Proving every metre got rolled

Roller Compaction

RoleLead dev · ingestion → processing → map
PeriodApr 2026 – now
Stack size14 parts
m pass-count grid

Road rollers carry RTK GPS and vibration sensors. I built the pipeline that takes their packets through Kafka into Postgres, and the service that turns each track into a pass count for every square metre of road.

What was broken

A road layer is only as good as its compaction, and departments had to take the contractor's word for how many passes the roller made. GPS tracks exist, but raw points jitter and repeat, which makes them useless as proof.

What I built

  1. 01An ingestion gateway: rate limit per device, Redis dedupe, publish to Kafka.
  2. 02A Kafka batch consumer into monthly Postgres partitions, with a dead-letter table and a live SSE stream.
  3. 03A compaction engine over gRPC: Kalman smoothing, UTM, a 2.5 m drum swept over a 1 m grid. AI-assisted, then debugged by hand.
  4. 04A compaction API with caching and API keys, and a React live map with track replay.
  5. 05A Python load simulator: many fake rollers posting RTK batches at once.
processing stages per track
engine unit tests
compaction API endpoints

How data moves

SCHEMATIC · ROLLER COMPACTION● SIGNAL
RollerRTK GPS · vibrationReceiverdedupe · rate limitKafkaRTK topicConsumerbatch · DLQPostgreSQLmonthly partitionsLive mapSSE · replayEnginegRPC · 1 m gridCompaction APIcache · API key

What broke, and how it holds now

INCIDENTST-05 · what broke

Dead browser tabs held the stream open.

The live map used Server-Sent Events with no timeout. Closed tabs left emitters behind, and every write to them threw. I gave each emitter a 30-second timeout, sent heartbeat comments, and caught the send errors and timeouts so the browser's EventSource simply reconnects.

Replay · break it yourself
40 m stretch · 1 m grid · 2.5 m drum · spec: 4 passes● 123 CELLS FALSELY PASSED
Real passes · every cell3
Cells counted ≥ 4123
Cells miscounted141 / 200

The roller made exactly 3 passes over every cell, one short of spec. Green cells are ones the count says are finished. Raw GPS wanders and resent packets look like the roller reversing, so cells pick up passes that never happened. The real engine smooths the track and drops repeats before it counts anything.

What people see

Stack

  • Spring WebFlux
  • Kafka
  • Redis
  • Bucket4j
  • PostgreSQL
  • SSE
  • Python
  • gRPC
  • NumPy
  • filterpy
  • Shapely
  • React
  • Google Maps
  • Docker
Next case file · ST-06Plant Edge Boxes →Pis that keep every batch offline