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

refactor(lalenet2_map_validator): divide map loading process #153

Merged
merged 4 commits into from
Nov 20, 2024

Conversation

soblin
Copy link
Contributor

@soblin soblin commented Nov 18, 2024

Description

Current implementation tries to load the lanelet_map for each validation process which is inefficient and contaminates the report. With this PR, the map is loaded at first and then passed to each validation process.

Related links

Tests performed

unit test passes

Notes for reviewers

Interface changes

None

Effects on system behavior

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.

@soblin soblin force-pushed the feat/add-map-load-validator branch from b58aa63 to 5988d6b Compare November 19, 2024 01:33
@soblin soblin marked this pull request as ready for review November 19, 2024 01:37
Copy link
Contributor

@TaikiYamada4 TaikiYamada4 left a comment

Choose a reason for hiding this comment

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

I have three review points and two of them are critical when processing the prerequisites.

{

std::pair<lanelet::LaneletMapPtr, std::vector<lanelet::validation::DetectedIssues>>
loadAndValidateMapLoad(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to have two loads in the function name here?

replace_validator(
validator_config.command_line_config.validationConfig, validator_name)));
}
const auto prerequisite_issues = check_prerequisite_completion(validators, validator_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add prerequisite_issues to total_issues?
I also want to display and write whether the prerequisites are met or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added them to total_issues in 5d8f6d3

const auto prerequisite_issues = check_prerequisite_completion(validators, validator_name);

const auto issues =
prerequisite_issues.empty()
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the condition is the opposite.
All validations that have correct prerequisites will not start and only PASSED results appear.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed and added comment on it 5d8f6d3

replace_validator(
validator_config.command_line_config.validationConfig, validator_name)));
}
const auto prerequisite_issues = check_prerequisite_completion(validators, validator_name);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added them to total_issues in 5d8f6d3

const auto prerequisite_issues = check_prerequisite_completion(validators, validator_name);

const auto issues =
prerequisite_issues.empty()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed and added comment on it 5d8f6d3

{
to.insert(to.end(), std::make_move_iterator(from.begin()), std::make_move_iterator(from.end()));
if constexpr (std::is_rvalue_reference<decltype(from)>::value) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed appendIssue to take universal reference of from to optimize the copy.

The trailing return type denotes the type constraint (concept) that T and std::vector<T>::value_type matches

Copy link
Contributor

@TaikiYamada4 TaikiYamada4 left a comment

Choose a reason for hiding this comment

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

I confirmed that colcon test passed, invalid arguments are detected correctly, and normal map validation against sample map works correctly. 👍
(Though I prefer loadAndValidateMap rather than validateMapLoad but it's your choice)

@TaikiYamada4
Copy link
Contributor

@soblin
And please resolve the conflicts around namespaces.

Signed-off-by: Mamoru Sobue <[email protected]>
Signed-off-by: Mamoru Sobue <[email protected]>
Signed-off-by: Mamoru Sobue <[email protected]>
@soblin soblin force-pushed the feat/add-map-load-validator branch from ed4841e to b74497a Compare November 20, 2024 08:09
@soblin soblin enabled auto-merge (squash) November 20, 2024 08:10
@soblin soblin merged commit 4fcb2d7 into main Nov 20, 2024
17 checks passed
@soblin soblin deleted the feat/add-map-load-validator branch November 20, 2024 08:21
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