AWSIM-LDM is an environment for the closed-loop evaluation of an autonomous driving system that uses Local Dynamic Map (LDM) information delivered over a simulated wireless link. AWSIM-LDM extends SIM-LDM, which generates an LDM from the autonomous driving simulator AWSIM, by simulating the wireless link from a roadside unit (RSU) or a base station to the ego vehicle with ns-3 in real time. Autoware drives the ego vehicle in AWSIM and receives LDM information with the latency and packet loss that ns-3 calculates for IEEE 802.11p or 5G NR. 8000
This repository contains the source code and the evaluation tools for the paper "AWSIM-LDM: Simulator-based Local Dynamic Map with Wireless Simulation for Autonomous Driving Systems."
AWSIM (managers) --TCP--> LDM server (Kafka, ksqlDB)
^ | push query
| v
| data request unit <--control messages--> ns-3 (sim-ldm-link)
| | Autoware object messages after the simulated latency and loss
| v
+------------------- Autoware
| Path | Content |
|---|---|
awsim/awsim-ldm.patch |
Changes to AWSIM: managers that extract vehicles and pedestrians and send them to the LDM server, actors and roadside sensor ranges of the hazard scenarios, ground-truth logging, and the build script |
ldm_server/ |
LDM server: receives object information from AWSIM over TCP and writes it to Kafka; ksqlDB streams (sql/); scripts/confluent.sh starts and resets ZooKeeper, Kafka, ksqlDB, and the REST Proxy |
ros2_ws/src/sim_ldm_vehicle/ |
Ego-vehicle side: data request unit (push query results to Autoware object messages), relay to ns-3, and measurement nodes |
ros2_ws/src/sim_ldm_fusion/ |
Merger for the combined use of onboard perception and LDM information |
ns3_sim/sim-ldm-link/ |
ns-3 program that simulates the wireless link (IEEE 802.11p, 5G NR with 5G-LENA, and LTE) with the ns-3 real-time scheduler |
patches/ |
Changes to Autoware |
experiments/ |
Tools that run the evaluations (scripts/), condition tables and scenarios (configs/), and aggregation (analysis/) |
config/cyclonedds.xml, env.sh |
DDS configuration and environment variables |
| Item | Version |
|---|---|
| OS, ROS 2 | Ubuntu 22.04, ROS 2 Humble |
| Computer | Intel Core i7-13700KF, NVIDIA GeForce RTX 4090, 128 GB memory |
| AWSIM | tier4/AWSIM main at 9067d6dc, Unity 6000.0.34f1 |
| Autoware | autowarefoundation/autoware 0.45.1-9-gf03f485 |
| ns-3, 5G-LENA | ns-3.48, 5G-LENA v5.1 |
| Confluent Platform | 7.9.10 (community) |
| Python | 3.10; confluent-kafka 2.6.1 for the LDM server; PyYAML, NumPy, Matplotlib, Shapely 2, and psutil for experiments/ |
The root of this repository is the workspace root.
The scripts find it from their own location, and env.sh exports it as WS_RAGE.
The external software is placed in the following directories, which .gitignore excludes.
| Path | Content |
|---|---|
AWSIM_v2/ |
AWSIM with awsim/awsim-ldm.patch; the player is built into AWSIM_v2/Build/SimLdm/AWSIM.x86_64 |
autoware/ |
Autoware with the patches in patches/ |
autoware_data/ |
Artifacts of Autoware (machine learning models) |
map/Shinjuku-Map/map/ |
Shinjuku map for Autoware (lanelet2_map.osm, pointcloud_map.pcd) |
ns-3/ns-3.48/ |
ns-3 with 5G-LENA in contrib/nr |
confluent/confluent-7.9.10/ |
Confluent Platform |
.venv/ |
Python virtual environment for the LDM server |
git clone https://github.com/tier4/AWSIM.git AWSIM_v2
git -C AWSIM_v2 checkout 9067d6dc5df7998a3f9c7af99de50a16a0f6e6dc
git -C AWSIM_v2 apply ../awsim/awsim-ldm.patchImport the Shinjuku assets into AWSIM_v2/Assets/Awsim/Externals/Shinjuku/ as described in the AWSIM documentation, open the project once with Unity 6000.0.34f1, and build the Linux player either from the menu AWSIM > SIM-LDM > Build Linux Player or in batch mode:
<path to Unity> -batchmode -quit -projectPath AWSIM_v2 \
-executeMethod Awsim.Usecase.SimLdm.Editor.SimLdmBuild.BuildLinuxPlayerSet up Autoware from source as described in the Autoware documentation, using the following version and directory, and apply the patches before building.
git clone https://github.com/autowarefoundation/autoware.git autoware
git -C autoware checkout f03f485
mkdir autoware/src && vcs import autoware/src < autoware/autoware.repos
cd autoware/src
for p in autoware_launch_adapi_diag_timeout autoware_launch_max_vel_30kmh autoware_launch_run_out_car \
autoware_launch_scan_matching_warn_to_ok autoware_perception_detection_switch \
autoware_planning_control_input_objects_topic; do
patch -p1 < ../../patches/$p.patch
done
(cd universe/autoware_universe && patch -p1 < ../../../../patches/autoware_universe_diagnostic_updater_4.0.7.patch)
cd .. && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release| Patch | Change |
|---|---|
autoware_launch_adapi_diag_timeout |
Adds a 3.0 s timeout to the three AD API diagnostics in the diagnostic graph; with the default timeout, which equals their 1.0 s period, a slightly late message caused a short minimal risk maneuver (MRM) during driving |
autoware_launch_max_vel_30kmh |
Raises the speed limit of planning from 4.17 m/s (15 km/h) to 8.33 m/s (30 km/h) for the hazard scenarios |
autoware_launch_run_out_car |
Adds CAR to the target object types of the run_out module so that the ego vehicle stops for a car crossing its path |
autoware_launch_scan_matching_warn_to_ok |
Ignores the WARN level of the NDT scan matching status for engagement; with the noise-free LiDAR of AWSIM, NDT warned for single scans although the pose was correct, which caused short MRMs; ERROR and STALE still block, and experiments/scripts/eval_checks.py checks the other NDT warnings for each run |
autoware_perception_detection_switch |
Adds the launch argument use_object_recognition_detection (default true) that disables only the detection stage, so that the objects from the data request unit pass through the tracking and prediction of Autoware |
autoware_planning_control_input_objects_topic |
Adds the launch arguments planning_input_objects_topic_name and control_input_objects_topic_name; the combined use passes the output of the merger, /perception/object_recognition/objects_fused; the defaults keep the original topic |
autoware_universe_diagnostic_updater_4.0.7 |
Fixes the build with ros-humble-diagnostic-updater 4.0.7 |
Place the artifacts of Autoware in autoware_data/ and the Shinjuku map for Autoware, which the AWSIM documentation provides, in map/Shinjuku-Map/map/.
git clone https://gitlab.com/nsnam/ns-3-dev.git ns-3/ns-3.48
git -C ns-3/ns-3.48 checkout ns-3.48
git clone https://gitlab.com/cttc-lena/nr.git ns-3/ns-3.48/contrib/nr
git -C ns-3/ns-3.48/contrib/nr checkout v5.1
ln -s ../../../ns3_sim/sim-ldm-link ns-3/ns-3.48/scratch/sim-ldm-link
cd ns-3/ns-3.48
./ns3 configure --build-profile=optimized
./ns3 build sim-ldm-linkThe program is built into ns-3/ns-3.48/build/scratch/sim-ldm-link/ns3.48-sim-ldm-link-optimized.
Extract the community edition of Confluent Platform 7.9.10 into confluent/ so that confluent/confluent-7.9.10/ exists (Java is required), and create the Python virtual environment.
python3 -m venv .venv
.venv/bin/pip install confluent-kafka==2.6.1 pytest
ldm_server/scripts/confluent.sh start
(cd ldm_server && ../.venv/bin/python -m ldm_server.ksql_setup)confluent.sh also takes stop, status, and reset.
The evaluation tools reset the LDM server and create the ksqlDB streams again before each run.
source env.sh
cd ros2_ws && colcon build --symlink-installSource env.sh in each terminal.
experiments/scripts/run_eval.py reads a condition table, starts and stops all components (LDM server, data request unit, measurement nodes, ns-3, rosbag, Autoware, and AWSIM) for each run, and writes the logs and summaries to experiments/raw/<date>_<name>/.
During the measurements, the tool creates experiments/LOCK; other heavy processes should not run on the computer in the meantime.
python3 experiments/scripts/run_eval.py experiments/configs/eval1.yaml --dry-run # show the expanded conditions
python3 experiments/scripts/run_eval.py experiments/configs/eval1.yaml
python3 experiments/scripts/run_eval.py experiments/configs/additional/eval1_add.yaml \
--resume experiments/raw/additional/$(date +%Y%m%d_%H%M%S)_eval1_add
python3 experiments/scripts/run_eval.py experiments/configs/eval3.yaml| Paper | Condition table | Conditions used in the paper |
|---|---|---|
| RQ1, RQ2 | eval1.yaml and additional/eval1_add.yaml |
Groups 1a_direct, 1a_wifi (IEEE 802.11p), and 1a_nr (5G NR) with 10, 40, 80, and 160 vehicles in eval1.yaml and 20, 100, 120, and 140 vehicles in eval1_add.yaml |
| RQ3 | eval3.yaml |
Scenarios S1 to S3 with onboard perception only and with the combined use under the direct setting, IEEE 802.11p, 5G NR, and the heavy-load conditions, three runs each |
eval1.yaml also contains conditions that the paper does not report (1a_passthrough, 1a_lte, and the 1b_ groups).
The scenario files number S2 and S3 differently from the paper: S2 of the paper (pedestrian) is S3.json and the S3_ conditions here, and S3 of the paper (crossing vehicle) is S2.json and the S2_ conditions.
The tables and figures for the RQs are made from the raw data as follows.
R=experiments/raw/<date>_eval1
A=experiments/raw/additional/<date>_eval1_add
python3 experiments/analysis/eval1_report.py $R/1a_* $A --rq --out <output directory>
python3 experiments/analysis/eval3_report.py experiments/raw/<date>_eval3 \
--series onboard fused_wifi fused_nr fused_wifi_heavy fused_nr_heavy --verdict-only --out <output directory>eval1_report.py --rq also compares the direct setting with SIM-LDM, using the values of Figs. 8 and 9 of the SIM-LDM paper and of the repeated measurements in experiments/results/.
source env.sh
python3 -m pytest experiments/tests experiments/analysis/tests ros2_ws/src/sim_ldm_vehicle/test ns3_sim/tests
(cd ldm_server && env -u PYTHONPATH ../.venv/bin/python -m pytest tests)
(cd ros2_ws && colcon test --packages-select sim_ldm_fusion && colcon test-result --verbose)The tests of experiments/scripts/lanelet_path.py read the map in map/Shinjuku-Map/, and the tests in ns3_sim/tests/ are skipped until the ns-3 program is built.
The code in this repository is licensed under the Apache License 2.0 (LICENSE), except for ns3_sim/, which links with ns-3 and 5G-LENA and is licensed under the GNU General Public License version 2 (ns3_sim/LICENSE).
awsim/awsim-ldm.patch modifies AWSIM, and patches/ modifies Autoware; both are licensed under the Apache License 2.0.
The AWSIM assets, the maps, and the other external software are not included and are subject to their own licenses.
AWSIM-LDM builds on AWSIM, Autoware, ns-3, 5G-LENA, Confluent Platform, and SIM-LDM.