This PR introduces the concept of prerequisites to autoware_lanelet2_map_validator.
Since autoware_lanelet2_map_validator is a collection of small validators, some redundancy is expected. For example, one validator might need to check for unrelated map flaws to ensure safe execution, and this checking procedure might overlap with that of another validator. Therefore map requirements should have validation orders such like "Validation B should be done only when validation A has passed". The prerequisites attribute will allow the JSON input to control the validation order.
Since the validation process have been a bit complex due to this change, I moved the process_requirements() function to validation.cpp from main.cpp not to make main.cpp long too much.
Test codes are also added regarding the JSON processing in this validator.
Related links
None
Tests performed
1. General execution
I tried the following command and I get the results shown in the screenshot. You can see that mapping.crosswalk.regulatory_element_details fails because mapping.crosswalk.missing_regulatory_elements has failed before. (Before applying this PR, mapping.crosswalk.regulatory_element_details could oass the validation`)
You can see the test for json processing is added by the following command.
colcon test --packages-select autoware_lanelet2_map_validator --event-handlers console_cohesion+
You might get something like this
1: Running main() from /opt/ros/humble/src/gtest_vendor/src/gtest_main.cc
1: [==========] Running 7 tests from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 7 tests from JsonProcessingTest
1: [ RUN ] JsonProcessingTest.ParseValidatorsWithValidInput
1: [ OK ] JsonProcessingTest.ParseValidatorsWithValidInput (1 ms)
1: [ RUN ] JsonProcessingTest.CreateValidationQueueNoCycles
1: [ OK ] JsonProcessingTest.CreateValidationQueueNoCycles (0 ms)
1: [ RUN ] JsonProcessingTest.CreateValidationQueueWithCycles
1: [ OK ] JsonProcessingTest.CreateValidationQueueWithCycles (0 ms)
1: [ RUN ] JsonProcessingTest.CheckPrerequisiteCompletionSuccess
1: [ OK ] JsonProcessingTest.CheckPrerequisiteCompletionSuccess (0 ms)
1: [ RUN ] JsonProcessingTest.CheckPrerequisiteCompletionFailure
1: [ OK ] JsonProcessingTest.CheckPrerequisiteCompletionFailure (0 ms)
1: [ RUN ] JsonProcessingTest.DescriptUnusedValidatorsToJson
1: [ OK ] JsonProcessingTest.DescriptUnusedValidatorsToJson (2 ms)
1: [ RUN ] JsonProcessingTest.SummarizeValidatorResults
1: [ OK ] JsonProcessingTest.SummarizeValidatorResults (1 ms)
1: [----------] 7 tests from JsonProcessingTest (4 ms total)
1:
1: [----------] Global test environment tear-down
1: [==========] 7 tests from 1 test suite ran. (4 ms total)
1: [ PASSED ] 7 tests.
Notes for reviewers
You can test scenarios like "making a loop of prerequisites" or "self referring" which should be detected.
Technically speaking, mapping.crosswalk.regulatory_element_details doesn't have to have mapping.crosswalk.missing_regulatory_elements as a prerequisite, but I set autoware_requirement_set.json as it is now to demonstrate how prerequisites attribute works. After a validator that definitely needs a prerequisite appears, I may remove the prerequisites attribute from mapping.crosswalk.missing_regulatory_elements and mapping.traffic_light.missing_regulatory_elements
Interface changes
Effects on system behavior
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
Description
This PR introduces the concept of prerequisites to autoware_lanelet2_map_validator.
Since autoware_lanelet2_map_validator is a collection of small validators, some redundancy is expected. For example, one validator might need to check for unrelated map flaws to ensure safe execution, and this checking procedure might overlap with that of another validator. Therefore map requirements should have validation orders such like "Validation B should be done only when validation A has passed". The
prerequisites
attribute will allow the JSON input to control the validation order.Since the validation process have been a bit complex due to this change, I moved the
process_requirements()
function tovalidation.cpp
frommain.cpp
not to makemain.cpp
long too much.Test codes are also added regarding the JSON processing in this validator.
Related links
None
Tests performed
1. General execution
I tried the following command and I get the results shown in the screenshot. You can see that
mapping.crosswalk.regulatory_element_details
fails becausemapping.crosswalk.missing_regulatory_elements
has failed before. (Before applying this PR,mapping.crosswalk.regulatory_element_details
could oass the validation`)2. colcon test
You can see the test for json processing is added by the following command.
You might get something like this
Notes for reviewers
mapping.crosswalk.regulatory_element_details
doesn't have to havemapping.crosswalk.missing_regulatory_elements
as a prerequisite, but I setautoware_requirement_set.json
as it is now to demonstrate howprerequisites
attribute works. After a validator that definitely needs a prerequisite appears, I may remove theprerequisites
attribute frommapping.crosswalk.missing_regulatory_elements
andmapping.traffic_light.missing_regulatory_elements
Interface changes
Effects on system behavior
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.