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): generation script for new validators #180

Conversation

TaikiYamada4
Copy link
Contributor

@TaikiYamada4 TaikiYamada4 commented Dec 19, 2024

Description

This PR adds a tool to autoware_lanelet2_map_validator that can generate necessary files to create a new validator which will be useful to contributors.

This PR does the following.

  • Create a template directory and add templates for documents and test codes.
  • Move validator_template.cpp and validator_template.hpp to template
  • Create a python script create_new_validator.py that can generate necessary files for a new validator.
  • Added information about how to use create_new_validator.py to how_to_contribute.md.

How was this PR tested?

Tested the following command at the autoware_tools/map/autoware_lanelet2_map_validator directory, and checked four files are generated correctly.

./template/create_new_validator.py --base_directory ./ \
--category_name intersection \
--code_name turn_direction_checking \
--class_name TurnDirectionValidator \
--validator_name mapping.intersection.turn_direction_tagging \
--check_function_name check_turn_direction

Then the output should be like

Create ./src/validators/intersection/turn_direction_checking.cpp
Create ./src/include/lanelet2_map_validator/validators/intersection/turn_direction_checking.hpp
Create ./test/src/intersection/test_turn_direction_checking.cpp
Create ./docs/intersection/turn_direction_checking.md
Process complete.

Notes for reviewers

None.

Effects on system behavior

None.

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>
Copy link

github-actions bot commented Dec 19, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

TaikiYamada4 and others added 5 commits December 20, 2024 11:47
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 marked this pull request as ready for review December 26, 2024 06:06
@TaikiYamada4 TaikiYamada4 changed the title feat(lanelet2_map_validator): generate a new validator automatically feat(lanelet2_map_validator): generation script for new validators Dec 26, 2024
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

ros2 run lanelet2_map_validator create_new.py <args> is also good

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

codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.40%. Comparing base (ad0b811) to head (0768432).
Report is 101 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##            main     #180       +/-   ##
==========================================
+ Coverage   2.12%   38.40%   +36.27%     
==========================================
  Files        163       27      -136     
  Lines       9402      638     -8764     
  Branches     383      379        -4     
==========================================
+ Hits         200      245       +45     
+ Misses      9045      178     -8867     
- Partials     157      215       +58     
Flag Coverage Δ
differential 38.40% <ø> (?)
total ?

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TaikiYamada4 TaikiYamada4 merged commit 5e7d3cd into autowarefoundation:main Dec 26, 2024
34 of 35 checks passed
@TaikiYamada4 TaikiYamada4 deleted the tool/lanelet2_map_validator/my_template branch December 26, 2024 06:49
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