From d33b95f9f4d2a95a5aac6becda7e46605f68021e Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Tue, 3 Dec 2024 17:26:56 +0900 Subject: [PATCH 01/12] Create the framework for intersection_area_validity. Signed-off-by: TaikiYamada4 --- .../intersection_area_validity.hpp | 37 ++++++++++++++ .../intersection_area_validity.cpp | 49 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp create mode 100644 map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp new file mode 100644 index 00000000..708cefab --- /dev/null +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp @@ -0,0 +1,37 @@ +// Copyright 2024 Autoware Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LANELET2_MAP_VALIDATOR__VALIDATORS__INTERSECTION__INTERSECTION_AREA_VALIDITY_HPP_ // NOLINT +#define LANELET2_MAP_VALIDATOR__VALIDATORS__INTERSECTION__INTERSECTION_AREA_VALIDITY_HPP_ // NOLINT + +#include +#include + +namespace lanelet::autoware::validation +{ +class IntersectionAreaValidityValidator : public lanelet::validation::MapValidator +{ +public: + constexpr static const char * name() { return "mapping.intersection.intersection_area_validity"; } + + lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override; + +private: + lanelet::validation::Issues check_intersection_area_validity(const lanelet::LaneletMap & map); +}; +} // namespace lanelet::autoware::validation + +// clang-format off +#endif // LANELET2_MAP_VALIDATOR__VALIDATORS__INTERSECTION__INTERSECTION_AREA_VALIDITY_HPP_ // NOLINT +// clang-format on diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp new file mode 100644 index 00000000..cdae260e --- /dev/null +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp @@ -0,0 +1,49 @@ +// Copyright 2024 Autoware Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp" + +#include "lanelet2_map_validator/utils.hpp" + +#include + +#include +#include + +namespace lanelet::autoware::validation +{ +namespace +{ +lanelet::validation::RegisterMapValidator reg; +} + +lanelet::validation::Issues IntersectionAreaValidityValidator::operator()( + const lanelet::LaneletMap & map) +{ + lanelet::validation::Issues issues; + + lanelet::autoware::validation::appendIssues(issues, check_intersection_area_validity(map)); + + return issues; +} + +lanelet::validation::Issues IntersectionAreaValidityValidator::check_intersection_area_validity( + const lanelet::LaneletMap & map) +{ + lanelet::validation::Issues issues; + + return issues; +} + +} // namespace lanelet::autoware::validation From 09bd25a29a03e5a4ddb6a4c6e2eddb9101f4267d Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Mon, 9 Dec 2024 09:52:02 +0900 Subject: [PATCH 02/12] Made is_valid checker in intersection_area_validity Signed-off-by: TaikiYamada4 --- .../intersection_area_validity.hpp | 2 + .../intersection_area_validity.cpp | 40 ++++++++++++++++++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp index 708cefab..9457d044 100644 --- a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp @@ -29,6 +29,8 @@ class IntersectionAreaValidityValidator : public lanelet::validation::MapValidat private: lanelet::validation::Issues check_intersection_area_validity(const lanelet::LaneletMap & map); + lanelet::BoundingBox2d get_circumscribed_box_from_polygon( + const lanelet::ConstPolygon3d & polygon); }; } // namespace lanelet::autoware::validation diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp index cdae260e..ec1a2d01 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp @@ -16,10 +16,13 @@ #include "lanelet2_map_validator/utils.hpp" +#include + #include +#include +#include -#include -#include +#include namespace lanelet::autoware::validation { @@ -43,7 +46,40 @@ lanelet::validation::Issues IntersectionAreaValidityValidator::check_intersectio { lanelet::validation::Issues issues; + for (const lanelet::ConstPolygon3d & polygon3d : map.polygonLayer) { + lanelet::BasicPolygon2d basic_polygon2d = lanelet::traits::to2D(polygon3d.basicPolygon()); + + std::string reason; + bool polygon_is_valid = boost::geometry::is_valid(basic_polygon2d, reason); + if (!polygon_is_valid) { + issues.emplace_back( + lanelet::validation::Severity::Error, lanelet::validation::Primitive::Polygon, + polygon3d.id(), + append_issue_code_prefix( + this->name(), 1, "This intersection_area is not valid (reason: " + reason + ").")); + } + } + return issues; } +lanelet::BoundingBox2d get_circumscribed_box_from_polygon(const lanelet::ConstPolygon3d & polygon) +{ + double minX = std::numeric_limits::max(); + double minY = std::numeric_limits::max(); + double maxX = std::numeric_limits::lowest(); + double maxY = std::numeric_limits::lowest(); + + for (const lanelet::ConstPoint3d & point : polygon) { + const lanelet::BasicPoint2d & coord = point.basicPoint2d(); + minX = std::min(minX, coord.x()); + minY = std::min(minY, coord.y()); + maxX = std::max(maxX, coord.x()); + maxY = std::max(maxY, coord.y()); + } + + return lanelet::BoundingBox2d( + lanelet::BasicPoint2d(minX, minY), lanelet::BasicPoint2d(maxX, maxY)); +} + } // namespace lanelet::autoware::validation From ade584fac6f701eef5a836387e949d09360f51f6 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Mon, 9 Dec 2024 13:22:04 +0900 Subject: [PATCH 03/12] Split and create a new validator intersection_area_segement_type. Signed-off-by: TaikiYamada4 --- .../intersection_area_segment_type.hpp | 46 +++++++++ .../intersection_area_validity.hpp | 2 - .../intersection_area_segment_type.cpp | 99 +++++++++++++++++++ .../intersection_area_validity.cpp | 20 ---- 4 files changed, 145 insertions(+), 22 deletions(-) create mode 100644 map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp create mode 100644 map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp new file mode 100644 index 00000000..94f077e6 --- /dev/null +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp @@ -0,0 +1,46 @@ +// Copyright 2024 Autoware Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#ifndef LANELET2_MAP_VALIDATOR__VALIDATORS__INTERSECTION__INTERSECTION_AREA_SEGMENT_TYPE_HPP_ // NOLINT +#define LANELET2_MAP_VALIDATOR__VALIDATORS__INTERSECTION__INTERSECTION_AREA_SEGMENT_TYPE_HPP_ // NOLINT + +#include +#include + +#include + +namespace lanelet::autoware::validation +{ +class IntersectionAreaSegmentTypeValidator : public lanelet::validation::MapValidator +{ +public: + constexpr static const char * name() + { + return "mapping.intersection.intersection_area_segment_type"; + } + + lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override; + +private: + lanelet::validation::Issues check_intersection_area_segment_type(const lanelet::LaneletMap & map); + std::pair extract_nearby_elements( + const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area); + lanelet::BoundingBox2d get_circumscribed_box_from_polygon( + const lanelet::ConstPolygon3d & polygon); +}; +} // namespace lanelet::autoware::validation + +// clang-format off +#endif // LANELET2_MAP_VALIDATOR__VALIDATORS__INTERSECTION__INTERSECTION_AREA_SEGMENT_TYPE_HPP_ // NOLINT +// clang-format on diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp index 9457d044..708cefab 100644 --- a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp @@ -29,8 +29,6 @@ class IntersectionAreaValidityValidator : public lanelet::validation::MapValidat private: lanelet::validation::Issues check_intersection_area_validity(const lanelet::LaneletMap & map); - lanelet::BoundingBox2d get_circumscribed_box_from_polygon( - const lanelet::ConstPolygon3d & polygon); }; } // namespace lanelet::autoware::validation diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp new file mode 100644 index 00000000..000d82d1 --- /dev/null +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp @@ -0,0 +1,99 @@ +// Copyright 2024 Autoware Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp" + +#include "lanelet2_map_validator/utils.hpp" + +#include + +#include +#include +#include + +#include + +namespace lanelet::autoware::validation +{ +namespace +{ +lanelet::validation::RegisterMapValidator reg; +} + +lanelet::validation::Issues IntersectionAreaSegmentTypeValidator::operator()( + const lanelet::LaneletMap & map) +{ + lanelet::validation::Issues issues; + + lanelet::autoware::validation::appendIssues(issues, check_intersection_area_segment_type(map)); + + return issues; +} + +lanelet::validation::Issues +IntersectionAreaSegmentTypeValidator::check_intersection_area_segment_type( + const lanelet::LaneletMap & map) +{ + lanelet::validation::Issues issues; + + for (const lanelet::ConstPolygon3d & polygon3d : map.polygonLayer) { + const auto [nearby_lanelets, nearby_road_borders] = extract_nearby_elements(map, polygon3d); + } + + return issues; +} + +std::pair +IntersectionAreaSegmentTypeValidator::extract_nearby_elements( + const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area) +{ + lanelet::BoundingBox2d bbox2d = get_circumscribed_box_from_polygon(intersection_area); + + lanelet::ConstLanelets nearby_lanelets = map.laneletLayer.search(bbox2d); + lanelet::ConstLineStrings3d nearby_linestrings = map.lineStringLayer.search(bbox2d); + + lanelet::ConstLineStrings3d nearby_road_borders; + for (const auto linestring : nearby_linestrings) { + if ( + linestring.hasAttribute(lanelet::AttributeName::Type) && + linestring.attribute(lanelet::AttributeName::Type).value() == + lanelet::AttributeValueString::RoadBorder) { + nearby_road_borders.push_back(linestring); + } + } + + return std::make_pair(nearby_lanelets, nearby_road_borders); +} + +lanelet::BoundingBox2d IntersectionAreaSegmentTypeValidator::get_circumscribed_box_from_polygon( + const lanelet::ConstPolygon3d & polygon) +{ + double minX = std::numeric_limits::max(); + double minY = std::numeric_limits::max(); + double maxX = std::numeric_limits::lowest(); + double maxY = std::numeric_limits::lowest(); + + for (const lanelet::ConstPoint3d & point : polygon) { + const lanelet::BasicPoint2d & coord = point.basicPoint2d(); + minX = std::min(minX, coord.x()); + minY = std::min(minY, coord.y()); + maxX = std::max(maxX, coord.x()); + maxY = std::max(maxY, coord.y()); + } + + return lanelet::BoundingBox2d( + lanelet::BasicPoint2d(minX, minY), lanelet::BasicPoint2d(maxX, maxY)); +} + +} // namespace lanelet::autoware::validation diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp index ec1a2d01..48156672 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp @@ -62,24 +62,4 @@ lanelet::validation::Issues IntersectionAreaValidityValidator::check_intersectio return issues; } - -lanelet::BoundingBox2d get_circumscribed_box_from_polygon(const lanelet::ConstPolygon3d & polygon) -{ - double minX = std::numeric_limits::max(); - double minY = std::numeric_limits::max(); - double maxX = std::numeric_limits::lowest(); - double maxY = std::numeric_limits::lowest(); - - for (const lanelet::ConstPoint3d & point : polygon) { - const lanelet::BasicPoint2d & coord = point.basicPoint2d(); - minX = std::min(minX, coord.x()); - minY = std::min(minY, coord.y()); - maxX = std::max(maxX, coord.x()); - maxY = std::max(maxY, coord.y()); - } - - return lanelet::BoundingBox2d( - lanelet::BasicPoint2d(minX, minY), lanelet::BasicPoint2d(maxX, maxY)); -} - } // namespace lanelet::autoware::validation From 6b4eac813a75e755c66f5c520e0e53af254acf39 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Mon, 9 Dec 2024 17:41:10 +0900 Subject: [PATCH 04/12] Completed intersection_area_segment_type Signed-off-by: TaikiYamada4 --- .../intersection_area_segment_type.hpp | 4 +- .../intersection_area_segment_type.cpp | 86 +++++++++++++++++-- .../intersection_area_validity.cpp | 10 ++- 3 files changed, 91 insertions(+), 9 deletions(-) diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp index 94f077e6..defa9e4e 100644 --- a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp @@ -18,6 +18,7 @@ #include #include +#include #include namespace lanelet::autoware::validation @@ -34,10 +35,11 @@ class IntersectionAreaSegmentTypeValidator : public lanelet::validation::MapVali private: lanelet::validation::Issues check_intersection_area_segment_type(const lanelet::LaneletMap & map); - std::pair extract_nearby_elements( + lanelet::LaneletSubmapUPtr create_nearby_borders_submap( const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area); lanelet::BoundingBox2d get_circumscribed_box_from_polygon( const lanelet::ConstPolygon3d & polygon); + std::string ids_to_string(const lanelet::Ids ids); }; } // namespace lanelet::autoware::validation diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp index 000d82d1..961f73ae 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp @@ -48,14 +48,36 @@ IntersectionAreaSegmentTypeValidator::check_intersection_area_segment_type( lanelet::validation::Issues issues; for (const lanelet::ConstPolygon3d & polygon3d : map.polygonLayer) { - const auto [nearby_lanelets, nearby_road_borders] = extract_nearby_elements(map, polygon3d); + if ( + !polygon3d.hasAttribute(lanelet::AttributeName::Type) || + polygon3d.attribute(lanelet::AttributeName::Type).value() != "intersection_area") { + continue; + } + + const auto borders_submap = create_nearby_borders_submap(map, polygon3d); + lanelet::Ids invalid_point_ids = {}; + for (const lanelet::ConstPoint3d & point : polygon3d) { + lanelet::LineStrings3d search_results = borders_submap->lineStringLayer.findUsages(point); + if (search_results.empty()) { + invalid_point_ids.push_back(point.id()); + } + } + if (!invalid_point_ids.empty()) { + issues.emplace_back( + lanelet::validation::Severity::Error, lanelet::validation::Primitive::Polygon, + polygon3d.id(), + append_issue_code_prefix( + this->name(), 1, + "This intersection area is not made by points from road_border linestrings or lanelet " + "edges. (Point ID: " + + ids_to_string(invalid_point_ids) + ")")); + } } return issues; } -std::pair -IntersectionAreaSegmentTypeValidator::extract_nearby_elements( +lanelet::LaneletSubmapUPtr IntersectionAreaSegmentTypeValidator::create_nearby_borders_submap( const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area) { lanelet::BoundingBox2d bbox2d = get_circumscribed_box_from_polygon(intersection_area); @@ -63,17 +85,54 @@ IntersectionAreaSegmentTypeValidator::extract_nearby_elements( lanelet::ConstLanelets nearby_lanelets = map.laneletLayer.search(bbox2d); lanelet::ConstLineStrings3d nearby_linestrings = map.lineStringLayer.search(bbox2d); - lanelet::ConstLineStrings3d nearby_road_borders; - for (const auto linestring : nearby_linestrings) { + lanelet::LineStrings3d nearby_borders; + + // Collect lanelet edges intersecting the intersection area + for (const auto & lanelet : nearby_lanelets) { + if ( + !lanelet.hasAttribute(lanelet::AttributeName::Subtype) || + lanelet.attribute(lanelet::AttributeName::Subtype).value() != + lanelet::AttributeValueString::Road) { + continue; + } + + if (bbox2d.contains(lanelet.leftBound2d().front().basicPoint2d())) { + lanelet::Point3d left_point(lanelet.leftBound().front()); + lanelet::Point3d right_point(lanelet.rightBound().front()); + + lanelet::AttributeMap attribute; + attribute["type"] = "lanelet_edge"; // An instant linestring type for this code + + lanelet::LineString3d lanelet_front_edge( + lanelet::utils::getId(), {left_point, right_point}, attribute); + nearby_borders.push_back(lanelet_front_edge); + } + + if (bbox2d.contains(lanelet.leftBound2d().back().basicPoint2d())) { + lanelet::Point3d left_point(lanelet.leftBound().back()); + lanelet::Point3d right_point(lanelet.rightBound().back()); + + lanelet::AttributeMap attribute; + attribute["type"] = "lanelet_edge"; // An instant linestring type for this code + + lanelet::LineString3d lanelet_back_edge( + lanelet::utils::getId(), {left_point, right_point}, attribute); + nearby_borders.push_back(lanelet_back_edge); + } + } + + // Collect road_border subtype linestrings + for (const auto & linestring : nearby_linestrings) { if ( linestring.hasAttribute(lanelet::AttributeName::Type) && linestring.attribute(lanelet::AttributeName::Type).value() == lanelet::AttributeValueString::RoadBorder) { - nearby_road_borders.push_back(linestring); + auto data = std::const_pointer_cast(linestring.constData()); + nearby_borders.push_back(lanelet::LineString3d(data, linestring.inverted())); } } - return std::make_pair(nearby_lanelets, nearby_road_borders); + return lanelet::utils::createSubmap(nearby_borders); } lanelet::BoundingBox2d IntersectionAreaSegmentTypeValidator::get_circumscribed_box_from_polygon( @@ -96,4 +155,17 @@ lanelet::BoundingBox2d IntersectionAreaSegmentTypeValidator::get_circumscribed_b lanelet::BasicPoint2d(minX, minY), lanelet::BasicPoint2d(maxX, maxY)); } +std::string IntersectionAreaSegmentTypeValidator::ids_to_string(const lanelet::Ids ids) +{ + std::string result = "("; + for (size_t i = 0; i < ids.size(); i++) { + result += std::to_string(ids[i]); + if (i < ids.size() - 1) { + result += ", "; + } + } + result += ")"; + return result; +} + } // namespace lanelet::autoware::validation diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp index 48156672..2a0a2893 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_validity.cpp @@ -47,6 +47,12 @@ lanelet::validation::Issues IntersectionAreaValidityValidator::check_intersectio lanelet::validation::Issues issues; for (const lanelet::ConstPolygon3d & polygon3d : map.polygonLayer) { + if ( + !polygon3d.hasAttribute(lanelet::AttributeName::Type) || + polygon3d.attribute(lanelet::AttributeName::Type).value() != "intersection_area") { + continue; + } + lanelet::BasicPolygon2d basic_polygon2d = lanelet::traits::to2D(polygon3d.basicPolygon()); std::string reason; @@ -56,7 +62,9 @@ lanelet::validation::Issues IntersectionAreaValidityValidator::check_intersectio lanelet::validation::Severity::Error, lanelet::validation::Primitive::Polygon, polygon3d.id(), append_issue_code_prefix( - this->name(), 1, "This intersection_area is not valid (reason: " + reason + ").")); + this->name(), 1, + "This intersection_area doesn't satisfy boost::geometry::is_valid (reason: " + reason + + ").")); } } From 38b4f5edbd1eb36c876adddae5d761f884fa2852 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Mon, 9 Dec 2024 17:49:55 +0900 Subject: [PATCH 05/12] Added `vm-03-08` to autoware_requirement_set.json Signed-off-by: TaikiYamada4 --- .../autoware_requirement_set.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/map/autoware_lanelet2_map_validator/autoware_requirement_set.json b/map/autoware_lanelet2_map_validator/autoware_requirement_set.json index 917993cb..11e6846f 100644 --- a/map/autoware_lanelet2_map_validator/autoware_requirement_set.json +++ b/map/autoware_lanelet2_map_validator/autoware_requirement_set.json @@ -8,6 +8,22 @@ } ] }, + { + "id": "vm-03-08", + "validators": [ + { + "name": "mapping.intersection.intersection_area_validity" + }, + { + "name": "mapping.intersection.intersection_area_segment_type", + "prerequisites": [ + { + "name": "mapping.intersection.intersection_area_validity" + } + ] + } + ] + }, { "id": "vm-04-01", "validators": [ From 7ce6807c815504cfe160b0d89e40ee8471819c45 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Tue, 10 Dec 2024 16:36:29 +0900 Subject: [PATCH 06/12] Added `vm-03-08` to autoware_requirement_set.json Signed-off-by: TaikiYamada4 --- .../autoware_requirement_set.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/map/autoware_lanelet2_map_validator/autoware_requirement_set.json b/map/autoware_lanelet2_map_validator/autoware_requirement_set.json index 11e6846f..74185b48 100644 --- a/map/autoware_lanelet2_map_validator/autoware_requirement_set.json +++ b/map/autoware_lanelet2_map_validator/autoware_requirement_set.json @@ -15,12 +15,7 @@ "name": "mapping.intersection.intersection_area_validity" }, { - "name": "mapping.intersection.intersection_area_segment_type", - "prerequisites": [ - { - "name": "mapping.intersection.intersection_area_validity" - } - ] + "name": "mapping.intersection.intersection_area_segment_type" } ] }, From ed15cf4e56fe7eb50ca08dcd334aa503976bed9a Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Tue, 10 Dec 2024 16:37:30 +0900 Subject: [PATCH 07/12] Added documents for intersection_area validators Signed-off-by: TaikiYamada4 --- map/autoware_lanelet2_map_validator/README.md | 2 +- .../intersection_area_segment_type.md | 31 +++++++++++++++++++ .../intersection_area_validity.md | 20 ++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md create mode 100644 map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_validity.md diff --git a/map/autoware_lanelet2_map_validator/README.md b/map/autoware_lanelet2_map_validator/README.md index daa8706c..db59817d 100644 --- a/map/autoware_lanelet2_map_validator/README.md +++ b/map/autoware_lanelet2_map_validator/README.md @@ -322,7 +322,7 @@ The "Validators" column will be blank if it hasn't be implemented. | vm-03-05 | Lanelet division in the intersection | | | vm-03-06 | Guide lines in the intersection | | | vm-03-07 | Multiple lanelets in the intersection | | -| vm-03-08 | Intersection Area range | | +| vm-03-08 | Intersection Area range | [mapping.intersection.intersection_area_validity](./docs/intersection/intersection_area_validity.md), [mapping.intersection.intersection_area_segment_type](./docs/intersection/intersection_area_segment_type.md) | | vm-03-09 | Range of Lanelet in the intersection | | | vm-03-10 | Right of way (with signal) | | | vm-03-11 | Right of way (without signal) | | diff --git a/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md b/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md new file mode 100644 index 00000000..d9cb9d4a --- /dev/null +++ b/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md @@ -0,0 +1,31 @@ +# intersection_area_segment_type + +## Validator name + +mapping.intersection.intersection_area_segment_type + +## Feature + +This validator check whether each `intersection_area` type polygon is made from points that belong to `road_border` type linestrings or the starting/ending edge of a lanelet. + +This is acheived by the following procedure. + +1. Create a 2D bounding box that circumscribes the polygon. +2. Collect `road_border` type linestrings within or intersecting the 2D bounding box. +3. Collect starting/ending edges of lanelets within or intersecting the 2D bounding box. +4. Examine each point that constitutes the polygon whether it belongs to the collection above. + +The validator outputs the following issue with the corresponding ID of the primitive. + +| Issue Code | Message | Severity | Primitive | Description | Approach | +| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| Intersection.IntersectionAreaSegmentType-001 | "This intersection area is not made by points from road_border linestrings or lanelet edges. (Point ID: \)" | Error | Polygon | The `intersection_area` polygon has points that doesn't belong to `road_border` type linestrings or lanelet edges. The violating points are listed up at \. | Ensure that the `intersection_area` is formed ONLY by `road_border` linestrings and lanelet edges. | + +### Supplementary information + +Note that this validator only examines what type of linestring the points constituting the polygon belongs to, and doesn't examine they have a valid connection. Use the `mapping.intersection.intersection_area_validity` to check whether the polygon is `boost::geometry::is_valid()`. + +## Related source codes + +- intersection_area_segment_type.hpp +- intersection_area_segment_type.cpp diff --git a/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_validity.md b/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_validity.md new file mode 100644 index 00000000..fd0eb7fe --- /dev/null +++ b/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_validity.md @@ -0,0 +1,20 @@ +# intersection_area_validity + +## Validator name + +mapping.intersection.intersection_area_validity + +## Feature + +This validator check whether each `intersection_area` type polygon satisfies [`boost::geometry::is_valid`](https://www.boost.io/doc/libs/1_86_0/libs/geometry/doc/html/geometry/reference/algorithms/is_valid/is_valid_2_with_message.html). + +The validator outputs the following issue with the corresponding ID of the primitive. + +| Issue Code | Message | Severity | Primitive | Description | Approach | +| ----------------------------------------- | --------------------------------------------------------------------------------------- | -------- | --------- | --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| Intersection.IntersectionAreaValidity-001 | "This intersection_area doesn't satisfy boost::geometry::is_valid (reason: \) | Error | Polygon | The `intersection_area` polygon didn't satisfy `boost::geometry::is_valid`. | There are several reasons expected and it is written in "(reason: \)". The \ is a copy of [the output message defined in the `boost::geometry` library](https://www.boost.org/doc/libs/1_86_0/boost/geometry/policies/is_valid/failing_reason_policy.hpp). | + +## Related source codes + +- intersection_area_validity.hpp +- intersection_area_validity.cpp From c1c04f4c28c59d130597e5a578df60090d36b539 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Tue, 10 Dec 2024 16:38:01 +0900 Subject: [PATCH 08/12] Added `intersection_area` type polygons to sample_map.osm Signed-off-by: TaikiYamada4 --- .../test/data/map/sample_map.osm | 1562 ++++++++++++++++- 1 file changed, 1471 insertions(+), 91 deletions(-) diff --git a/map/autoware_lanelet2_map_validator/test/data/map/sample_map.osm b/map/autoware_lanelet2_map_validator/test/data/map/sample_map.osm index e9b84e91..8994ebae 100644 --- a/map/autoware_lanelet2_map_validator/test/data/map/sample_map.osm +++ b/map/autoware_lanelet2_map_validator/test/data/map/sample_map.osm @@ -1,6 +1,6 @@ - + @@ -155,14 +155,14 @@ - - - + + + - - - + + + @@ -170,29 +170,24 @@ - - - + + + - - - - - - - - + + + - - - + + + - - - + + + @@ -200,19 +195,19 @@ - - - + + + - - - + + + - - - + + + @@ -385,10 +380,10 @@ - - - - + + + + @@ -445,14 +440,14 @@ - - - + + + - - - + + + @@ -625,24 +620,24 @@ - - - + + + - - + + - - - - + + + + - - - + + + @@ -770,11 +765,6 @@ - - - - - @@ -3631,9 +3621,9 @@ - - - + + + @@ -3731,6 +3721,921 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4152,7 +5057,6 @@ - @@ -4653,11 +5557,6 @@ - - - - - @@ -5090,12 +5989,6 @@ - - - - - - @@ -5243,12 +6136,6 @@ - - - - - - @@ -5283,6 +6170,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5291,6 +6488,162 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5786,15 +7139,6 @@ - - - - - - - - - @@ -5822,6 +7166,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5891,7 +7271,7 @@ - + From f645004484b3151ba1d8e124bc618234edc1ea53 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Tue, 10 Dec 2024 18:32:36 +0900 Subject: [PATCH 09/12] Added test codes Signed-off-by: TaikiYamada4 --- .../CMakeLists.txt | 2 + .../intersection/basic_intersection_area.osm | 2985 ++++++++++++++++ ...ntersection_area_with_irrelative_point.osm | 2992 +++++++++++++++++ ...tersection_area_with_self_intersection.osm | 2986 ++++++++++++++++ ...ection_area_with_wrong_linestring_type.osm | 2986 ++++++++++++++++ ...tersection_area_with_wrong_orientation.osm | 2985 ++++++++++++++++ .../test_intersection_area_segment_type.cpp | 93 + .../src/test_intersection_area_validity.cpp | 93 + 8 files changed, 15122 insertions(+) create mode 100644 map/autoware_lanelet2_map_validator/test/data/map/intersection/basic_intersection_area.osm create mode 100644 map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_irrelative_point.osm create mode 100644 map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_self_intersection.osm create mode 100644 map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_linestring_type.osm create mode 100644 map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_orientation.osm create mode 100644 map/autoware_lanelet2_map_validator/test/src/test_intersection_area_segment_type.cpp create mode 100644 map/autoware_lanelet2_map_validator/test/src/test_intersection_area_validity.cpp diff --git a/map/autoware_lanelet2_map_validator/CMakeLists.txt b/map/autoware_lanelet2_map_validator/CMakeLists.txt index 339c3a38..691821ee 100644 --- a/map/autoware_lanelet2_map_validator/CMakeLists.txt +++ b/map/autoware_lanelet2_map_validator/CMakeLists.txt @@ -65,6 +65,8 @@ if(BUILD_TESTING) add_validation_test(regulatory_elements_details_for_traffic_lights) add_validation_test(traffic_light_facing) add_validation_test(missing_referrers_for_traffic_lights) + add_validation_test(intersection_area_validity) + add_validation_test(intersection_area_segment_type) endif() ament_auto_package( diff --git a/map/autoware_lanelet2_map_validator/test/data/map/intersection/basic_intersection_area.osm b/map/autoware_lanelet2_map_validator/test/data/map/intersection/basic_intersection_area.osm new file mode 100644 index 00000000..b5122a94 --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/data/map/intersection/basic_intersection_area.osm @@ -0,0 +1,2985 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_irrelative_point.osm b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_irrelative_point.osm new file mode 100644 index 00000000..a8e04a2b --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_irrelative_point.osm @@ -0,0 +1,2992 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_self_intersection.osm b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_self_intersection.osm new file mode 100644 index 00000000..d0679e0d --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_self_intersection.osm @@ -0,0 +1,2986 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_linestring_type.osm b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_linestring_type.osm new file mode 100644 index 00000000..9c212f79 --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_linestring_type.osm @@ -0,0 +1,2986 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_orientation.osm b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_orientation.osm new file mode 100644 index 00000000..4bb51e8f --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/data/map/intersection/intersection_area_with_wrong_orientation.osm @@ -0,0 +1,2985 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/map/autoware_lanelet2_map_validator/test/src/test_intersection_area_segment_type.cpp b/map/autoware_lanelet2_map_validator/test/src/test_intersection_area_segment_type.cpp new file mode 100644 index 00000000..df72f1b8 --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/src/test_intersection_area_segment_type.cpp @@ -0,0 +1,93 @@ +// Copyright 2024 Autoware Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp" +#include "map_validation_tester.hpp" + +#include +#include + +class TestIntersectionAreaSegmentType : public MapValidationTester +{ +private: +}; + +TEST_F(TestIntersectionAreaSegmentType, ValidatorAvailability) // NOLINT for gtest +{ + std::string expected_validator_name = + lanelet::autoware::validation::IntersectionAreaSegmentTypeValidator::name(); + + lanelet::validation::Strings validators = + lanelet::validation::availabeChecks(expected_validator_name); // cspell:disable-line + + const uint32_t expected_validator_num = 1; + EXPECT_EQ(expected_validator_num, validators.size()); + EXPECT_EQ(expected_validator_name, validators[0]); +} + +TEST_F(TestIntersectionAreaSegmentType, CheckIrrelativePoint) // NOLINT for gtest +{ + load_target_map("intersection/intersection_area_with_irrelative_point.osm"); + + lanelet::autoware::validation::IntersectionAreaSegmentTypeValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 1); + EXPECT_EQ(issues[0].id, 10803); + EXPECT_EQ(issues[0].severity, lanelet::validation::Severity::Error); + EXPECT_EQ(issues[0].primitive, lanelet::validation::Primitive::Polygon); + EXPECT_EQ( + issues[0].message, + "[Intersection.IntersectionAreaSegmentType-001] This intersection area is not made by points " + "from road_border linestrings or lanelet edges. (Point ID: (10804))"); +} + +TEST_F(TestIntersectionAreaSegmentType, CheckWrongLinestringType) // NOLINT for gtest +{ + load_target_map("intersection/intersection_area_with_wrong_linestring_type.osm"); + + lanelet::autoware::validation::IntersectionAreaSegmentTypeValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 1); + EXPECT_EQ(issues[0].id, 10803); + EXPECT_EQ(issues[0].severity, lanelet::validation::Severity::Error); + EXPECT_EQ(issues[0].primitive, lanelet::validation::Primitive::Polygon); + EXPECT_EQ( + issues[0].message, + "[Intersection.IntersectionAreaSegmentType-001] This intersection area is not made by points " + "from road_border linestrings or lanelet edges. (Point ID: (10756, 10757, 10758, 10759, 10760, " + "10761, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 10769, 10770, 10771, 10772, 10773, " + "10774, 10775, 10776))"); +} + +TEST_F(TestIntersectionAreaSegmentType, ValidIntersectionArea) // NOLINT for gtest +{ + load_target_map("intersection/basic_intersection_area.osm"); + + lanelet::autoware::validation::IntersectionAreaSegmentTypeValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 0); +} + +TEST_F(TestIntersectionAreaSegmentType, SampleMap) // NOLINT for gtest +{ + load_target_map("sample_map.osm"); + + lanelet::autoware::validation::IntersectionAreaSegmentTypeValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 0); +} diff --git a/map/autoware_lanelet2_map_validator/test/src/test_intersection_area_validity.cpp b/map/autoware_lanelet2_map_validator/test/src/test_intersection_area_validity.cpp new file mode 100644 index 00000000..faea5fd2 --- /dev/null +++ b/map/autoware_lanelet2_map_validator/test/src/test_intersection_area_validity.cpp @@ -0,0 +1,93 @@ +// Copyright 2024 Autoware Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "lanelet2_map_validator/validators/intersection/intersection_area_validity.hpp" +#include "map_validation_tester.hpp" + +#include +#include + +class TestIntersectionAreaValidity : public MapValidationTester +{ +private: +}; + +TEST_F(TestIntersectionAreaValidity, ValidatorAvailability) // NOLINT for gtest +{ + std::string expected_validator_name = + lanelet::autoware::validation::IntersectionAreaValidityValidator::name(); + + lanelet::validation::Strings validators = + lanelet::validation::availabeChecks(expected_validator_name); // cspell:disable-line + + const uint32_t expected_validator_num = 1; + EXPECT_EQ(expected_validator_num, validators.size()); + EXPECT_EQ(expected_validator_name, validators[0]); +} + +TEST_F(TestIntersectionAreaValidity, CheckWrongOrientation) // NOLINT for gtest +{ + load_target_map("intersection/intersection_area_with_wrong_orientation.osm"); + + lanelet::autoware::validation::IntersectionAreaValidityValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 1); + EXPECT_EQ(issues[0].id, 10803); + EXPECT_EQ(issues[0].severity, lanelet::validation::Severity::Error); + EXPECT_EQ(issues[0].primitive, lanelet::validation::Primitive::Polygon); + EXPECT_EQ( + issues[0].message, + "[Intersection.IntersectionAreaValidity-001] This intersection_area doesn't satisfy " + "boost::geometry::is_valid (reason: Geometry has wrong orientation)."); +} + +TEST_F(TestIntersectionAreaValidity, CheckSelfIntersection) // NOLINT for gtest +{ + load_target_map("intersection/intersection_area_with_self_intersection.osm"); + + lanelet::autoware::validation::IntersectionAreaValidityValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 1); + EXPECT_EQ(issues[0].id, 10803); + EXPECT_EQ(issues[0].severity, lanelet::validation::Severity::Error); + EXPECT_EQ(issues[0].primitive, lanelet::validation::Primitive::Polygon); + EXPECT_EQ( + issues[0].message, + "[Intersection.IntersectionAreaValidity-001] This intersection_area doesn't satisfy " + "boost::geometry::is_valid (reason: Geometry has invalid self-intersections. A " + "self-intersection point was found at (3757.52, 73751.8); method: i; operations: u/i; segment " + "IDs {source, multi, ring, segment}: {0, -1, -1, 21}/{0, -1, -1, 23})."); +} + +TEST_F(TestIntersectionAreaValidity, ValidIntersectionArea) // NOLINT for gtest +{ + load_target_map("intersection/basic_intersection_area.osm"); + + lanelet::autoware::validation::IntersectionAreaValidityValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 0); +} + +TEST_F(TestIntersectionAreaValidity, SampleMap) // NOLINT for gtest +{ + load_target_map("sample_map.osm"); + + lanelet::autoware::validation::IntersectionAreaValidityValidator checker; + const auto & issues = checker(*map_); + + EXPECT_EQ(issues.size(), 0); +} From c7b11faadaf8940419bcafd98f66dec344d93d31 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Tue, 10 Dec 2024 18:35:43 +0900 Subject: [PATCH 10/12] Fixed spelling error Signed-off-by: TaikiYamada4 --- .../docs/intersection/intersection_area_segment_type.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md b/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md index d9cb9d4a..980a2607 100644 --- a/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md +++ b/map/autoware_lanelet2_map_validator/docs/intersection/intersection_area_segment_type.md @@ -8,7 +8,7 @@ mapping.intersection.intersection_area_segment_type This validator check whether each `intersection_area` type polygon is made from points that belong to `road_border` type linestrings or the starting/ending edge of a lanelet. -This is acheived by the following procedure. +This is achieved by the following procedure. 1. Create a 2D bounding box that circumscribes the polygon. 2. Collect `road_border` type linestrings within or intersecting the 2D bounding box. From 8e50d770b392483f69525db2fa26ef46e2bfaa61 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Thu, 12 Dec 2024 11:47:16 +0900 Subject: [PATCH 11/12] Removed original bbox calculation and use the one in the Lanelet2 library Signed-off-by: TaikiYamada4 --- .../intersection_area_segment_type.hpp | 2 -- .../intersection_area_segment_type.cpp | 23 ++----------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp index defa9e4e..d0e06139 100644 --- a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp @@ -37,8 +37,6 @@ class IntersectionAreaSegmentTypeValidator : public lanelet::validation::MapVali lanelet::validation::Issues check_intersection_area_segment_type(const lanelet::LaneletMap & map); lanelet::LaneletSubmapUPtr create_nearby_borders_submap( const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area); - lanelet::BoundingBox2d get_circumscribed_box_from_polygon( - const lanelet::ConstPolygon3d & polygon); std::string ids_to_string(const lanelet::Ids ids); }; } // namespace lanelet::autoware::validation diff --git a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp index 961f73ae..60e0a179 100644 --- a/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp +++ b/map/autoware_lanelet2_map_validator/src/validators/intersection/intersection_area_segment_type.cpp @@ -80,7 +80,8 @@ IntersectionAreaSegmentTypeValidator::check_intersection_area_segment_type( lanelet::LaneletSubmapUPtr IntersectionAreaSegmentTypeValidator::create_nearby_borders_submap( const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area) { - lanelet::BoundingBox2d bbox2d = get_circumscribed_box_from_polygon(intersection_area); + lanelet::BoundingBox2d bbox2d = + lanelet::geometry::boundingBox2d(lanelet::traits::toBasicPolygon2d(intersection_area)); lanelet::ConstLanelets nearby_lanelets = map.laneletLayer.search(bbox2d); lanelet::ConstLineStrings3d nearby_linestrings = map.lineStringLayer.search(bbox2d); @@ -135,26 +136,6 @@ lanelet::LaneletSubmapUPtr IntersectionAreaSegmentTypeValidator::create_nearby_b return lanelet::utils::createSubmap(nearby_borders); } -lanelet::BoundingBox2d IntersectionAreaSegmentTypeValidator::get_circumscribed_box_from_polygon( - const lanelet::ConstPolygon3d & polygon) -{ - double minX = std::numeric_limits::max(); - double minY = std::numeric_limits::max(); - double maxX = std::numeric_limits::lowest(); - double maxY = std::numeric_limits::lowest(); - - for (const lanelet::ConstPoint3d & point : polygon) { - const lanelet::BasicPoint2d & coord = point.basicPoint2d(); - minX = std::min(minX, coord.x()); - minY = std::min(minY, coord.y()); - maxX = std::max(maxX, coord.x()); - maxY = std::max(maxY, coord.y()); - } - - return lanelet::BoundingBox2d( - lanelet::BasicPoint2d(minX, minY), lanelet::BasicPoint2d(maxX, maxY)); -} - std::string IntersectionAreaSegmentTypeValidator::ids_to_string(const lanelet::Ids ids) { std::string result = "("; From aa4c1dfefd5eb68e7d960c3cdf3db10e01cf81a4 Mon Sep 17 00:00:00 2001 From: TaikiYamada4 Date: Thu, 12 Dec 2024 11:53:34 +0900 Subject: [PATCH 12/12] Added explanation of functions Signed-off-by: TaikiYamada4 --- .../intersection_area_segment_type.hpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp index d0e06139..cd563d43 100644 --- a/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp +++ b/map/autoware_lanelet2_map_validator/src/include/lanelet2_map_validator/validators/intersection/intersection_area_segment_type.hpp @@ -34,9 +34,30 @@ class IntersectionAreaSegmentTypeValidator : public lanelet::validation::MapVali lanelet::validation::Issues operator()(const lanelet::LaneletMap & map) override; private: + /** + * @brief The main validation process + * + * @param map + * @return lanelet::validation::Issues + */ lanelet::validation::Issues check_intersection_area_segment_type(const lanelet::LaneletMap & map); + + /** + * @brief Create a submap consisting of road_border linestrings and lanelet edges only. + * + * @param map + * @param intersection_area + * @return lanelet::LaneletSubmapUPtr + */ lanelet::LaneletSubmapUPtr create_nearby_borders_submap( const lanelet::LaneletMap & map, const lanelet::ConstPolygon3d & intersection_area); + + /** + * @brief Create a list-up-string from Ids=vector + * + * @param ids + * @return std::string + */ std::string ids_to_string(const lanelet::Ids ids); }; } // namespace lanelet::autoware::validation