Cooperative Driving¶
The emergency-braking scenario runs end to end: Tutorial 2: CARLA Braking Experiment. V2V and V2I scenarios are documented in Tutorial 7: V2V and V2I Experiments.
Research question¶
How much does vehicle-to-vehicle or vehicle-to-infrastructure communication improve safety outcomes under varying network conditions?
Layers involved¶
Data Source — CARLA 0.9.10 simulator with ScenarioRunner
Processing Core — braking pipeline (detect → ROI-gate → brake decision)
NetWaggle — link between the client and server nodes
Analysis — per-frame latency, braking reaction time, collision outcome
What to configure¶
The V2V experiment uses a constant 20 ms delay for the DSRC 802.11p baseline:
docs/snippets/v2v-constant-link.yaml¶# V2V DSRC baseline: constant 20 ms message-level delay (802.11p).
# Passes cadet validate.
extends: ../../configs/base.yaml
experiment: {name: snippet_v2v_constant, app: reference, repetitions: 1}
source: {kind: synthetic, count: 8, width: 64, height: 48}
nodes:
- {name: client, host: localhost, role: client, device: cpu}
- {name: server, host: 127.0.0.1, port: 15013, role: server, device: cpu}
links:
- name: ego_to_server
from: client
to: server
network:
mode: delay
distribution:
kind: constant
value_ms: 20.0 # DSRC 802.11p baseline
loss: 0.0
app: {plugin: reference, params: {model_kind: stub}}
For the lognormal 5G model (p50 = 30 ms, p99 = 100 ms), see
docs/snippets/v2v-lognormal-link.yaml:
docs/snippets/v2v-lognormal-link.yaml¶# Lognormal link snippet for V2V experiments: 5G p50 = 30 ms, p99 = 100 ms.
# The lognormal link states two percentiles: p50_ms is the median (the scale
# parameter, e^mu) and p99_ms is the tail, so sigma = ln(p99/p50) / 2.3263.
# For p50 = 30 ms, p99 = 100 ms that is sigma = log(100/30) / 2.3263 = 0.5176.
# Only mode: delay can render this spread (p99/p50 = 3.3x > 2x limit for netem).
extends: ../../configs/base.yaml
experiment: {name: snippet_v2v_lognormal, app: reference, repetitions: 1}
source: {kind: synthetic, count: 8, width: 64, height: 48}
nodes:
- {name: client, host: localhost, role: client, device: cpu}
- {name: server, host: 127.0.0.1, port: 15012, role: server, device: cpu}
links:
- name: ego_to_server
from: client
to: server
network:
mode: delay
distribution:
kind: lognormal
p50_ms: 30.0 # median
p99_ms: 100.0 # tail; sigma = ln(100/30) / 2.3263 = 0.5176
loss: 0.0
app: {plugin: reference, params: {model_kind: stub}}
The full V2V experiment config is at examples/v2v/v2v_braking.yaml.
Key fields:
source.scenario.ego_speed— follower starting speedlinks[0].network.distribution.value_ms— link delay in mssource.weather— weather preset:clear,light, orhigh
How to run¶
Emergency-braking baseline:
cadet run examples/braking/flat/atspeed_braking.yaml \
--set source.carla.host=$(hostname -I | awk '{print $1}') \
--app-module examples.braking.flat.app
V2V scenario:
cadet run examples/v2v/v2v_braking.yaml \
--set source.carla.host=$(hostname -I | awk '{print $1}') \
--app-module examples.v2v.app
Where results land¶
outputs/{experiment}/{app}/{run_id}/:
{run_id}_latency_location_log.csv— per-frame brake reaction latencyrun.json— run metadata and outcomeconfig.yaml— resolved config for the run
The column brake_reaction_latency_s is the primary metric.
How to extend¶
Change the link model: replace
mode: delaywithmode: netem(packet-level,docs/snippets/netem-link.yaml) ormode: netwaggle(Mininet-WiFi,docs/snippets/netwaggle-wired.yaml).Sweep over link delay and ego speed using
links[0].network.distribution.value_msandsource.scenario.ego_speedas sweep axes.Write a new app: see Tutorial 6: Write an App Plugin.
See also¶
Tutorial 2: CARLA Braking Experiment — step-by-step braking setup
Tutorial 7: V2V and V2I Experiments — V2V and V2I configs and results
Data Source Layer — CARLA source details
NetWaggle Layer — network backend details