Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat(lanelet2_map_validator): added issue codes #163

Conversation

TaikiYamada4
Copy link
Contributor

@TaikiYamada4 TaikiYamada4 commented Nov 25, 2024

Description

This PR adds issue codes to the validator so that systems receiving the JSON output can process the issues much mechanically.

The issue codes are automatically generated by taking the upper snake case of the validator's name and remove the first Mapping. part.

I also added the issue codes to the documents.

Related links

None

Tests performed

Updated the test codes to check that the autoware_lanelet2_map_validator outputs the correct issue codes, and confirmed that colcon test passes.

Normal validation like

ros2 run autoware_lanelet2_map_validator autoware_lanelet2_map_validator -p mgrs -m ./src/universe/autoware.universe/common/autoware_test_utils/test_map/lanelet2_map.osm -i ./src/autoware_tools/map/autoware_lanelet2_map_validator/autoware_requirement_set.json -o ./

will return lanelet2_validation_results.json like this.

{
    "requirements": [
        {
            "id": "vm-02-02",
            "passed": true,
            "validators": [
                {
                    "name": "mapping.stop_line.missing_regulatory_elements",
                    "passed": true
                }
            ]
        },
        {
            "id": "vm-04-01",
            "passed": false,
            "validators": [
                {
                    "issues": [
                        {
                            "id": 163,
                            "issue_code": "Crosswalk.MissingRegulatoryElements-001",
                            "message": "No regulatory element refers to this crosswalk.",
                            "primitive": "lanelet",
                            "severity": "Error"
                        },
                        {
                            "id": 164,
                            "issue_code": "Crosswalk.MissingRegulatoryElements-001",
                            "message": "No regulatory element refers to this crosswalk.",
                            "primitive": "lanelet",
                            "severity": "Error"
                        },
                        {
                            "id": 165,
                            "issue_code": "Crosswalk.MissingRegulatoryElements-001",
                            "message": "No regulatory element refers to this crosswalk.",
                            "primitive": "lanelet",
                            "severity": "Error"
                        },
                        {
                            "id": 166,
                            "issue_code": "Crosswalk.MissingRegulatoryElements-001",
                            "message": "No regulatory element refers to this crosswalk.",
                            "primitive": "lanelet",
                            "severity": "Error"
                        }
                    ],
                    "name": "mapping.crosswalk.missing_regulatory_elements",
                    "passed": false
                },
                {
                    "name": "mapping.crosswalk.regulatory_element_details",
                    "passed": true,
                    "prerequisites": [
                        {
                            "name": "mapping.crosswalk.missing_regulatory_elements"
                        }
                    ]
                }
            ]
        },
        {
            "id": "vm-05-01",
            "passed": false,
            "validators": [
                {
                    "name": "mapping.traffic_light.missing_regulatory_elements",
                    "passed": true
                },
                {
                    "issues": [
                        {
                            "id": 9896,
                            "issue_code": "TrafficLight.RegulatoryElementDetails-001",
                            "message": "Regulatory element of traffic light must have a stop line(ref_line).",
                            "primitive": "regulatory element",
                            "severity": "Error"
                        },
                        {
                            "id": 9918,
                            "issue_code": "TrafficLight.RegulatoryElementDetails-001",
                            "message": "Regulatory element of traffic light must have a stop line(ref_line).",
                            "primitive": "regulatory element",
                            "severity": "Error"
                        },
                        {
                            "id": 9838,
                            "issue_code": "TrafficLight.RegulatoryElementDetails-001",
                            "message": "Regulatory element of traffic light must have a stop line(ref_line).",
                            "primitive": "regulatory element",
                            "severity": "Error"
                        },
                        {
                            "id": 9874,
                            "issue_code": "TrafficLight.RegulatoryElementDetails-001",
                            "message": "Regulatory element of traffic light must have a stop line(ref_line).",
                            "primitive": "regulatory element",
                            "severity": "Error"
                        }
                    ],
                    "name": "mapping.traffic_light.regulatory_element_details",
                    "passed": false,
                    "prerequisites": [
                        {
                            "name": "mapping.traffic_light.missing_regulatory_elements"
                        }
                    ]
                }
            ]
        }
    ]
}

Notes for reviewers

Order of the issues is changed in some test codes and documents so that they match with its number, but I believe the content isn't changed.

Interface changes

The output JSON also contains the issue_code.

Effects on system behavior

Except the output shows issue codes, none.

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
@TaikiYamada4 TaikiYamada4 merged commit 8647f18 into autowarefoundation:main Nov 26, 2024
16 checks passed
TaikiYamada4 added a commit to TaikiYamada4/autoware_tools that referenced this pull request Dec 5, 2024
* Added issue code processing

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Revised tests for json processing

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for missing_regulatory_elements_for_crosswalks

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for regulatory_element_details_for_crosswalks

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for missing_regulatory_elements_for_stop_lines

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for missing_regulatory_elements_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for regulatory_element_details_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes to docs

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Change issue_code_prefix to append_issue_code_prefix

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Fixed merging mistake

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

---------

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
TaikiYamada4 added a commit that referenced this pull request Dec 5, 2024
…cing (#165)

* Added valdiator missing_referrers_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added validator traffic_light_facing

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added traffic_light_facing and missing_referrers_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added new validators to README.md

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added test codes for traffic_light_facing and missing_referrers_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* feat(lanelet2_map_validator): added issue codes  (#163)

* Added issue code processing

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Revised tests for json processing

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for missing_regulatory_elements_for_crosswalks

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for regulatory_element_details_for_crosswalks

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for missing_regulatory_elements_for_stop_lines

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for missing_regulatory_elements_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes for regulatory_element_details_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Added issue codes to docs

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Change issue_code_prefix to append_issue_code_prefix

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Fixed merging mistake

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

---------

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Changed to append_issue_code_prefix.
Added test for TrafficLight.CorrectFacing-001

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Rearrange code structure

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Fixed spelling mistakes

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Fixed traffic_light_facing_procedure.svg

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Fixed mistakes in document

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Refine algorithm in traffic_light_facing.cpp

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Shorten the data collection process, and updated the procedure svg

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Use findUsages in missing_referrers_for_traffic_lights

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Update map/autoware_lanelet2_map_validator/docs/traffic_light/missing_referrers_for_traffic_lights.md

Co-authored-by: Mamoru Sobue <hilo.soblin@gmail.com>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* style(pre-commit): autofix

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

* Quit stocking all lanelets to collect traffic light regulatory elements

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>

---------

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Co-authored-by: Mamoru Sobue <hilo.soblin@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants