Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoware_lanelet2_map_validator): introduce autoware_lanelet2_map_validator #118

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
1d9f97e
introduce autoware_lanelet2_map_validator to autoware_tools
TaikiYamada4 Sep 13, 2024
43d2441
wrote description a little to README.md
TaikiYamada4 Sep 13, 2024
0419b74
style(pre-commit): autofix
pre-commit-ci[bot] Sep 13, 2024
37daad6
Restore commented out parts.
TaikiYamada4 Sep 13, 2024
b6d8b36
style(pre-commit): autofix
pre-commit-ci[bot] Sep 13, 2024
77416f2
Separate validation rules to samller pieces.
TaikiYamada4 Sep 17, 2024
ebefd7c
Split the validation code into smaller pieces.
TaikiYamada4 Sep 19, 2024
ea38dd1
Fixed test codes to use the separated codes
TaikiYamada4 Sep 19, 2024
e091ff6
Removed unused code which are already divided to smaller codes.
TaikiYamada4 Sep 19, 2024
359f359
Rename new_main.cpp to main.cpp
TaikiYamada4 Sep 19, 2024
e622c91
style(pre-commit): autofix
pre-commit-ci[bot] Sep 20, 2024
37489ec
Wrote detailed README.md
TaikiYamada4 Sep 27, 2024
b653c84
Fixed commit mistake
TaikiYamada4 Sep 27, 2024
27b354d
Renew input command option to `-i` from `-r`.
TaikiYamada4 Sep 27, 2024
9014a3c
style(pre-commit): autofix
pre-commit-ci[bot] Sep 27, 2024
fcbc7d8
Fixed long to uint64_t
TaikiYamada4 Sep 30, 2024
1685e7e
Fixed spelling
TaikiYamada4 Sep 30, 2024
077e7e6
style(pre-commit): autofix
pre-commit-ci[bot] Sep 30, 2024
18524be
Fixed typo
TaikiYamada4 Sep 30, 2024
dfdb4f0
Split long lines in the code
TaikiYamada4 Sep 30, 2024
ef09205
style(pre-commit): autofix
pre-commit-ci[bot] Sep 30, 2024
4e42996
Changed the entire structure.
TaikiYamada4 Sep 30, 2024
f9a16da
style(pre-commit): autofix
pre-commit-ci[bot] Sep 30, 2024
147ba6a
Fixed pre-commit.ci related stuff
TaikiYamada4 Sep 30, 2024
c14477e
Write more details about the relationship to lanelet2_validation.
TaikiYamada4 Oct 1, 2024
315dbf0
Added figure of the architecture
TaikiYamada4 Oct 3, 2024
2f7d839
Change the input/output to JSON
TaikiYamada4 Oct 3, 2024
f5ec766
Revised architecture image of autoware_lanelet2_map_validator
TaikiYamada4 Oct 10, 2024
8a2a8c2
fixed typo
TaikiYamada4 Oct 10, 2024
8f15908
Renew year numbers
TaikiYamada4 Oct 15, 2024
ef2f5ad
Fixed dependency
TaikiYamada4 Oct 15, 2024
b72177d
Fixed pointed out issues
TaikiYamada4 Oct 25, 2024
d16b54b
Improve error handling
TaikiYamada4 Oct 25, 2024
8b93027
Avoid clang format
TaikiYamada4 Oct 25, 2024
c2a437c
Removed redundant process.
TaikiYamada4 Oct 28, 2024
6f47702
Added approaches to the documents
TaikiYamada4 Oct 28, 2024
c114991
Fixed typo
TaikiYamada4 Oct 28, 2024
fe9d19a
Removed catch and improve io error handling
TaikiYamada4 Oct 28, 2024
98b4ee6
Fixed grammatical error.
TaikiYamada4 Oct 28, 2024
b405d14
Added stop_line validator to the table in the main README.md
TaikiYamada4 Oct 28, 2024
4570bbf
Renamed lib to common.
TaikiYamada4 Oct 28, 2024
118596e
Removed redundant under score
TaikiYamada4 Oct 28, 2024
d1e0a26
Removed redundant underscore again
TaikiYamada4 Oct 28, 2024
074c4f2
Changed years.
TaikiYamada4 Oct 29, 2024
2c9dca1
Removed underscore from test_regulatory_element_details.cpp
TaikiYamada4 Oct 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Wrote detailed README.md
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
  • Loading branch information
