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 test codes for existing validators #150

Conversation

TaikiYamada4
Copy link
Contributor

@TaikiYamada4 TaikiYamada4 commented Nov 13, 2024

Description

This PR revises the test system in lanelet2_map_validator such like

  • Split the test code for each validator
  • Added small maps to validate each issue detection.
  • Added medium size map to check validation works well with normal maps

I made the medium size map (sample_map.osm) by modifying lanelet2_map.osm from autoware_test_utils.
I modified that map so that the current requirements in the autoware_requirement_set.json will pass.

Related links

None

Tests performed

1. Test codes

I tested the test codes through

colcon test --event-handlers console_cohesion+ --packages-select autoware_lanelet2_map_validator

2. Test sample_map.osm

I tested that sample_map.osm passes vm-02-02, vm-04-01 and vm-05-01 through the following command.

ros2 run autoware_lanelet2_map_validator autoware_lanelet2_map_validator -p mgrs -m ./install/autoware_lanelet2_map_validator/share/autoware_lanelet2_map_validator/data/map/sample_map.osm -i ./src/autoware_tools/map/autoware_lanelet2_map_validator/autoware_requirement_set.json -o ./

The figure below is the console output I got.
Screenshot from 2024-11-15 11-41-50

Notes for reviewers

None

Interface changes

None

Effects on system behavior

Test algorithm changed.

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.

Added test codes using these maps.

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

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
…fers) to look into the loading errors

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
@TaikiYamada4 TaikiYamada4 force-pushed the feat/lanelet2_map_validator/add_test_environment branch from d9c96c1 to 6534914 Compare November 15, 2024 02:26
@TaikiYamada4 TaikiYamada4 marked this pull request as ready for review November 15, 2024 02:44
Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
@TaikiYamada4
Copy link
Contributor Author

@YamatoAndo
Thanks for your review! All three suggestions above are fixed in here 2b3cfe8

Signed-off-by: TaikiYamada4 <taiki.yamada@tier4.jp>
@TaikiYamada4
Copy link
Contributor Author

@YamatoAndo I've fixed the sample_map.osm crosswalk_polygon to detection_area so please check it out.

…idator/add_test_environment

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

class MapValidationTester : public ::testing::Test
{
protected:
Copy link
Contributor

@soblin soblin Nov 22, 2024

Choose a reason for hiding this comment

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

Suggested change
protected:
protected:
virtual void SetUp() {
map_ = lanelet::load(package_share_directory + "/data/map/" + file_name, *projector, &loading_errors_);

and delete load_target_map function if possible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't this difficult to pass the target map file to validate?
One test code will try to validate various maps.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please forget my comment. Possibly we can use TestWithParam in the future when the number of test suites grow.
https://github.com/google/googletest/blob/main/docs/advanced.md#how-to-write-value-parameterized-tests

@TaikiYamada4 TaikiYamada4 merged commit b8e4f83 into autowarefoundation:main Nov 22, 2024
22 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.

3 participants