Skip to content

Commit

Permalink
Merge pull request #83 from asam-ev/2024-08-29
Browse files Browse the repository at this point in the history
Add inertial point, smoothness checker and clean up
  • Loading branch information
andreaskern74 authored Aug 29, 2024
2 parents 4a53dff + 0958663 commit 785ce6b
Show file tree
Hide file tree
Showing 68 changed files with 7,140 additions and 403 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: pip install -r requirements.txt -r requirements-tests.txt
- run: python -m pytest -vv
- run: pip install poetry==1.8.3
- run: poetry install --with dev
- run: poetry run pytest -vv
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ coverage.xml
.coverage*
.python-version
generated_checker_bundle_doc.md
.DS_Store
82 changes: 49 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ This project implements the [ASAM OpenDrive Checker Bundle](checker_bundle_doc.m
- [To use as a library](#to-use-as-a-library)
- [To use as an application](#to-use-as-an-application)
- [Installation from source](#installation-from-source)
- [Default Python](#default-python)
- [Poetry](#poetry)
- [Example output](#example-output)
- [Register Checker Bundle to ASAM Quality Checker Framework](#register-checker-bundle-to-asam-quality-checker-framework)
- [Linux Manifest Template](#linux-manifest-template)
- [Windows Manifest Template](#windows-manifest-template)
- [Example Configuration File](#example-configuration-file)
- [Tests](#tests)
- [Install using pip](#install-using-pip)
- [Install using poetry](#install-using-poetry)
- [Execute tests](#execute-tests)
- [Contributing](#contributing)

Expand Down Expand Up @@ -70,20 +68,7 @@ python -m qc_opendrive.main --help

### Installation from source

After cloning the repository, there are two options to install from source.

1. Default Python on the machine
2. [Poetry](https://python-poetry.org/)

#### Default Python

```bash
pip install -r requirements.txt
```

This will install the needed dependencies to your local Python environment.

#### Poetry
The project can be installed from source using [Poetry](https://python-poetry.org/).

```bash
poetry install
Expand Down Expand Up @@ -144,19 +129,57 @@ Manifest file templates are provided in the [manifest_templates](manifest_templa

### Linux Manifest Template

To register this Checker Bundle in Linux, use the [linux_manifest.json](manifest_templates/linux_manifest.json) template file. Replace the path to the Python executable `/home/user/.venv/bin/python` in the `exec_command` with the path to the Python executable where the Checker Bundle is installed.
To register this Checker Bundle in Linux, use the [linux_xodr_manifest.json](manifest_templates/linux_xodr_manifest.json) template file.

## Tests
If the asam-qc-opendrive is installed in a virtual environment, the `exec_command` needs to be adjusted as follows:

To run the tests, you need to install the extra test dependency after installing from source.
```json
"exec_command": "source <venv>/bin/activate && cd $ASAM_QC_FRAMEWORK_WORKING_DIR && qc_opendrive -c $ASAM_QC_FRAMEWORK_CONFIG_FILE"
```

### Install using pip
Replace `<venv>/bin/activate` by the path to your virtual environment.

```bash
pip install -r requirements-tests.txt
### Windows Manifest Template

To register this Checker Bundle in Windows, use the [windows_xodr_manifest.json](manifest_templates/windows_xodr_manifest.json) template file.

If the asam-qc-opendrive is installed in a virtual environment, the `exec_command` needs to be adjusted as follows:

```json
"exec_command": "C:\\> <venv>\\Scripts\\activate.bat && cd %ASAM_QC_FRAMEWORK_WORKING_DIR% && qc_opendrive -c %ASAM_QC_FRAMEWORK_CONFIG_FILE%"
```

### Install using poetry
Replace `C:\\> <venv>\\Scripts\\activate.bat` by the path to your virtual environment.

### Example Configuration File

An example configuration file for using this Checker Bundle within the ASAM Quality Checker Framework is as follows.

```xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Config>

<Param name="InputFile" value="test.xodr" />

<CheckerBundle application="xodrBundle">
<Param name="resultFile" value="xodr_bundle_report.xqar" />
<Checker checkerId="semantic_xodr" maxLevel="1" minLevel="3" />
<Checker checkerId="geometry_xodr" maxLevel="1" minLevel="3" />
<Checker checkerId="performance_xodr" maxLevel="1" minLevel="3" />
<Checker checkerId="smoothness_xodr" maxLevel="1" minLevel="3" />
</CheckerBundle>

<ReportModule application="TextReport">
<Param name="strInputFile" value="Result.xqar" />
<Param name="strReportFile" value="Report.txt" />
</ReportModule>

</Config>
```

## Tests

To run the tests, you need to install the extra test dependency.

```bash
poetry install --with dev
Expand Down Expand Up @@ -197,14 +220,7 @@ You can check more options for pytest at its [own documentation](https://docs.py

## Contributing

For contributing, you need to install the development requirements besides the
test and installation requirements, for that run:

```bash
pip install -r requirements-dev.txt
```

or
For contributing, you need to install the development requirements. For that run:

```bash
poetry install --with dev
Expand Down
8 changes: 7 additions & 1 deletion checker_bundle_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

* Description: Evaluates elements in the file and their geometrys to guarantee they are in conformity with the standard.
* Addressed rules:
* asam.net:xodr:1.7.0:road.geometry.param_poly3.length_match
* asam.net:xodr:1.7.0:road.geometry.parampoly3.length_match
* asam.net:xodr:1.4.0:road.lane.border.overlap_with_inner_lanes
* asam.net:xodr:1.7.0:road.geometry.parampoly3.arclength_range
* asam.net:xodr:1.7.0:road.geometry.parampoly3.normalized_range
Expand All @@ -40,3 +40,9 @@
* Description: Evaluates elements in the file to guarantee they are optimized.
* Addressed rules:
* asam.net:xodr:1.7.0:performance.avoid_redundant_info

### smoothness_xodr

* Description: Evaluates elements in the file and their geometries to guarantee they are in conformity with the standard definition of smoothness.
* Addressed rules:
* asam.net:xodr:1.7.0:lane_smoothness.contact_point_no_horizontal_gaps
10 changes: 0 additions & 10 deletions manifest_templates/linux_manifest.json

This file was deleted.

10 changes: 10 additions & 0 deletions manifest_templates/linux_xodr_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "xodrBundle",
"exec_type": "executable",
"module_type": "checker_bundle",
"exec_command": "cd $ASAM_QC_FRAMEWORK_WORKING_DIR && qc_opendrive -c $ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 10 additions & 0 deletions manifest_templates/windows_xodr_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "xodrBundle",
"exec_type": "executable",
"module_type": "checker_bundle",
"exec_command": "cd %ASAM_QC_FRAMEWORK_WORKING_DIR% && qc_opendrive -c %ASAM_QC_FRAMEWORK_CONFIG_FILE%"
}
]
}
Loading

0 comments on commit 785ce6b

Please sign in to comment.