Skip to content

Commit c302a5d

Browse files
add docs as github pages
1 parent 0f199f5 commit c302a5d

21 files changed

+1304
-1990
lines changed

.github/workflows/docs.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: docs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Configure Git Credentials
14+
run: |
15+
git config user.name github-actions[bot]
16+
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
19+
with:
20+
# Install a specific version of uv.
21+
enable-cache: true
22+
version: "0.6.12"
23+
python-version: 3.12
24+
25+
- name: Install the project
26+
run: uv sync --all-extras --dev
27+
- run: mkdocs gh-deploy --force

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ create_doc:
5050
- apt-get update -q -y && apt-get install -y libgl1-mesa-dev
5151
- uv pip install --system -e .[test]
5252
script:
53-
- pdoc ./omega_prime --html -o docs --force
53+
- mkdocs build -d docs_build
5454
artifacts:
5555
when: always
5656
paths:
57-
- "docs/**/*"
57+
- "docs_build/**/*"
5858

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,30 @@
66
[![](https://github.com/ika-rwth-aachen/omega-prime/workflows/CI/badge.svg)](https://github.com/ika-rwth-aachen/omega-prime/actions)
77
[![](https://img.shields.io/pypi/pyversions/omega-prime.svg)](https://pypi.python.org/pypi/omega-prime/)
88
[![](https://img.shields.io/github/issues-raw/ika-rwth-aachen/omega-prime.svg)](https://github.com/ika-rwth-aachen/omega-prime/issues)
9-
9+
[![](https://img.shields.io/badge/Documentation-2e8b57)](https://ika-rwth-aachen.github.io/omega-prime)
1010

1111
# Omega-Prime: Data Model, Data Format and Python Library for Handling Ground Truth Traffic Data
1212

1313
Data Model, Format and Python Library for ground truth data containing information on dynamic objects, map and environmental factors optimized for representing urban traffic. The repository contains:
1414
### Data Model and Specification
15-
see [./docs/omega_prime_specification.md](https://github.com/ika-rwth-aachen/omega-prime/tree/main/docs/omega_prime_specification.md)
15+
see [Data Model & Specification](https://ika-rwth-aachen.github.io/omega-prime/omega_prime_specification/)
1616

1717
- 🌍 **Data Model**: What signals exist and how these are defined.
1818
- 🧾 **Data Format Specification**: How to exchange and store those signals.
1919

2020
### Python Library
21-
- 🔨 **Create** omega-prime files from many sources (see [./tutorial.ipynb](https://github.com/ika-rwth-aachen/omega-prime/blob/main/tutorial.ipynb)):
21+
- 🔨 **Create** omega-prime files from many sources (see [./docs/notebooks/tutorial.ipynb](https://github.com/ika-rwth-aachen/omega-prime/blob/main/docs/notebooks/tutorial.ipynb)):
2222
- ASAM OSI GroundTruth trace (e.g., output of esmini)
2323
- Table of moving object data (e.g., csv data)
2424
- ASAM OpenDRIVE map
2525
- [LevelXData datasets](https://levelxdata.com/) through [lxd-io](https://github.com/lenvt/lxd-io)
2626
- Extend yourself by subclassing [DatasetConverter](omega_prime/converters/converter.py)
2727
- Use [omega-prime-trajdata](https://github.com/ika-rwth-aachen/omega-prime-trajdata) to convert motion prediction datasets into omega-prime
28-
- 🗺️ **Map Association**: Associate Object Location with Lanes from OpenDRIVE or OSI Maps (see [tutorial_locator.ipynb](https://github.com/ika-rwth-aachen/omega-prime/tree/main/tutorial_locatory.ipynb))
28+
- 🗺️ **Map Association**: Associate Object Location with Lanes from OpenDRIVE or OSI Maps (see [./docs/notebooks/tutorial_locator.ipynb](https://github.com/ika-rwth-aachen/omega-prime/tree/main/docs/notebooks/tutorial_locatory.ipynb))
2929
- 📺 **Plotting** of data: interactive top view plots using [altair](https://altair-viz.github.io/)
3030
-**Validation** of data: check if your data conforms to the omega-prime specification (e.g., correct yaw) using [pandera](https://pandera.readthedocs.io/en/stable/)
3131
- 📐 **Interpolation** of data: bring your data into a fixed frequency
32-
- 📈 **Metrics**: compute interaction metrics like PET, TTC, THW (see [tutorial_metrics.ipynb](https://github.com/ika-rwth-aachen/omega-prime/tree/main/tutorial_metrics.ipynb))
32+
- 📈 **Metrics**: compute interaction metrics like PET, TTC, THW (see [./docs/notebooks/tutorial_metrics.ipynb](https://github.com/ika-rwth-aachen/omega-prime/tree/main/docs/notebooks/tutorial_metrics.ipynb))
3333
- Predicted and observed timegaps based on driving tubes (see [./omega_prime/metrics.py](https://github.com/ika-rwth-aachen/omega-prime/blob/main/omega_prime/metrics.py))
3434
- 2D-birds-eye-view visibility with [omega-prime-visibility](https://github.com/ika-rwth-aachen/omega-prime-visibility)
3535
- 🚀 **Fast Processing** directly on DataFrames using [polars](https://pola.rs/), [polars-st](https://oreilles.github.io/polars-st/)
@@ -48,7 +48,7 @@ To learn more about the example data read [example_files/README.md](https://gith
4848
`pip install omega-prime`
4949

5050
## Usage
51-
> A detailed introduction to the features and usage can be found in [tutorial.ipynb](https://github.com/ika-rwth-aachen/omega-prime/blob/main/tutorial.ipynb)
51+
> A detailed introduction to the features and usage can be found in [./docs/notebooks/tutorial.ipynb](https://github.com/ika-rwth-aachen/omega-prime/blob/main/docs/notebooks/tutorial.ipynb)
5252
5353
Create an omega-prime file from an OSI GroundTruth message trace and an OpenDRIVE map:
5454
```python

docs/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Working with the documentation
2+
3+
[mkdocs](https://www.mkdocs.org/) and [mkdocs-material](https://squidfunk.github.io/mkdocs-material) are used to create the documentation of this project.
4+
5+
## Local
6+
7+
1. Install dev dependencies (this install mkdocs and dependencies)
8+
`uv pip install -e .[test]`
9+
2. Create the documentation and start webserver serving them
10+
```
11+
mkdocs serve -a localhost:5555
12+
```
13+
or create the html pages with
14+
```
15+
mkdocs build -d docs_build
16+
```
17+
18+
## Upload documentation to github-pages
19+
20+
[Guide](https://www.mkdocs.org/user-guide/deploying-your-docs/)
21+
https://squidfunk.github.io/mkdocs-material/publishing-your-site/#with-github-actions

docs/api.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# API
2+
3+
::: omega_prime.recording
4+
::: omega_prime.map
5+
::: omega_prime.map_odr
6+
7+
::: omega_prime.locator
8+
9+
::: omega_prime.converters.converter
10+
11+
::: omega_prime.metrics

docs/cli.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
::: mkdocs-typer2
2+
:module: omega_prime.cli
3+
:name: omega-prime
4+
:pretty: true

docs/index.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
# Omega-Prime: Data Model, Data Format and Python Library for Handling Ground Truth Traffic Data
3+
4+
Data Model, Format and Python Library for ground truth data containing information on dynamic objects, map and environmental factors optimized for representing urban traffic. The repository contains:
5+
## Data Model and Specification
6+
see [Data Model & Specification](omega_prime_specification.md)
7+
8+
- 🌍 **Data Model**: What signals exist and how these are defined.
9+
- 🧾 **Data Format Specification**: How to exchange and store those signals.
10+
11+
## Python Library
12+
- 🔨 **Create** omega-prime files from many sources (see [Tutorials/Introduction](notebooks/tutorial.ipynb)):
13+
- ASAM OSI GroundTruth trace (e.g., output of esmini), Table of moving object data (e.g., csv data), ASAM OpenDRIVE map
14+
- [LevelXData datasets](https://levelxdata.com/) through [lxd-io](https://github.com/lenvt/lxd-io)
15+
- Extend yourself by subclassing [DatasetConverter](https://github.com/ika-rwth-aachen/omega-prime/blob/main/omega_prime/converters/converter.py#L52)
16+
- Use [omega-prime-trajdata](https://github.com/ika-rwth-aachen/omega-prime-trajdata) to convert motion prediction datasets into omega-prime
17+
- 🗺️ **Map Association**: Associate Object Location with Lanes from OpenDRIVE or OSI Maps (see [Tutorials/Locator](notebooks/tutorial_locator.ipynb))
18+
- 📺 **Plotting** of data: interactive top view plots using [altair](https://altair-viz.github.io/)
19+
-**Validation** of data: check if your data conforms to the omega-prime specification (e.g., correct yaw) using [pandera](https://pandera.readthedocs.io/en/stable/)
20+
- 📐 **Interpolation** of data: bring your data into a fixed frequency
21+
- 📈 **Metrics**: compute interaction metrics like PET, TTC, THW (see [Tutorials/Metrics](notebooks/tutorial_metrics.ipynb))
22+
- Predicted and observed timegaps based on driving tubes (see [./omega_prime/metrics.py](https://github.com/ika-rwth-aachen/omega-prime/blob/main/omega_prime/metrics.py))
23+
- 2D-birds-eye-view visibility with [omega-prime-visibility](https://github.com/ika-rwth-aachen/omega-prime-visibility)
24+
- 🚀 **Fast Processing** directly on DataFrames using [polars](https://pola.rs/), [polars-st](https://oreilles.github.io/polars-st/)
25+
26+
27+
## Installation
28+
`pip install omega-prime`
29+
30+
31+
## Acknowledgements
32+
33+
This package is developed as part of the [SYNERGIES project](https://synergies-ccam.eu).
34+
35+
<img src="https://raw.githubusercontent.com/ika-rwth-aachen/omega-prime/refs/heads/main/docs/synergies.svg"
36+
style="width:2in" />
37+
38+
39+
40+
Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or European Climate, Infrastructure and Environment Executive Agency (CINEA). Neither the European Union nor the granting authority can be held responsible for them.
41+
42+
<img src="https://raw.githubusercontent.com/ika-rwth-aachen/omega-prime/refs/heads/main/docs/funded_by_eu.svg"
43+
style="width:4in" />
44+
45+
## Notice
46+
> The project is open-sourced and maintained by the [**Institute for Automotive Engineering (ika) at RWTH Aachen University**](https://www.ika.rwth-aachen.de/).
47+
> We cover a wide variety of research topics within our [*Vehicle Intelligence & Automated Driving*](https://www.ika.rwth-aachen.de/en/competences/fields-of-research/vehicle-intelligence-automated-driving.html) domain.
48+
> If you would like to learn more about how we can support your automated driving or robotics efforts, feel free to reach out to us!
49+
> ***opensource@ika.rwth-aachen.de***

docs/library.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
## Recordings and Map Data
2+
3+
The omega-prime library has two major components, the `Recording` and the `Map`.
4+
The `Recording` stores the dynamic object information and the map object.
5+
A recording is a continuous traffic observation and usually corresponds to an OSI trace or an MCAP recording.
6+
The dynamic object information is stored in the attribute `df` (for DataFrame) as a single polars DataFrame, where each row corresponds to the observation of a single moving object at a specific point in time.
7+
A convenience function to access this data in an object oriented manner are the `MovingObject` stored in `moving_objects` attribute of the `Recording`.
8+
For most operations, it is recommended to use the DataFrame stored in `df` directly, as polars provides a fast and flexible API for data manipulation.
9+
See the [Polars user guide](https://docs.pola.rs/) for more information on how to use polars DataFrames.
10+
The object polygons for each timestamp are accessible as shapely objects in the `polygon` column or as [`polars_st`](https://github.com/Oreilles/polars-st) geometries in the `geometry` column.
11+
It is recommended to make use of `polars_st` as much as possible instead of `shapely` since `polars_st` can utilize the benefits of using a DataFrame more effectively.
12+
13+
14+
```mermaid
15+
flowchart TB
16+
17+
subgraph recording [Recording]
18+
rec_map[map]@{ shape: doc }
19+
df@{ shape: win-pane }
20+
moving_objects@{ shape: docs }
21+
end
22+
df -.- moving_objects
23+
24+
rec_map --> map
25+
subgraph map [Map]
26+
lane_boundaries@{ shape: docs }
27+
lanes@{ shape: docs }
28+
end
29+
30+
subgraph lane [Lane]
31+
centerline
32+
lane_polygon[polygon]
33+
right_boundary_id@{ shape: doc }
34+
left_boundary_id@{ shape: doc }
35+
end
36+
37+
subgraph lane_boundary [LaneBoudary]
38+
polyline
39+
end
40+
lanes --> lane
41+
lane_boundaries --> lane_boundary
42+
right_boundary_id --> lane_boundary
43+
left_boundary_id --> lane_boundary
44+
polyline -.- lane_polygon
45+
46+
subgraph moving_object [MovingObject]
47+
48+
end
49+
moving_objects --> moving_object
50+
```
51+
52+
The `Map` stores the static map information, i.e., lanes and lane boundaries.
53+
Lanes and lane boundaries are derived form the ASAM OSI definition and are also corresponding to the concept of lanelets in Lanelet2.
54+
When working with the map data in python, the geometries of the map are represented through polygons or polylines (for boundaries and centerlines) using [shapely](https://shapely.readthedocs.io/en/stable/).
55+
56+
`MovingObject`, `Lane` and `LaneBoundary` each have types and additional information corresponding to ASAM OSI definitions.
57+
The library uses [betterosi](https://github.com/ika-rwth-aachen/betterosi) as a python implementation of ASAM OSI.
58+
59+
The omega-prime specification suggests the usage of ASAM OpenDRIVE maps as map data.
60+
This is supported through the `MapOdr` subclass of `Map`.
61+
Additionally, this library provides subclasses for ASAM OSI maps through `MapOsi` and `MapOsiCenterline`, where the latter does not provide lane polygons and lane boundaries (which is needed for some datasets).
62+
In the future, `MapLanelet` will provide support for Lanelet2 maps.
63+
Thus, a key benefit of using this library is the unified interface to work with different map formats.
64+
65+
See [Tutorials / Introduction](notebooks/tutorial) for examples of how to use omega-prime.
66+
67+
## Converters
68+
69+
The class `omega_prime.converters.DatasetConverter` aids in defining converters that transform existing data sources into the omega-prime format.
70+
For guidance on how to implement your own converter you can have a look at the `LxdConverter`, which translates the [LevelXData](https://levelxdata.com/) datasets into omega-prime.
71+
Additionally, you can have a look at [omega-prime-trajdata](https://github.com/ika-rwth-aachen/omega-prime-trajdata) to convert many motion prediction datasets into the omega-prime format.
72+
Examples of datasets that can be converted with `omega-prime-trajdata` into omega-prime are [NuPlan](https://www.nuscenes.org/nuplan), [NuScene](https://www.nuscenes.org/), [Argoverse2](https://www.argoverse.org/av2.html) and [Waymo Open Dataset - Motion](https://waymo.com/open/).
73+
Here, the class `TrajdataConverter` implements the `DatasetConverter`.
74+
75+
Data that is available as ASAM OpenDRIVE and ASAM OSI traces does not need a conversion an can be directly used with `omega-prime`.
76+
Many simulation tools such as [esmini](https://github.com/esmini/esmini) or [CARLA](https://carla.org/) through [Carla-OSI-Service](https://github.com/DLR-TS/Carla-OSI-Service) support the logging of simulation data as OSI traces.
77+
These can be directly read in and analyzed with the omega-prime library.
78+
79+
## Locator
80+
81+
The `Locator` uses the `Map` object to locate `MovingObject`s or any polygon or coordinate onto the `Lane`s of the map.
82+
The `Locator` can assign lane occupancy to objects and derive s-t-coordinate (Frenet coordinates).
83+
84+
See [Tutorials / Locator](notebooks/tutorial_locator) for examples of how to use the `Locator`.
85+
86+
## Metrics
87+
88+
The `MetricsManager` makes use of [Polars feature of lazy evaulation](https://docs.pola.rs/user-guide/concepts/lazy-api/#previewing-the-query-plan) to enable efficient computation of many, possible, dependent metrics.
89+
The metrics computation can be defined by subclassing `Metric` or, more easily by using the decorator `@omega_prime.metrics.metric` a function that computes your metric based on the `Recording.df`.
90+
Moreover, the `Metric` lets you define dependencies between metrics, e.g., `distance_traveled` needs to be computed to compute `timegaps`.
91+
The `MetricsManager` then handles the dependencies automatically, and makes sure only the things you actually need are computed.
92+
93+
See [Tutorials / Metrics](notebooks/tutorial_metrics) for examples of how to define and use the metric utilities.

0 commit comments

Comments
 (0)