TaikiYamada4 committed Sep 27, 2024
commit 37489ec8392cc98e7b94c193938efa7f930f8853
281 changes: 225 additions & 56 deletions map/autoware_lanelet2_map_validator/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# missing_regulator_elements_for_crosswalk

## Validator name

mapping.crosswalk.missing_regulatory_elements

## Feature

This validator checks whether each `crosswalk` subtype lanelet has a relavant regulatory element.
The issue specifies the crosswalk "lanelet" as the **primitive**, and the lanelet ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
| "No regulatory element refers to this crosswalk." | Error | There is a `crosswalk` subtype lanelet that hasn't been referred to any regulatory element. |

## Related source codes

- missing_regulatory_elements_for_crosswalk.hpp
- missing_regulatory_elements_for_crosswalk.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# regulatory_element_details_for_crosswalks

## Validator name

mapping.crosswalk.regulatory_element_details

## Feature

This validator checks whether the details in the `crosswalk` subtype regulatory elements are valid.
This validator checks seven types of issues.
YamatoAndo marked this conversation as resolved.
Show resolved Hide resolved

All output issues specify the crosswalk "lanelet" as the **primitive**, and the lanelet ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
| "Refers of crosswalk regulatory element must have type of crosswalk." | Error | There is a `crosswalk` subtype regulatory element whose `refers` is not a `crosswalk` subtype lanelet. |
| "Refline of crosswalk regulatory element must have type of stopline." | Error | There is a `crosswalk` subtype regulatory element whose `ref_line` is not a `stop_line` type linestring. |
| "Crosswalk polygon of crosswalk regulatory element must have type of Crosswalk_polygon." | Error | There is a `crosswalk` subtype regulatory element whose `crosswalk_polygon` is not a `crosswalk_polygon` type polygon. |
| "Regulatory element of cross walk must have lanelet of crosswalk(refers)." | Error | There is a `crosswalk` subtype regulatory element that has no `refers`es. |
| "Regulatory element of cross walk must have only one lanelet of crosswalk(refers)." | Error | There is a `crosswalk` subtype regulatory element that has multiple `refers`es. |
| "Regulatory element of cross walk does not have stop line(ref_line)." | Info | There is a `crosswalk` subtype regulatory element that has no `ref_line`s |
| "Regulatory element of cross walk is nice to have crosswalk_polygon." | Warning | There is a `crosswalk` subtype regulatory element that has no `crosswalk_polygon`s. |
| "Regulatory element of cross walk must have only one crosswalk_polygon." | Error | There is a `crosswalk` subtype regulatory element that has multiple `crosswalk_polygon`s. |

## Related source codes

- regulatory_element_details_for_crosswalks.hpp
- regulatory_element_details_for_crosswalks.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# missing_regulator_elements_for_stop_lines

## Validator name

mapping.stop_line.missing_regulatory_elements

## Feature

This validator checks whether each `stop_line` type linestring has a relavant regulatory element.
The issue specifies the stop_line "linestring" as the **primitive**, and the lanelet ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
| "No regulatory element refers to this stop line." | Error | There is a `stop_line` type linestring that hasn't been referred to any regulatory element. |

## Related source codes

- missing_regulatory_elements_for_stop_line.cpp
- missing_regulatory_elements_for_stop_line.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# missing_regulator_elements_for_traffic_lights

## Validator name

mapping.traffic_light.missing_regulatory_elements

## Feature

This validator checks whether each `traffic_light` type linestring has a relavant regulatory element.
The output issue specifies the traffic_light "linestring" as the **primitive**, and the linestring ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
| "No regulatory element refers to this traffic light." | Error | There is a `traffic_light` type linestring that hasn't been referred to any regulatory element. |

