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): add validator to check traffic light facing #165

Conversation

TaikiYamada4
Copy link
Contributor

Description

The facing of the traffic lights are defined by its linestring direction.
This PR adds a validator mapping.traffic_light.correct_facing that checks whether the traffic light is facing correctly.

Besides, I also added a validator mapping.traffic_light.missing_referrers that checks the traffic_light type regulatory element is referred by lanelets because the traffic light facing validation requires them and it is also required in the Autoware vector map requirements.

In short, this PR adds the following implementation.

  • New validator mapping.traffic_light.missing_referrers that detects traffic_light type regulatory elements that are NOT referred by lanelets.
  • New validator mapping.traffic_light.correct_facing that detects wrong traffic light facing.
  • Test codes for both mapping.traffic_light.missing_referrers and mapping.traffic_light.correct_facing.
  • Documents for both mapping.traffic_light.missing_referrers and mapping.traffic_light.correct_facing.
  • Added two validators to autoware_requirement_set.json
  • Fixed the requirement-id of autoware_requirement_set.json. (The crosswalk and traffic light were on the opposite side)

Related links

None

Tests performed

  1. Confirmed that colcon test --packages-select autoware_lanelet2_map_validator --event-handlers console_cohesion+ passes.
  2. Confirmed that the following command shows no errors nor warnings.
ros2 run autoware_lanelet2_map_validator autoware_lanelet2_map_validator -p mgrs -m <PATH_TO_sample_map.osm> -i <PATH_TO_autoware_requirement_set.json> -o ./

Notes for reviewers

Please take a look at traffic_light_facing.md for further understandings to the algorithm of it.

Interface changes

None

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.

  • 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.

Copy link
Contributor

@soblin soblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


| Issue Code | Message | Severity | Primitive | Description | Approach |
| ------------------------------ | ----------------------------------------------------------------------------- | -------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| TrafficLight.CorrectFacing-001 | "Lanelets referring this traffic_light have several divergent starting lines" | Info | Linestring | A `traffic_light` subtype regulatory element may be referred by multiple lanelets. This warning appears when the starting line of those lanelets (which tends to be the same or similar) diverge too much. | This hardly happens, but maybe the referring lanelet is completely wrong or the traffic light cannot be seen from the starting edge of the referring lanelet. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

namely lanelets that diverges both "straight" and "left" direction in an intersection ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, like those kind of lanelets but doesn't share the same starting edge.
It is very unnatural to happen but have to be promised not to happen because it is required in the calculation.

TaikiYamada4 and others added 16 commits December 5, 2024 14:07
* Added issue code processing

Signed-off-by: TaikiYamada4 <[email protected]>

* Revised tests for json processing

Signed-off-by: TaikiYamada4 <[email protected]>

* Added issue codes for missing_regulatory_elements_for_crosswalks

Signed-off-by: TaikiYamada4 <[email protected]>

* Added issue codes for regulatory_element_details_for_crosswalks

Signed-off-by: TaikiYamada4 <[email protected]>

* Added issue codes for missing_regulatory_elements_for_stop_lines

Signed-off-by: TaikiYamada4 <[email protected]>

* Added issue codes for missing_regulatory_elements_for_traffic_lights

Signed-off-by: TaikiYamada4 <[email protected]>

* Added issue codes for regulatory_element_details_for_traffic_lights

Signed-off-by: TaikiYamada4 <[email protected]>

* Added issue codes to docs

Signed-off-by: TaikiYamada4 <[email protected]>

* Change issue_code_prefix to append_issue_code_prefix

Signed-off-by: TaikiYamada4 <[email protected]>

* Fixed merging mistake

Signed-off-by: TaikiYamada4 <[email protected]>

---------

Signed-off-by: TaikiYamada4 <[email protected]>
Added test for TrafficLight.CorrectFacing-001

Signed-off-by: TaikiYamada4 <[email protected]>
Signed-off-by: TaikiYamada4 <[email protected]>
Signed-off-by: TaikiYamada4 <[email protected]>
Signed-off-by: TaikiYamada4 <[email protected]>
…_referrers_for_traffic_lights.md

Co-authored-by: Mamoru Sobue <[email protected]>
Signed-off-by: TaikiYamada4 <[email protected]>
Signed-off-by: TaikiYamada4 <[email protected]>
@TaikiYamada4 TaikiYamada4 force-pushed the feat/lanelet2_map_validator/add_traffic_light_facing branch from c7e31c4 to ec023d6 Compare December 5, 2024 05:11
@TaikiYamada4 TaikiYamada4 merged commit 368e889 into autowarefoundation:main Dec 5, 2024
16 checks passed
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