diff --git a/.gitattributes b/.gitattributes index ab3e7d8d5be45ab8d92a0a3f1966101de018f96f..8ce8d43ecc8d3461bdac24d8de087e6b4bd7495d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -60,3 +60,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text Roundabout-KoeschingerTor-Koesching_19bb-19bbabb9-6c81-4a15-af8c-50fc251a248d/dynamicWorld.json filter=lfs diff=lfs merge=lfs -text Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/dynamicWorld.json filter=lfs diff=lfs merge=lfs -text +Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/dynamicWorld.json filter=lfs diff=lfs merge=lfs -text diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f0376778073225771f890e8934ea0e4fb163ec20 --- /dev/null +++ b/README.md @@ -0,0 +1,274 @@ +--- +language: +- en +- de +license: cc-by-nd-4.0 +tags: +- autonomous-driving +- traffic-analysis +- trajectory-prediction +- drone-data +- automatum +- open-drive +- json +- roundabout +- intersection +- openscenario +pretty_name: "Automatum Data: Roundabout Drone Dataset" +task_categories: +- time-series-forecasting +- object-detection +size_categories: +- 100 **Quick Preview:** Browse `Sample_Data/` to explore the data structure before downloading the full archive. The sample recording can be loaded directly with the `openautomatumdronedata` Python library. + +## Recording Overview + +### 1. Roundabout St2231 Ingolstadt VOC + +| | | +|---|---| +| ![Map](doc/map_ingolstadt.jpg) | ![Trajectories](doc/trajectories_ingolstadt.jpg) | + +| KPI | Value | +|-----|-------| +| Trajectories | 148 | +| Duration | 288.6 s (~4.8 min) | +| Traffic Flow | 1,846.0 veh/h | +| Traffic Density | 139.9 veh/km | +| Avg. Speed | 13.2 km/h | +| Max. Speed | 54.6 km/h | +| Max. Acceleration | 3.9 m/s² | +| Location | 48.7841°N, 11.4821°E | + +### 2. Roundabout Köschinger Tor, Kösching + +| | | +|---|---| +| ![Map](doc/map_koesching.jpg) | ![Trajectories](doc/trajectories_koesching.jpg) | + +| KPI | Value | +|-----|-------| +| Trajectories | 64 | +| Duration | 133.5 s (~2.2 min) | +| Traffic Flow | 1,726.3 veh/h | +| Traffic Density | 65.1 veh/km | +| Avg. Speed | 26.5 km/h | +| Max. Speed | 55.8 km/h | +| Max. Acceleration | 4.2 m/s² | +| Location | 48.8087°N, 11.4804°E | + +## Data Structure + +Each recording folder contains: + +``` +recording_folder/ +├── dynamicWorld.json # Trajectories, velocities, accelerations, bounding boxes +├── staticWorld.xodr # Road geometry in OpenDRIVE format +├── recording_name.html # Interactive metadata overview (Bokeh) +└── img/ + ├── kpis.json # Key performance indicators + ├── *_map.jpg # Aerial map view + ├── *_trajectories.jpg # Trajectory visualization + └── *_centerImg_thumb.jpg # Center frame thumbnail +``` + +### dynamicWorld.json + +The core data file contains for each tracked vehicle: + +- **Position vectors**: `x_vec`, `y_vec` — UTM coordinates over time +- **Velocity vectors**: `vx_vec`, `vy_vec` — in m/s +- **Acceleration vectors**: `ax_vec`, `ay_vec` — in m/s² +- **Jerk vectors**: `jerk_x_vec`, `jerk_y_vec` +- **Heading**: `psi_vec` — orientation angle +- **Lane assignment**: `lane_id_vec`, `road_id_vec` — linked to XODR +- **Object dimensions**: `length`, `width` +- **Object relationships**: `object_relation_dict_list` — front/behind/left/right neighbors +- **Safety metrics**: `ttc_dict_vec` (Time-to-Collision), `tth_dict_vec` (Time-to-Headway) +- **Lane distances**: `distance_left_lane_marking`, `distance_right_lane_marking` + +![Vehicle Dynamics](doc/VehicleDynamics.png) + +### staticWorld.xodr + +OpenDRIVE 1.6 format file defining: + +- Road network topology and geometry +- Lane definitions with widths and types +- Junction configurations (roundabout-specific) +- Speed limits and road markings + +![Static World](doc/static_world_fig_02.png) + +### Key Metrics Explained + +![Time-to-Collision](doc/ttc.png) +![Lane Distance](doc/lane_distance.png) +![Point-to-Lane Assignment](doc/point_to_lane_assignement_Sans.png) + +## Quick Start + +### Installation + +```bash +pip install openautomatumdronedata +``` + +### Load and Explore + +```python +from openautomatumdronedata.dataset import droneDataset +import os + +# Point to one recording folder +path = os.path.abspath("Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d") +dataset = droneDataset(path) + +# Access dynamic world +dynWorld = dataset.dynWorld + +print(f"UUID: {dynWorld.UUID}") +print(f"Duration: {dynWorld.maxTime:.1f} seconds") +print(f"Frames: {dynWorld.frame_count}") +print(f"Vehicles: {len(dynWorld)}") + +# Get all vehicles visible at t=1.0s +objects = dynWorld.get_list_of_dynamic_objects_for_specific_time(1.0) +for obj in objects[:5]: + print(f" {obj.UUID} ({obj.type}) — x={obj.x_vec[0]:.1f}, y={obj.y_vec[0]:.1f}") +``` + +### Using with Hugging Face + +```python +from huggingface_hub import snapshot_download, hf_hub_download +import zipfile, os + +# Option 1: Download only the sample for a quick look +local_path = snapshot_download( + repo_id="AutomatumData/automatum-data-roundabout", + repo_type="dataset", + allow_patterns=["Sample_Data/**"] +) + +# Option 2: Download the full archive +archive = hf_hub_download( + repo_id="AutomatumData/automatum-data-roundabout", + filename="automatum_data_roundabout.zip", + repo_type="dataset" +) +# Extract +with zipfile.ZipFile(archive, 'r') as z: + z.extractall("automatum_data_roundabout") + +# Load with openautomatumdronedata +from openautomatumdronedata.dataset import droneDataset +dataset = droneDataset("automatum_data_roundabout/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d") +print(f"Vehicles: {len(dataset.dynWorld)}") +``` + +## Example Scripts + +See the `example_scripts/` folder for ready-to-use analysis scripts: + +- **`01_lane_changes.py`** — Analyze lane change behavior across all vehicles +- **`02_heatmap_density.py`** — Generate traffic density heatmaps +- **`03_high_acceleration.py`** — Detect high-acceleration events + +## Comparison with Established Datasets + +| Feature | Automatum Data | highD | NGSIM | +|---------|---------------|-------|-------| +| **Data Format** | JSON + OpenDRIVE XODR | CSV + XML | CSV | +| **Road Geometry** | OpenDRIVE 1.6 standard | Simple annotations | Basic annotations | +| **Coordinate System** | UTM world coordinates | Local coordinates | Local coordinates | +| **Object Relationships** | Built-in (TTC, TTH, distances) | Must compute | Must compute | +| **Velocity Error** | < 0.2% (validated) | < 10 cm positional | Known issues | +| **Python Library** | `openautomatumdronedata` | Custom scripts | Custom scripts | +| **OpenSCENARIO** | Available on request | No | No | + +## Research Use & Extended Data Pool + +**These publicly available datasets are intended exclusively for research purposes.** + +This dataset is a small excerpt from the comprehensive **Automatum Data Pool** containing over **1,000 hours of processed drone video**. For commercial use or access to further datasets, including OpenSCENARIO exports, please contact us via our website: + +**[automatum-data.com](https://automatum-data.com)** + +## Citation + +If you use this dataset in your research, please cite: + +```bibtex +@inproceedings{spannaus2021automatum, + title={AUTOMATUM DATA: Drone-based highway dataset for development and validation of automated driving software}, + author={Spannaus, Paul and Zechel, Peter and Lenz, Kilian}, + booktitle={IEEE Intelligent Vehicles Symposium (IV)}, + year={2021} +} +``` + +## License + +This dataset is licensed under [Creative Commons Attribution-NoDerivatives 4.0 International (CC BY-ND 4.0)](https://creativecommons.org/licenses/by-nd/4.0/). + +## Contact + +- **Website**: [automatum-data.com](https://automatum-data.com) +- **Email**: info@automatum-data.com +- **HuggingFace**: [AutomatumData](https://huggingface.co/AutomatumData) +- **Documentation**: [openautomatumdronedata.readthedocs.io](https://openautomatumdronedata.readthedocs.io) diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d.html b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d.html new file mode 100644 index 0000000000000000000000000000000000000000..03eb6a9804af0ec7f9f9758ad25d01d969561dad --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d.html @@ -0,0 +1,53 @@ + + + + + Bokeh Plot + + + + + +
+ + + + + \ No newline at end of file diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/dynamicWorld.json b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/dynamicWorld.json new file mode 100644 index 0000000000000000000000000000000000000000..cc3216e46c9f049a929ec428a02e0c0bd2c978bd --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/dynamicWorld.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:493070cc591946b689eaacb11adbda9e6007e2227fee110c3dbfae2b5ee17c5e +size 87519017 diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_centerImg_thumb.jpg b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_centerImg_thumb.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6ef8ff3aa12b9c727b16091e22b75ba35e3701ea --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_centerImg_thumb.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c35834f6e0ba8f10fe0d0635bc2bff2a529e2bc48c5d7625345587debd89549 +size 21047 diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_map.jpg b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_map.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cbdecb69b1b13395022cec150bc6b4d0e835c167 --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_map.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e4d7719de5733de6331cced73c38842dc9e7962fad78e0f531dd16a896c42ab +size 112023 diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_trajectories.jpg b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_trajectories.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d3a1e3e994a873e57a058aa2447effd7fe3a1506 --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d_trajectories.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31399ba25b471f0830af93918f5d27953a427756701dfc5523234e7a030aebae +size 78841 diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/kpis.json b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/kpis.json new file mode 100644 index 0000000000000000000000000000000000000000..a7f92dfbe2752fa3853effcdef6caa4d4d77f469 --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/img/kpis.json @@ -0,0 +1,10 @@ +{ + "Anzahl Trajektorien": 148, + "Aufzeichnungsdauer (s)": 288.6, + "Verkehrsfluss (veh/h)": 1846.0, + "Verkehrsdichte (veh/km)": 139.9, + "Ø Trajektorienlänge (m)": 121.4, + "Ø Geschwindigkeit (km/h)": 13.2, + "Maximale Geschwindigkeit (km/h)": 54.6, + "Maximale Beschleunigung (m/s²)": 3.9 +} \ No newline at end of file diff --git a/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/staticWorld.xodr b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/staticWorld.xodr new file mode 100644 index 0000000000000000000000000000000000000000..e5c2c37f7873c1a3f36c5f827798004067aed79f --- /dev/null +++ b/Sample_Data/Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d/staticWorld.xodr @@ -0,0 +1,1109 @@ + + +
+ +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/automatum.dataset.html b/automatum.dataset.html new file mode 100644 index 0000000000000000000000000000000000000000..77a4ee1d0665c08ac755e1ae5e07bc644d1238ec --- /dev/null +++ b/automatum.dataset.html @@ -0,0 +1,140 @@ + + + + + Bokeh Plot + + + + + + + +
+ + +
+ Automatum Data +
+

