diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index ae6c062f..d4d70f18 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,7 +1,7 @@
### Automatically generated from package.xml ###
autoware_dependency_checker/** yutaka.kondo@youtalk.jp
bag2lanelet/** shinnosuke.hirakawa@tier4.jp taiki.tanaka@tier4.jp
-common/autoware_debug_tools/** kosuke.takeuchi@tier4.jp satoshi.ota@tier4.jp yhisaki31@gmail.com
+common/autoware_debug_tools/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp satoshi.ota@tier4.jp shintaro.sakoda@tier4.jp yhisaki31@gmail.com
common/mission_planner_rviz_plugin/** isamu.takagi@tier4.jp
common/rtc_manager_rviz_plugin/** taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp
common/tier4_automatic_goal_rviz_plugin/** dawid.moszynski@robotec.ai kyoichi.sugahara@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp
diff --git a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py
index c865deff..68a4d151 100644
--- a/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py
+++ b/common/autoware_debug_tools/autoware_debug_tools/system_performance_plotter/processing_time_plotter.py
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
+from tier4_debug_msgs.msg import Float32Stamped
from tier4_debug_msgs.msg import Float64Stamped
from .system_performance_plotter_base import PREDEFINED_COMPONENT_NAMES
@@ -11,7 +12,7 @@ class ProcessingTimePlotter(SystemPerformancePlotterBase):
def check_topic(self, topic_name):
if self.grep_topic_name is not None and self.grep_topic_name not in topic_name:
return False
- if "/processing_time_ms" not in topic_name:
+ if "/processing_time_ms" not in topic_name and "/exe_time_ms" not in topic_name:
return False
if self.component_name == "all":
@@ -29,7 +30,7 @@ def check_topic(self, topic_name):
return True
def update_metrics_func(self, topic_name, data, date_time):
- if not isinstance(data, Float64Stamped):
+ if not isinstance(data, Float64Stamped) and not isinstance(data, Float32Stamped):
return
if topic_name not in self.stamp_and_metrics:
diff --git a/common/autoware_debug_tools/package.xml b/common/autoware_debug_tools/package.xml
index bacaaf72..0789d6d2 100644
--- a/common/autoware_debug_tools/package.xml
+++ b/common/autoware_debug_tools/package.xml
@@ -7,6 +7,8 @@
Yukinari Hisaki
Satoshi Ota
Kosuke Takeuchi
+ Shintaro Sakoda
+ Fumiya Watanabe
Apache License 2.0
diff --git a/map/autoware_lanelet2_map_validator/CMakeLists.txt b/map/autoware_lanelet2_map_validator/CMakeLists.txt
index 9326b83f..084bb9a8 100644
--- a/map/autoware_lanelet2_map_validator/CMakeLists.txt
+++ b/map/autoware_lanelet2_map_validator/CMakeLists.txt
@@ -58,8 +58,11 @@ if(BUILD_TESTING)
)
endfunction()
- add_validation_test(missing_regulatory_elements)
- add_validation_test(regulatory_element_details)
+ add_validation_test(missing_regulatory_elements_for_stop_lines)
+ add_validation_test(missing_regulatory_elements_for_crosswalks)
+ add_validation_test(missing_regulatory_elements_for_traffic_lights)
+ add_validation_test(regulatory_elements_details_for_crosswalks)
+ add_validation_test(regulatory_elements_details_for_traffic_lights)
endif()
ament_auto_package(
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 c96ec6d4..3f05ec7f 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
@@ -11,9 +11,9 @@ Required information for a crosswalk is written in the [Autoware documentation](
The output issue marks "lanelet" as the **primitive**, and the lanelet ID is written together as **ID**.
-| Message | Severity | Description | Approach |
-| ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
-| "No regulatory element refers to this crosswalk." | Error | There is a `crosswalk` subtype lanelet that hasn't been referred to any regulatory element. | Create a `crosswalk` subtype regulatory element and refer to the crosswalk lanelet. |
+| Issue Code | Message | Severity | Description | Approach |
+| --------------------------------------- | ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
+| Crosswalk.MissingRegulatoryElements-001 | "No regulatory element refers to this crosswalk." | Error | There is a `crosswalk` subtype lanelet that hasn't been referred to any regulatory element. | Create a `crosswalk` subtype regulatory element and refer to the crosswalk lanelet. |
## Related source codes
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 62d003e7..5476e051 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
@@ -12,16 +12,16 @@ 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. |
+| Issue Code | Message | Severity | Primitive | Description | Approach |
+| -------------------------------------- | ---------------------------------------------------------------------------------------- | -------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| Crosswalk.RegulatoryElementDetails-001 | "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 |
+| Crosswalk.RegulatoryElementDetails-002 | "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. |
+| Crosswalk.RegulatoryElementDetails-003 | "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. |
+| Crosswalk.RegulatoryElementDetails-004 | "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. |
+| Crosswalk.RegulatoryElementDetails-005 | "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 crosswalk. Remove the unnecessary ones. |
+| Crosswalk.RegulatoryElementDetails-006 | "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 |
+| Crosswalk.RegulatoryElementDetails-007 | "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.RegulatoryElementDetails-008 | "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. |
## 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 fb286208..dd8ad8e0 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
@@ -11,9 +11,9 @@ Required information for a stop line is written in the [Autoware documentation](
The output issue marks "linestring" as the **primitive**, and the linestring ID is written together as **ID**.
-| Message | Severity | Description | Approach |
-| ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
-| "No regulatory element refers to this stop line." | Error | There is a `stop_line` type linestring that hasn't been referred to any regulatory element. | Create a regulatory element that refers to this stop line. |
+| Issue Code | Message | Severity | Description | Approach |
+| -------------------------------------- | ------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
+| StopLine.MissingRegulatoryElements-001 | "No regulatory element refers to this stop line." | Error | There is a `stop_line` type linestring that hasn't been referred to any regulatory element. | Create a regulatory element that refers to this stop line. |
## Related source codes
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 4bcb311d..ae716886 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
@@ -11,9 +11,9 @@ Required information for traffic lights is written in the [Autoware documentatio
The output issue marks "linestring" as the **primitive**, and the linestring ID is written together as **ID**.
-| Message | Severity | Description | Approach |
-| ----------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
-| "No regulatory element refers to this traffic light." | Error | There is a `traffic_light` type linestring that hasn't been referred to any regulatory element. | Create a `traffic_light` subtype regulatory element that refers to this linestring |
+| Issue Code | Message | Severity | Description | Approach |
+| ------------------------------------------ | ----------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
+| TrafficLight.MissingRegulatoryElements-001 | "No regulatory element refers to this traffic light." | Error | There is a `traffic_light` type linestring that hasn't been referred to any regulatory element. | Create a `traffic_light` subtype regulatory element that refers to this linestring |
## Related source codes
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 29a585d4..ee851dcb 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
@@ -12,12 +12,11 @@ This validator checks four types of issues.
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. |
+| Issue Code | Message | Severity | Primitive | Description | Approach |
+| ----------------------------------------- | ----------------------------------------------------------------------------- | -------- | ------------------ | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
+| TrafficLight.RegulatoryElementDetails-001 | "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. |
+| TrafficLight.RegulatoryElementDetails-002 | "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. |
+| TrafficLight.RegulatoryElementDetails-003 | "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 |
## Related source codes
diff --git a/map/autoware_lanelet2_map_validator/src/common/map_loader.cpp b/map/autoware_lanelet2_map_validator/src/common/map_loader.cpp
new file mode 100644
index 00000000..418a1e51
--- /dev/null
+++ b/map/autoware_lanelet2_map_validator/src/common/map_loader.cpp
@@ -0,0 +1,82 @@
+// 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/map_loader.hpp"
+
+#include
+#include
+
+namespace lanelet::autoware::validation
+{
+
+namespace
+{
+namespace projector_names
+{
+constexpr const char * mgrs = "mgrs";
+constexpr const char * transverse_mercator = "transverse_mercator";
+constexpr const char * utm = "utm";
+} // namespace projector_names
+} // namespace
+
+std::unique_ptr getProjector(
+ const std::string & projector_type, const lanelet::GPSPoint & origin)
+
+{
+ if (projector_type == projector_names::mgrs) {
+ return std::make_unique();
+ }
+ if (projector_type == projector_names::transverse_mercator) {
+ return std::make_unique(
+ lanelet::Origin{origin});
+ }
+ if (projector_type == projector_names::utm) {
+ return std::make_unique(lanelet::Origin{origin});
+ }
+ return nullptr;
+}
+
+std::pair>
+loadAndValidateMap(
+ const std::string & projector_type, const std::string & map_file,
+ const lanelet::validation::ValidationConfig & val_config)
+{
+ std::vector issues;
+ lanelet::LaneletMapPtr map{nullptr};
+ lanelet::validation::Strings errors;
+ try {
+ const auto projector = getProjector(projector_type, val_config.origin);
+ if (!projector) {
+ errors.push_back("No valid map projection type specified!");
+ } else {
+ map = lanelet::load(map_file, *projector, &errors);
+ }
+ if (!map) {
+ errors.push_back("Failed to load map!");
+ }
+ issues.emplace_back("general", utils::transform(errors, [](auto & error) {
+ return lanelet::validation::Issue(
+ lanelet::validation::Severity::Error, error);
+ }));
+ } catch (lanelet::LaneletError & err) {
+ issues.emplace_back("general", utils::transform(errors, [](auto & error) {
+ return lanelet::validation::Issue(
+ lanelet::validation::Severity::Error, error);
+ }));
+ }
+
+ return {map, issues};
+}
+
+} // namespace lanelet::autoware::validation
diff --git a/map/autoware_lanelet2_map_validator/src/common/utils.cpp b/map/autoware_lanelet2_map_validator/src/common/utils.cpp
new file mode 100644
index 00000000..29899017
--- /dev/null
+++ b/map/autoware_lanelet2_map_validator/src/common/utils.cpp
@@ -0,0 +1,60 @@
+// 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/utils.hpp"
+
+#include
+std::string snake_to_upper_camel(const std::string & snake_case)
+{
+ std::string camel_case;
+ bool capitalize_next = true;
+
+ for (char ch : snake_case) {
+ if (ch == '_') {
+ capitalize_next = true;
+ } else if (ch == '.') {
+ camel_case += ch;
+ capitalize_next = true;
+ } else {
+ camel_case += capitalize_next ? std::toupper(ch) : ch;
+ capitalize_next = false;
+ }
+ }
+ return camel_case;
+}
+
+std::string issue_code(const std::string & name, const int number)
+{
+ if (number < 0 || number > 999) {
+ throw std::out_of_range("Number for issue code must be between 0 and 999 inclusive.");
+ }
+
+ // Set three digits number string
+ std::string id_num = std::to_string(number);
+ while (id_num.length() < 3) {
+ id_num = "0" + id_num;
+ }
+
+ // Remove the first word from name
+ size_t pos = name.find('.');
+ std::string name_without_prefix = name.substr(pos + 1);
+
+ return snake_to_upper_camel(name_without_prefix) + '-' + id_num;
+}
+
+std::string append_issue_code_prefix(
+ const std::string & name, const int number, const std::string & message)
+{
+ return "[" + issue_code(name, number) + "] " + message;
+}
diff --git a/map/autoware_lanelet2_map_validator/src/common/validation.cpp b/map/autoware_lanelet2_map_validator/src/common/validation.cpp
index b3e33b8f..71d7f4fc 100644
--- a/map/autoware_lanelet2_map_validator/src/common/validation.cpp
+++ b/map/autoware_lanelet2_map_validator/src/common/validation.cpp
@@ -14,8 +14,6 @@
#include "lanelet2_map_validator/validation.hpp"
-#include
-#include
#include
#include
@@ -23,6 +21,7 @@
#include
#include