OpenADS is a distributed system: its modules run as separate ROS 2 nodes in individual containers and exchange data via topics. This makes it hard to tell, from the outside, how long a message takes to travel from sensor input to control output, or where time is lost along the way. This page describes how to record runtime traces of the stack with ros2_tracing and how to analyze them, so you can inspect timing and message flow across all modules of the automated driving stack.
Tracing records when callbacks run and when messages are published and received, across all traced nodes and over time. It helps you to:
- Pinpoint latency bottlenecks and timing jitter.
- Correlate perception, planning, and control decisions with their sensor inputs.
- Debug race conditions and missing messages across nodes.
- Detect performance regressions after changes.
-
Start the stack with tracing enabled by setting the
ROS_TRACINGenvironment variable:export ROS_TRACING=true docker compose up -d -
Use OpenADStack as usual. Trace data is continuously recorded into an in-memory ring buffer, but not yet written to disk.
-
Start capturing a trace snapshot to disk:
utils/tracing/tracing.sh start
-
Once you have captured the situation of interest, stop capturing:
utils/tracing/tracing.sh stop
The trace data of each container is copied to
utils/tracing/trace/<timestamp>/<container>/and removed from the containers. -
Start the ROS 2 trace analysis tools:
docker compose -f utils/tracing/docker-compose.yml up
The
utils/tracing/trace/folder is mounted into the analysis container at/trace.
By default, tracing.sh traces all running containers whose name contains one of the following:
perception.point-cloud-fusionperception.point-cloud-object-detectionunderstanding.autoware-multi-object-trackerunderstanding.lanelet2-object-list-predictionplanning.simple-plannerplanning.trajectory-optimizationcontrol.ackermann-trajectory-control
Additional containers can be traced by passing their (partial) names via EXTRA_TRACING_CONTAINERS:
EXTRA_TRACING_CONTAINERS="my-container-1 my-other-container-1" utils/tracing/tracing.sh startNote
Additional containers must support tracing themselves, i.e., their nodes must be launched with tracing enabled.
The analysis container provides Eclipse Trace Compass and Jupyter Notebooks for evaluating the recorded traces. See ros2-trace-analysis for usage details.