Automatum Data: Roundabout Drone Dataset

+

+ License: CC BY-ND 4.0  |  Format: JSON + OpenDRIVE XODR +

+
+
+ + +
+ + +
+ Dataset Icon +
+ + +
+

+ High-precision vehicle trajectory data from drone recordings at roundabout intersections in Bavaria, Germany. Contains 2 recordings with 212 vehicles. +

+ +
+ + 🌐 Website + + + 📖 Documentation + + + 📦 PyPI Package + + + 🤗 HuggingFace + +
+
+
+ + +
+

Quick Start

+
+
+

1. Install the Python library

+ + pip install openautomatumdronedata + +
+
+

2. Load a recording

+ from openautomatumdronedata.dataset import droneDataset +dataset = droneDataset("path/to/recording") +dynWorld = dataset.dynWorld +
+
+

+ See example_scripts/ for lane change analysis, density heatmaps, and acceleration detection. +

+
+ + +
+
+ + +
+ + + + + \ No newline at end of file diff --git a/automatum_data_roundabout.zip b/automatum_data_roundabout.zip new file mode 100644 index 0000000000000000000000000000000000000000..c922b75190b162736baf3abb6ccbdb28144db1b2 --- /dev/null +++ b/automatum_data_roundabout.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3934ae688836a97794166943462a2510dc4a82ddba4aca3550fb185e679d08c3 +size 30174289 diff --git a/doc/VehicleDynamics.png b/doc/VehicleDynamics.png new file mode 100644 index 0000000000000000000000000000000000000000..7a72e02713e018df8a4c48cab9a97c3db95be2be --- /dev/null +++ b/doc/VehicleDynamics.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:320a6da6e7a29d3d4c8d6b20a4117805d1aaf0e38d1699fa884f92503d31d2c2 +size 16864 diff --git a/doc/automatum_logo.png b/doc/automatum_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..1610c293a8144d88884a8125f47199c78f0e8466 --- /dev/null +++ b/doc/automatum_logo.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eded7ce43163ecb898166a7bc587235f59b15bd17856235867d404760ca54c3e +size 42970 diff --git a/doc/icon_roundabout.jpg b/doc/icon_roundabout.jpg new file mode 100644 index 0000000000000000000000000000000000000000..2e0b2c217569db11d67d2d48f7e1c7e6f82d78ad --- /dev/null +++ b/doc/icon_roundabout.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:345730127d848523e85e4dbb513a5386309a648c0ee1eb23398cc6ed4a875ccd +size 3432723 diff --git a/doc/illustration.jpg b/doc/illustration.jpg new file mode 100644 index 0000000000000000000000000000000000000000..746a1c8878e3c37b49cdde2fcc555ce1c0bde3cf --- /dev/null +++ b/doc/illustration.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b9287acfe10df4dfaa33c3a1fc579acacca950477da2b18e397ad7363f91bf4 +size 2760658 diff --git a/doc/lane_distance.png b/doc/lane_distance.png new file mode 100644 index 0000000000000000000000000000000000000000..b42fb0022f2df45cd388459648bdd4d2b6cc86c2 --- /dev/null +++ b/doc/lane_distance.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb10140e7a9a8a563c97f45aca806c49a8789e38558d834f178946166ec3abfe +size 15099 diff --git a/doc/map_ingolstadt.jpg b/doc/map_ingolstadt.jpg new file mode 100644 index 0000000000000000000000000000000000000000..cbdecb69b1b13395022cec150bc6b4d0e835c167 --- /dev/null +++ b/doc/map_ingolstadt.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e4d7719de5733de6331cced73c38842dc9e7962fad78e0f531dd16a896c42ab +size 112023 diff --git a/doc/map_koesching.jpg b/doc/map_koesching.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8e570ff03c1da8367f77054ea0d2a7e7bdeed3e4 --- /dev/null +++ b/doc/map_koesching.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b1beebcc5bdc57872fdba8fd883c9d386d52d0d66b5270667a4a4959ba8eca3 +size 99981 diff --git a/doc/point_to_lane_assignement_Sans.png b/doc/point_to_lane_assignement_Sans.png new file mode 100644 index 0000000000000000000000000000000000000000..aff5bcf2414e7f3f2f0f40a2ac98136eb500c382 --- /dev/null +++ b/doc/point_to_lane_assignement_Sans.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b863d5b518eae3d2326cf1594c8d26f3159fe60d534c30f3b9d50ca759f3f330 +size 21578 diff --git a/doc/static_world_fig_02.png b/doc/static_world_fig_02.png new file mode 100644 index 0000000000000000000000000000000000000000..5822f90d00faf4b658fe3adc3a4f122dc1ec6a7b --- /dev/null +++ b/doc/static_world_fig_02.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c046e208a04c088bd863f0a9f4d2cbf7ad7c84c0284530655d031f5a8541854 +size 166095 diff --git a/doc/trajectories_ingolstadt.jpg b/doc/trajectories_ingolstadt.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d3a1e3e994a873e57a058aa2447effd7fe3a1506 --- /dev/null +++ b/doc/trajectories_ingolstadt.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31399ba25b471f0830af93918f5d27953a427756701dfc5523234e7a030aebae +size 78841 diff --git a/doc/trajectories_koesching.jpg b/doc/trajectories_koesching.jpg new file mode 100644 index 0000000000000000000000000000000000000000..969149789839344ba0fe43580a7c9310fc38ad17 --- /dev/null +++ b/doc/trajectories_koesching.jpg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd0b431041eff634d702766d9efb8760407102366c39e9891ecae7503da72b28 +size 89638 diff --git a/doc/ttc.png b/doc/ttc.png new file mode 100644 index 0000000000000000000000000000000000000000..ced21ef5272542e1f4e35b8865c92f4a9f9e8265 --- /dev/null +++ b/doc/ttc.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c443a4927e4282e4afd9b8bf00061174175b0ad0d7fcdc662c23a58eb1a5f5d7 +size 15518 diff --git a/example_scripts/01_lane_changes.py b/example_scripts/01_lane_changes.py new file mode 100644 index 0000000000000000000000000000000000000000..9d8bf33161d1b7628ba626407e693361e7e9e257 --- /dev/null +++ b/example_scripts/01_lane_changes.py @@ -0,0 +1,54 @@ +""" +Lane Change Analysis — Automatum Data Roundabout Dataset +Analyzes lane change behavior across all vehicles in a recording. + +Usage: + python 01_lane_changes.py + +Example: + python 01_lane_changes.py ../Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d +""" +import sys +import os +from openautomatumdronedata.dataset import droneDataset + + +def analyze_lane_changes(dataset_path): + print(f"Loading dataset from: {dataset_path}") + dataset = droneDataset(dataset_path) + dynWorld = dataset.dynWorld + + print(f"Vehicles found: {len(dynWorld)}") + + lane_change_counts = [] + + for dynObj in dynWorld.dynamicObjects.values(): + lane_ids = dynObj.lane_id_vec + if len(lane_ids) == 0: + continue + + changes = 0 + current_lane = lane_ids[0] + for lane in lane_ids[1:]: + if lane != current_lane: + changes += 1 + current_lane = lane + + lane_change_counts.append({ + "uuid": dynObj.UUID, + "type": dynObj.type, + "changes": changes, + }) + + sorted_by_changes = sorted(lane_change_counts, key=lambda x: x["changes"], reverse=True) + + print("\n--- Top 10 vehicles with most lane changes ---") + for idx, item in enumerate(sorted_by_changes[:10]): + print(f"{idx+1}. Vehicle {item['uuid']} ({item['type']}): {item['changes']} lane changes") + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python 01_lane_changes.py ") + else: + analyze_lane_changes(sys.argv[1]) diff --git a/example_scripts/02_heatmap_density.py b/example_scripts/02_heatmap_density.py new file mode 100644 index 0000000000000000000000000000000000000000..f8478847060cb95ceab00cb293538219f86f230a --- /dev/null +++ b/example_scripts/02_heatmap_density.py @@ -0,0 +1,58 @@ +""" +Traffic Density Heatmap — Automatum Data Roundabout Dataset +Generates a 2D heatmap of all vehicle positions over time. + +Usage: + python 02_heatmap_density.py + +Example: + python 02_heatmap_density.py ../Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d + +Output: + traffic_heatmap.png in the current directory +""" +import sys +import os +import numpy as np +import matplotlib.pyplot as plt +from openautomatumdronedata.dataset import droneDataset + + +def generate_density_heatmap(dataset_path, output_filename="traffic_heatmap.png"): + print(f"Loading dataset from: {dataset_path}") + dataset = droneDataset(dataset_path) + dynWorld = dataset.dynWorld + + print("Extracting position data...") + all_x, all_y = [], [] + + for dynObj in dynWorld.dynamicObjects.values(): + x_valid = [x for x in dynObj.x_vec if not np.isnan(x)] + y_valid = [y for y in dynObj.y_vec if not np.isnan(y)] + all_x.extend(x_valid) + all_y.extend(y_valid) + + if not all_x: + print("No position data found!") + return + + print(f"Extracted {len(all_x)} data points. Creating heatmap...") + + plt.figure(figsize=(10, 10)) + plt.style.use("dark_background") + plt.hist2d(all_x, all_y, bins=(200, 200), cmap="inferno", cmin=1) + plt.colorbar(label="Traffic density (data points)") + plt.title("Roundabout Traffic Density Heatmap (Top-View)") + plt.xlabel("X-Position [m]") + plt.ylabel("Y-Position [m]") + plt.gca().set_aspect("equal", adjustable="box") + plt.tight_layout() + plt.savefig(output_filename, dpi=300) + print(f"Heatmap saved: {os.path.abspath(output_filename)}") + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python 02_heatmap_density.py ") + else: + generate_density_heatmap(sys.argv[1]) diff --git a/example_scripts/03_high_acceleration.py b/example_scripts/03_high_acceleration.py new file mode 100644 index 0000000000000000000000000000000000000000..114d5de72be515dfe05306ecd825d2da2d7f241e --- /dev/null +++ b/example_scripts/03_high_acceleration.py @@ -0,0 +1,61 @@ +""" +High Acceleration Detection — Automatum Data Roundabout Dataset +Detects vehicles exceeding a given acceleration threshold. + +Usage: + python 03_high_acceleration.py [threshold_m_s2] + +Example: + python 03_high_acceleration.py ../Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d 3.0 +""" +import sys +import os +import numpy as np +from openautomatumdronedata.dataset import droneDataset + + +def detect_high_accelerations(dataset_path, acc_threshold=3.0): + print(f"Loading dataset from: {dataset_path}") + dataset = droneDataset(dataset_path) + dynWorld = dataset.dynWorld + + print(f"Searching for accelerations > {acc_threshold} m/s^2...") + + high_accel_vehicles = [] + + for dynObj in dynWorld.dynamicObjects.values(): + length = min(len(dynObj.ax_vec), len(dynObj.ay_vec)) + if length == 0: + continue + + ax = np.array(dynObj.ax_vec[:length]) + ay = np.array(dynObj.ay_vec[:length]) + total_accel = np.sqrt(ax**2 + ay**2) + valid_accel = total_accel[~np.isnan(total_accel)] + + if len(valid_accel) > 0: + max_accel = np.max(valid_accel) + if max_accel > acc_threshold: + high_accel_vehicles.append({ + "uuid": dynObj.UUID, + "type": dynObj.type, + "max_accel": max_accel, + }) + + if not high_accel_vehicles: + print(f"No vehicles with acceleration > {acc_threshold} m/s^2 found.") + return + + sorted_vehicles = sorted(high_accel_vehicles, key=lambda x: x["max_accel"], reverse=True) + + print(f"\n--- {len(sorted_vehicles)} vehicles with notable acceleration ---") + for item in sorted_vehicles: + print(f"Vehicle {item['uuid']} ({item['type']}): max {item['max_accel']:.2f} m/s^2") + + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python 03_high_acceleration.py [threshold]") + else: + threshold = float(sys.argv[2]) if len(sys.argv) >= 3 else 3.0 + detect_high_accelerations(sys.argv[1], threshold) diff --git a/example_scripts/README.md b/example_scripts/README.md new file mode 100644 index 0000000000000000000000000000000000000000..76f6b56d801234d10d39086489cd67cd55265d98 --- /dev/null +++ b/example_scripts/README.md @@ -0,0 +1,32 @@ +# Example Scripts — Automatum Data Roundabout Dataset + +These scripts demonstrate how to work with the Automatum drone traffic data using the `openautomatumdronedata` Python library. + +## Prerequisites + +```bash +pip install openautomatumdronedata numpy matplotlib +``` + +## Scripts + +| Script | Description | +|--------|-------------| +| `01_lane_changes.py` | Analyzes lane change frequency per vehicle and shows the top 10 | +| `02_heatmap_density.py` | Creates a traffic density heatmap from all position data | +| `03_high_acceleration.py` | Detects vehicles exceeding an acceleration threshold | + +## Usage + +All scripts take the path to a recording folder as their first argument: + +```bash +python 01_lane_changes.py ../Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d +python 02_heatmap_density.py ../Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d +python 03_high_acceleration.py ../Roundabout-St2231-IngolstadtVOC_e63d-e63db143-1e40-4945-8866-464572ebf75d 3.0 +``` + +## Learn More + +- [Full Documentation](https://openautomatumdronedata.readthedocs.io) +- [Automatum Data Website](https://automatum-data.com)