diff --git a/map/autoware_lanelet2_map_validator/README.md b/map/autoware_lanelet2_map_validator/README.md index 3a85e9cf..6ff1c645 100644 --- a/map/autoware_lanelet2_map_validator/README.md +++ b/map/autoware_lanelet2_map_validator/README.md @@ -215,7 +215,7 @@ When the `input_requirements` is thrown to `autoware_lanelet2_map_validator`, it - `lanelet2_validation_results.json` inherits the JSON file of `input_requirements` and add results to it. - So non-required fields (line `version`) remains in the output. - `autoware_lanelet2_map_validator` adds a boolean `passed` field to each requirement. If all validators of the requirement have been passed, the `passed` field of the requirement will be `true` (`false` if not). -- The `passed` field is also given to each validator. If the validator found any issues the `passed` field will turn to be `false` (`true` if not), and adds an `issues` field which is a list of issues found. Each issues contains information of `severity`, `primitive`, `id`, and `message`. +- The `passed` field is also given to each validator. If the validator found any issues the `passed` field will turn to be `false` (`true` if not), and adds an `issues` field which is a list of issues found. Each issue contains information of `severity`, `primitive`, `id`, and `message`. ### Available command options @@ -235,7 +235,7 @@ When the `input_requirements` is thrown to `autoware_lanelet2_map_validator`, it ### Available validators -Since there will be hundreds of validators in the future, the documents for each validators should categorized in the docs file. +Since there will be hundreds of validators in the future, the documents for each validator should categorized in the docs file. The directory structure should be the same to that of the `src/lib/validators` directory. #### Stop Line @@ -255,7 +255,7 @@ The directory structure should be the same to that of the `src/lib/validators` d ## Relationship between requirements and validators This is a table describing the correspondence between the validators that each requirement consists of. -The Validators column will be blank if it hasn't be implemented. +The "Validators" column will be blank if it hasn't be implemented. | ID | Requirements | Validators | | -------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/map/autoware_lanelet2_map_validator/docs/crosswalk/missing_regulatory_elements_for_crosswalk.md b/map/autoware_lanelet2_map_validator/docs/crosswalk/missing_regulatory_elements_for_crosswalk.md index 5506ff5e..c96ec6d4 100644 --- a/map/autoware_lanelet2_map_validator/docs/crosswalk/missing_regulatory_elements_for_crosswalk.md +++ b/map/autoware_lanelet2_map_validator/docs/crosswalk/missing_regulatory_elements_for_crosswalk.md @@ -8,7 +8,8 @@ mapping.crosswalk.missing_regulatory_elements This validator checks whether each `crosswalk` subtype lanelet has a relevant regulatory element. Required information for a crosswalk is written in the [Autoware documentation](https://autowarefoundation.github.io/autoware-documentation/main/design/autoware-architecture/map/map-requirements/vector-map-requirements-overview/category_crosswalk/#vm-05-01-crosswalks-across-the-road). -The issue specifies the crosswalk "lanelet" as the **primitive**, and the lanelet ID will be specified as the **ID**. + +The output issue marks "lanelet" as the **primitive**, and the lanelet ID is written together as **ID**. | Message | Severity | Description | Approach | | ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | diff --git a/map/autoware_lanelet2_map_validator/docs/crosswalk/regulatory_element_details_for_crosswalks.md b/map/autoware_lanelet2_map_validator/docs/crosswalk/regulatory_element_details_for_crosswalks.md index 17d90f1a..62d003e7 100644 --- a/map/autoware_lanelet2_map_validator/docs/crosswalk/regulatory_element_details_for_crosswalks.md +++ b/map/autoware_lanelet2_map_validator/docs/crosswalk/regulatory_element_details_for_crosswalks.md @@ -8,20 +8,20 @@ mapping.crosswalk.regulatory_element_details This validator checks whether the details in the `crosswalk` subtype regulatory elements are valid. Required information for a crosswalk is written in the [Autoware documentation](https://autowarefoundation.github.io/autoware-documentation/main/design/autoware-architecture/map/map-requirements/vector-map-requirements-overview/category_crosswalk/#vm-05-01-crosswalks-across-the-road). -This validator checks seven types of issues. - -All output issues specify the crosswalk "regulatory element" as the **primitive**, and the lanelet ID will be specified as the **ID**. - -| Message | Severity | Description | Approach | -| ---------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| "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. | Check that the `refers` is a `crosswalk` subtype lanelet | -| "ref_line 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. | Check that the `ref_line` is 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. | Check that the `crosswalk_polygon` mentioned in the regulatory element refers to a `crosswalk_polygon` type area. | -| "Regulatory element of cross walk must have lanelet of crosswalk(refers)." | Error | There is a `crosswalk` subtype regulatory element that has no `refers`es. | Write `refers` referring to a `crosswalk` subtype lanelet in the regulatory element | -| "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. | A `crosswalk` subtype regulatory element can have only one `refers`. Remove the `refers` that is not a crosswalk lanelet. | -| "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 | Generally, there should be a stop line for the crosswalk. Be sure that the stop line exists or doesn't. | -| "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. | It is recommended to surround a crosswalk with a `crosswalk_polygon`. Create one and add a `crosswalk_polygon` role member to the regulatory element with the polygon ID. | -| "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. | Only one `crosswalk_polygon` is allowed per polygon. Remove the unnecessary ones. | +This validator checks eight types of issues. + +The output issue marks "lanelet", "linestring" or "regulatory_element" as the **primitive**, and the regulatory element ID is written together as **ID**. + +| Message | Severity | Primitive | Description | Approach | +| ---------------------------------------------------------------------------------------- | -------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| "Refers of crosswalk regulatory element must have type of crosswalk." | Error | lanelet | There is a `crosswalk` subtype regulatory element whose `refers` is not a `crosswalk` subtype lanelet. | Check that the `refers` is a `crosswalk` subtype lanelet | +| "ref_line of crosswalk regulatory element must have type of stopline." | Error | linestring | There is a `crosswalk` subtype regulatory element whose `ref_line` is not a `stop_line` type linestring. | Check that the `ref_line` is a `stop_line` type linestring | +| "Crosswalk polygon of crosswalk regulatory element must have type of Crosswalk_polygon." | Error | polygon | There is a `crosswalk` subtype regulatory element whose `crosswalk_polygon` is not a `crosswalk_polygon` type polygon. | Check that the `crosswalk_polygon` mentioned in the regulatory element refers to a `crosswalk_polygon` type area. | +| "Regulatory element of crosswalk must have lanelet of crosswalk(refers)." | Error | regulatory element | There is a `crosswalk` subtype regulatory element that has no `refers`es. | Write `refers` referring to a `crosswalk` subtype lanelet in the regulatory element | +| "Regulatory element of crosswalk must have only one lanelet of crosswalk(refers)." | Error | regulatory element | There is a `crosswalk` subtype regulatory element that has multiple `refers`es. | A `crosswalk` subtype regulatory element can have only one `refers`. Remove the `refers` that is not a crosswalk lanelet. | +| "Regulatory element of crosswalk does not have stop line(ref_line)." | Info | regulatory element | There is a `crosswalk` subtype regulatory element that has no `ref_line`s | Generally, there should be a stop line for the crosswalk. Be sure that the stop line exists or doesn't. | +| "Regulatory element of crosswalk is nice to have crosswalk_polygon." | Warning | regulatory element | There is a `crosswalk` subtype regulatory element that has no `crosswalk_polygon`s. | It is recommended to surround a crosswalk with a `crosswalk_polygon`. Create one and add a `crosswalk_polygon` role member to the regulatory element with the polygon ID. | +| "Regulatory element of crosswalk must have only one crosswalk_polygon." | Error | regulatory element | There is a `crosswalk` subtype regulatory element that has multiple `crosswalk_polygon`s. | Only one `crosswalk_polygon` is allowed per polygon. Remove the unnecessary ones. | ## Related source codes diff --git a/map/autoware_lanelet2_map_validator/docs/stop_line/missing_regulatory_elements_for_stop_lines.md b/map/autoware_lanelet2_map_validator/docs/stop_line/missing_regulatory_elements_for_stop_lines.md index 84bb85f3..fb286208 100644 --- a/map/autoware_lanelet2_map_validator/docs/stop_line/missing_regulatory_elements_for_stop_lines.md +++ b/map/autoware_lanelet2_map_validator/docs/stop_line/missing_regulatory_elements_for_stop_lines.md @@ -8,7 +8,8 @@ mapping.stop_line.missing_regulatory_elements This validator checks whether each `stop_line` type linestring has a relevant regulatory element. Required information for a stop line is written in the [Autoware documentation](https://autowarefoundation.github.io/autoware-documentation/main/design/autoware-architecture/map/map-requirements/vector-map-requirements-overview/category_stop_line/#vm-02-02-stop-sign). -The issue specifies the stop_line "linestring" as the **primitive**, and the lanelet ID will be specified as the **ID**. + +The output issue marks "linestring" as the **primitive**, and the linestring ID is written together as **ID**. | Message | Severity | Description | Approach | | ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | diff --git a/map/autoware_lanelet2_map_validator/docs/traffic_light/missing_regulatory_elements_for_traffic_lights.md b/map/autoware_lanelet2_map_validator/docs/traffic_light/missing_regulatory_elements_for_traffic_lights.md index 6fb967e7..4bcb311d 100644 --- a/map/autoware_lanelet2_map_validator/docs/traffic_light/missing_regulatory_elements_for_traffic_lights.md +++ b/map/autoware_lanelet2_map_validator/docs/traffic_light/missing_regulatory_elements_for_traffic_lights.md @@ -8,7 +8,8 @@ mapping.traffic_light.missing_regulatory_elements This validator checks whether each `traffic_light` type linestring has a relevant regulatory element. Required information for traffic lights is written in the [Autoware documentation](https://autowarefoundation.github.io/autoware-documentation/main/design/autoware-architecture/map/map-requirements/vector-map-requirements-overview/category_traffic_light/#vm-04-01-traffic-light-basics). -The output issue specifies the traffic_light "linestring" as the **primitive**, and the linestring ID will be specified as the **ID**. + +The output issue marks "linestring" as the **primitive**, and the linestring ID is written together as **ID**. | Message | Severity | Description | Approach | | ----------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | diff --git a/map/autoware_lanelet2_map_validator/docs/traffic_light/regulatory_element_details_for_traffic_lights.md b/map/autoware_lanelet2_map_validator/docs/traffic_light/regulatory_element_details_for_traffic_lights.md index 9f560015..29a585d4 100644 --- a/map/autoware_lanelet2_map_validator/docs/traffic_light/regulatory_element_details_for_traffic_lights.md +++ b/map/autoware_lanelet2_map_validator/docs/traffic_light/regulatory_element_details_for_traffic_lights.md @@ -10,14 +10,14 @@ This validator checks whether the details in the `traffic_light` subtype regulat Required information for traffic lights is written in the [Autoware documentation](https://autowarefoundation.github.io/autoware-documentation/main/design/autoware-architecture/map/map-requirements/vector-map-requirements-overview/category_traffic_light/#vm-04-01-traffic-light-basics). This validator checks four types of issues. -All output issues specify the traffic_light "regulatory element" as the **primitive**, and the linestring ID will be specified as the **ID**. - -| Message | Severity | Description | Approach | -| ----------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| "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. | Check that the `refers` in the regulatory element is a `traffic_light` type linestring. | -| "ref_line 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. | Check that the `ref_line` in the regulatory element is 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. | Add `refers` to the regulatory element that refers to the id of the traffic light linestring. | -| "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 | Add `ref_line` to the regulatory element that refers to the id of the stop line linestring. | +The output issue marks "linestring" or "regulatory element" as the **primitive**, and the lanelet ID is written together as **ID**. + +| Message | Severity | Primitive | Description | Approach | +| ----------------------------------------------------------------------------- | -------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| "Refers of traffic light regulatory element must have type of traffic_light." | Error | linestring | There is a `traffic_light` subtype regulatory element whose `refers` is not a `traffic_light` type linestring. | Check that the `refers` in the regulatory element is a `traffic_light` type linestring. | +| "ref_line of traffic light regulatory element must have type of stop_line." | Error | linestring | There is a `traffic_light` subtype regulatory element whose `ref_line` is not a `stop_line` type linestring. | Check that the `ref_line` in the regulatory element is a `stop_line` type linestring | +| "Regulatory element of traffic light must have a traffic light(refers)." | Error | regulatory element | There is a `traffic_light` subtype regulatory element that has no `refers`es. | Add `refers` to the regulatory element that refers to the id of the traffic light linestring. | +| "Regulatory element of traffic light must have a stop line(ref_line)." | Error | regulatory element | There is a `traffic_light` subtype regulatory element that has no `ref_line`s | Add `ref_line` to the regulatory element that refers to the id of the stop line linestring. | ## Related source codes diff --git a/map/autoware_lanelet2_map_validator/src/validators/crosswalk/regulatory_element_details_for_crosswalks.cpp b/map/autoware_lanelet2_map_validator/src/validators/crosswalk/regulatory_element_details_for_crosswalks.cpp index 7c305c9e..1502c2a5 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/crosswalk/regulatory_element_details_for_crosswalks.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/crosswalk/regulatory_element_details_for_crosswalks.cpp @@ -96,30 +96,30 @@ RegulatoryElementsDetailsForCrosswalksValidator::checkRegulatoryElementOfCrosswa if (crosswalk_polygons.empty()) { issues.emplace_back( lanelet::validation::Severity::Warning, lanelet::validation::Primitive::RegulatoryElement, - elem->id(), "Regulatory element of cross walk is nice to have crosswalk_polygon."); + elem->id(), "Regulatory element of crosswalk is nice to have crosswalk_polygon."); } else if (crosswalk_polygons.size() > 1) { // Report error if regulatory element has two or // more crosswalk polygon issues.emplace_back( lanelet::validation::Severity::Error, lanelet::validation::Primitive::RegulatoryElement, - elem->id(), "Regulatory element of cross walk must have only one crosswalk_polygon."); + elem->id(), "Regulatory element of crosswalk must have only one crosswalk_polygon."); } // Report Info if regulatory element does not have stop line if (ref_lines.empty()) { issues.emplace_back( lanelet::validation::Severity::Info, lanelet::validation::Primitive::RegulatoryElement, - elem->id(), "Regulatory element of cross walk does not have stop line(ref_line)."); + elem->id(), "Regulatory element of crosswalk does not have stop line(ref_line)."); } // Report error if regulatory element does not have lanelet of crosswalk if (refers.empty()) { issues.emplace_back( lanelet::validation::Severity::Error, lanelet::validation::Primitive::RegulatoryElement, - elem->id(), "Regulatory element of cross walk must have lanelet of crosswalk(refers)."); + elem->id(), "Regulatory element of crosswalk must have lanelet of crosswalk(refers)."); } else if (refers.size() > 1) { // Report error if regulatory element has two or more lanelet // of crosswalk issues.emplace_back( lanelet::validation::Severity::Error, lanelet::validation::Primitive::RegulatoryElement, elem->id(), - "Regulatory element of cross walk must have only one lanelet of crosswalk(refers)."); + "Regulatory element of crosswalk must have only one lanelet of crosswalk(refers)."); } } return issues; diff --git a/map/autoware_lanelet2_map_validator/test/src/test_regulatory_element_details.cpp b/map/autoware_lanelet2_map_validator/test/src/test_regulatory_element_details.cpp index 43deee94..83a40a6b 100644 --- a/map/autoware_lanelet2_map_validator/test/src/test_regulatory_element_details.cpp +++ b/map/autoware_lanelet2_map_validator/test/src/test_regulatory_element_details.cpp @@ -257,7 +257,7 @@ TEST_F(TestSuite, RegulatoryElementOfCrosswalkWithoutPolygon) // NOLINT for gte LineString3d(getId(), {Point3d(getId(), 3.0, 1.0, 0.1), Point3d(getId(), 3.0, 2.0, 0.1)}), cw_attr); - // Crosswalk regulatory element without cross walk polygon. It refers to the polygon without cross + // Crosswalk regulatory element without crosswalk polygon. It refers to the polygon without cross // walk polygon attribute. RegulatoryElementPtr reg_elem = Crosswalk::make( 99999, cw_re_attr, cw_no_poly, Polygon3d(99998), @@ -274,7 +274,7 @@ TEST_F(TestSuite, RegulatoryElementOfCrosswalkWithoutPolygon) // NOLINT for gte static constexpr const char * expected_message1 = "Crosswalk polygon of crosswalk regulatory element must have type of Crosswalk_polygon."; static constexpr const char * expected_message2 = - "Regulatory element of cross walk is nice to have crosswalk_polygon."; + "Regulatory element of crosswalk is nice to have crosswalk_polygon."; EXPECT_EQ(expected_num_issues, issues.size()); for (const auto & issue : issues) { if (issue.id == 99998) { @@ -314,7 +314,7 @@ TEST_F(TestSuite, RegulatoryElementOfCrosswalkWithoutStopline) // NOLINT for gt uint8_t expected_num_issues = 1; static constexpr const char * expected_message = - "Regulatory element of cross walk does not have stop line(ref_line)."; + "Regulatory element of crosswalk does not have stop line(ref_line)."; EXPECT_EQ(expected_num_issues, issues.size()); for (const auto & issue : issues) { EXPECT_EQ(expected_message, issue.message); @@ -350,7 +350,7 @@ TEST_F(TestSuite, RegulatoryElementOfCrosswalkWithoutCrosswalk) // NOLINT for g static constexpr const char * expected_message1 = "Refers of crosswalk regulatory element must have type of crosswalk."; static constexpr const char * expected_message2 = - "Regulatory element of cross walk must have lanelet of crosswalk(refers)."; + "Regulatory element of crosswalk must have lanelet of crosswalk(refers)."; EXPECT_EQ(expected_num_issues, issues.size()); for (const auto & issue : issues) { if (issue.id == 99998) {