DOC Technical Documentation

How DriveLink actually works.

A deep, honest walk through the DriveLink ecosystem — the simulation engine, the machine-learning decision models, the V2V/V2I communication layer, and the conflict-detection math behind it all.

0ML decision models
0Input features
0.00Held-out accuracy
<0msV2V delivery
01 · System

System architecture

DriveLink is two cooperating halves: a real-time decision backend, and a simulation client that consumes its decisions. The same models and inference code are shared — unchanged — between gameplay and research.

train_models.pyGenerate perception-based data, fit & persist
models/*.pklThree serialized RandomForests
model_manager.pyLoad, validate input, predict + confidence
ml_server.pyWebSocket inference on ws://:8765
Godot clientcar_state → acts on MERGE / WAIT

On-Vehicle Module

Reads bus telemetry, performs local trajectory prediction, and emits compact intents — designed to sit on top of an existing ADAS stack.

DriveLink Protocol

An intent-first V2V message standard: small payloads, gossip-friendly mesh, sub-50 ms delivery between neighbouring vehicles.

Intelligence Layer

Fleet & city analytics: conflict-zone detection, intent heatmaps, and OEM-grade insight pipelines built on aggregated intents.

02 · Methodology

Simulation methodology

Instead of learning from hidden ground truth, every model is trained on what a car actually perceives — a coherent perception-based agent.

Each model is fit on a small micro-simulation where vehicles decide with a single, legible rule: move toward the target lane when the move is needed, the perceived gap is large enough for this driver's aggressiveness, and there is enough urgency.

The label is derived from perceived_gap — a continuous distance in metres that matches exactly what the Godot client sends at runtime — with a small Gaussian perception jitter so the returned confidence stays smooth and well-calibrated. This removes the artificial noise ceiling of random-data approaches and yields a clean decision boundary at roughly 0.99 held-out accuracy.

Models, model_manager.py, and the WebSocket server are shared unchanged between the gameplay path and the SUMO research harness — inference is never reimplemented.
Feature vector · 5 dimensions
FeatureTypeRangeMeaning
speedfloat0–25 m/sCurrent velocity of the vehicle.
urgencyfloat0–1How critical the maneuver is (0 = relaxed, 1 = critical).
aggressivenessfloat0–1Driver personality (0 = cautious, 1 = aggressive).
rel_targetint−2…+2Lanes to target relative to current (−1 left, +1 right).
perceived_gapfloat0–40 mDistance to nearest car in the target lane. Larger ⇒ more likely to merge.
03 · Traffic

Traffic modeling & realism

The defensible-realism path: run the same DriveLink policy inside SUMO with validated dynamics, then measure the resulting traffic against real-world trajectory data.

DriveLink highway simulationHighway scene — live lane-change & V2V negotiation in the Godot client.

Longitudinal motion uses the Intelligent Driver Model (IDM) — a continuous car-following model that brakes for the leader and accelerates toward a desired speed using a safe time-headway. Lateral decisions follow LC2013-style lane-change logic: change only when there is an incentive and a safe gap.

In the research harness, SUMO supplies the validated dynamics while DriveLink supplies the policy (when to act). Resulting trajectories are scored against public datasets such as HighD and NGSIM to quantify how human-like the emergent traffic is.

IDM car-following
LC2013 lane changes
SUMO microsimulation
HighD / NGSIM metrics
Want to feel it rather than read it? The runs the same car-following, negotiated lane changes, merge gate and conflict heatmap, client-side.
04 · Communication

V2V & V2I concepts

Vehicles broadcast compact intents to their neighbours (V2V) and to roadside infrastructure (V2I). Cooperation is negotiated, not commanded.

Vehicle-to-Vehicle (V2V)

Each car emits an intent packet — its pose, motion, a short probabilistic prediction cone, and a proposed action — to vehicles within mesh range. When one car wants a gap, the relevant neighbour can yield a slightly smaller gap, turning a standoff into a smooth cooperative merge.

Vehicle-to-Infrastructure (V2I)

Roadside / intersection mesh nodes ingest the same intents to coordinate right-of-way, surface conflict-zone heatmaps, and feed city-scale analytics back to fleets and OEMs.

ws://:8765 · DriveLink wire protocolJSON
// request — car asks the mesh/brain for a decision
{
  "type": "predict_v2v",
  "car_state": {
    "speed": 18.4,          // m/s
    "urgency": 0.7,
    "aggressiveness": 0.4,
    "rel_target": -1,       // wants the left lane
    "perceived_gap": 6.2    // metres
  }
}

// response — calibrated decision + confidence
{
  "type": "prediction",
  "scenario": "v2v",
  "result": {
    "action": "NEGOTIATE_MERGE",
    "confidence": 0.93
  }
}
05 · Safety

Conflict detection & risk analysis

A continuous risk field over the road surface highlights where vehicles are most likely to interact dangerously — the basis of the live conflict heatmap.

For every pair of nearby vehicles DriveLink computes a risk score from three signals:

  • Proximity — closer longitudinal gaps raise risk as the gap shrinks toward the vehicle length.
  • Closing speed — a faster follower (rear-end risk) or converging trajectories increase severity.
  • Maneuver state — an active lane change or an unresolved on-ramp merge amplifies side / merge risk.

High-risk pairs become conflict zones: pulsing hotspots rendered as a heatmap, mirroring the conflict-zone detection that the Intelligence Layer surfaces at city scale.

Rear-end risk
Side / merge risk
TTC-weighted
Heatmap overlay
Intersection conflict zonesMulti-junction grid — per-junction right-of-way & reservation prevent overlaps.
06 · Models

The decision models

All three are RandomForest classifiers taking the same 5 features and outputting a binary act / don't-act decision plus a calibrated confidence.

ModelArtifactDecisionTrained on
Lane changemodel_lane_change.pklMERGE / WAITGeneral lane-changing in multi-lane flow
Turning (exit)model_turning.pklMERGE / WAITReaching an exit lane before the exit
V2V chatmodel_v2v_chat.pklNEGOTIATE_MERGE / HOLDCooperative merge where a neighbour yields

RandomForest

Lightweight, fast, and interpretable — ideal for edge inference and easy to reason about for safety review.

Calibrated confidence

Perception jitter during training keeps probabilities smooth, so the confidence sent to the client is meaningful.

Robust I/O

Missing features get safe defaults and numeric coercion, so partial payloads from the client never crash the server.

07 · Source

Open repositories

The simulation client and the decision brain are public. Stats are pulled live from GitHub.

Isometric V2V highway & intersection simulation in Godot 4.6, driven live by the DriveLink ML model over a WebSocket protocol. Everything is drawn in code, with a local-heuristic fallback so it runs with the server off.

GDScript 100.0%
0 0 0
  • Highway lane-change + V2V negotiation scenes
  • Multi-junction turning grid with right-of-way
  • Physics-gated merges (no merge into an occupied gap)
  • WebSocketPeer client to the ML decision server

The decision brain: lightweight RandomForest models that decide when a car changes lane, takes an exit, or negotiates a merge — served in real time over WebSocket, and validated in SUMO against real-world trajectory data.

GDScript 62.0%Python 38.0%
0 0 0
  • Three RandomForest policies (lane-change, turning, V2V chat)
  • Real-time WebSocket inference server (ws://:8765)
  • Perception-based training data (~0.99 held-out accuracy)
  • SUMO research harness (IDM + LC2013) for realism metrics
08 · Roadmap

Where this is going

From a validated simulation today to an on-vehicle, city-scale cooperative mesh.

Phase 1Shipped

Perception-based ML + Godot sim

Three RandomForest policies trained on perceived gaps; live WebSocket inference driving the Godot highway & intersection scenes.

Phase 2In progress

SUMO realism validation

Run the same models as a vehicle policy inside SUMO (IDM + LC2013) and score resulting traffic against HighD / NGSIM trajectory data.

Phase 3Planned

On-vehicle edge module

Lightweight hardware + embedded inference reading bus telemetry at 100 Hz across 12 signals.

Phase 4Planned

V2I mesh & intent heatmaps

Roadside / intersection nodes aggregate intents into conflict-zone heatmaps and city-grade insight pipelines.

Phase 5Planned

OEM SDK & fleet analytics

Per-vehicle licensing on top of existing ADAS stacks, with fleet APIs and cross-OEM cooperation studies.

07 For investors & partners

Build the automotive AI backbone with us.

“Investors, OEMs, fleets, and mobility partners — let's set the standard for cooperative mobility.”

Request investor deck
tech.drivelink@gmail.com·drivelink.tech·Bangalore, India