## Related source codes

- missing_regulatory_elements_for_traffic_light.hpp
- missing_regulatory_elements_for_traffic_light.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# regulatory_element_details_for_traffic_lights

## Validator name

mapping.traffic_light.regulatory_element_details

## Feature

This validator checks whether the details in the `traffic_light` subtype regulatory elements are valid.
This validator checks four types of issues.

All output issues specify the traffic_light "linestring" as the **primitive**, and the linestring ID will be specified as the **ID**.

| Message | Severity | Description |
| ------- | -------- | ----------- |
| "Refers of traffic light regulatory element must have type of traffic_light." | Error | There is a `traffic_light` subtype regulatory element whose `refers` is not a `traffic_light` type linestring. |
| "Refline of traffic light regulatory element must have type of stop_line." | Error | There is a `traffic_light` subtype regulatory element whose `ref_line` is not a `stop_line` type linestring. |
| "Regulatory element of traffic light must have a traffic light(refers)." | Error | There is a `traffic_light` subtype regulatory element that has no `refers`es. |
| "Regulatory element of traffic light must have a stop line(ref_line)." | Error | There is a `traffic_light` subtype regulatory element that has no `ref_line`s |

## Related source codes

- regulatory_element_details_for_traffic_lights.hpp
- regulatory_element_details_for_traffic_lights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ RegulatoryElementsDetailsForCrosswalksValidator::checkRegulatoryElementOfCrosswa
auto crosswalk_polygons = elem->getParameters<lanelet::ConstPolygon3d>(
lanelet::autoware::Crosswalk::AutowareRoleNameString::CrosswalkPolygon);

<<<<<<< HEAD
const auto & issue_cw = lanelet::validation::Issue(
lanelet::validation::Severity::Error, lanelet::validation::Primitive::Lanelet,
lanelet::utils::getId(),
Expand All @@ -83,6 +84,33 @@ RegulatoryElementsDetailsForCrosswalksValidator::checkRegulatoryElementOfCrosswa
lanelet::autoware::validation::checkPrimitivesType(
crosswalk_polygons, lanelet::autoware::Crosswalk::AutowareRoleNameString::CrosswalkPolygon,
issue_poly, issues);
=======
// If this is a crosswalk type regulatory element, the "refers" has to be a "crosswalk" subtype lanelet
const auto & issue_cw = lanelet::validation::Issue(
lanelet::validation::Severity::Error, lanelet::validation::Primitive::Lanelet,
lanelet::utils::getId(),
"Refers of crosswalk regulatory element must have type of crosswalk.");
lanelet::autoware::validation::checkPrimitivesType(
refers, lanelet::AttributeValueString::Lanelet, lanelet::AttributeValueString::Crosswalk,
issue_cw, issues);

// If this is a crosswalk type regulatory element, the "ref_line" has to be a "stop_line" type linestring
const auto & issue_sl = lanelet::validation::Issue(
lanelet::validation::Severity::Error, lanelet::validation::Primitive::LineString,
lanelet::utils::getId(),
"Refline of crosswalk regulatory element must have type of stopline.");
lanelet::autoware::validation::checkPrimitivesType(
ref_lines, lanelet::AttributeValueString::StopLine, issue_sl, issues);

// If this is a crosswalk type regulatory element, the "crosswalk_polygon" has to be a "crosswalk_polygon" type polygon
const auto & issue_poly = lanelet::validation::Issue(
lanelet::validation::Severity::Error, lanelet::validation::Primitive::Polygon,
lanelet::utils::getId(),
"Crosswalk polygon of crosswalk regulatory element must have type of Crosswalk_polygon.");
lanelet::autoware::validation::checkPrimitivesType(
crosswalk_polygons, lanelet::autoware::Crosswalk::AutowareRoleNameString::CrosswalkPolygon,
issue_poly, issues);
>>>>>>> 68f1042 (Wrote detailed README.md)

// Report warning if regulatory element does not have crosswalk polygon
if (crosswalk_polygons.empty()) {
Expand Down