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

Adds a adjacency checker for the builder. #45

Merged
merged 5 commits into from Dec 23, 2022

Conversation

francocipollone
Copy link
Contributor

🎉 New feature

Related to #30

Summary

  • Creates a parser::Validator for verifying the parsed information before calling the builder.
  • Adds a validation for the adjacency of the lanes in a segment.
  • Adds a method for analyzing the distance between LineStrings3d.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if it affects the public API)

Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com>
@francocipollone
Copy link
Contributor Author

Hey @agalbachicar I know it is a large PR 🦖 . :there are several things to pay attention:

  • Validator class: I tried to make it scalable instead of just focusing on the adjacency checker. Erros are registered and then the user can decide what to do with those errors.
  • Adjacency checker: The many cases are being tested in the test files. It isn't just the geometry what matters but also how the lanes are ordered and the semantic information they provide for later on creating the graph.
  • Distance between linestrings: Used a simple heuristic to define that, I left a comment for using a better algorithm, ptal.

Copy link
Contributor

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

I left some comments. The checks seem reasonable to me.

include/maliput_sparse/parser/validator.h Outdated Show resolved Hide resolved
include/maliput_sparse/parser/validator.h Outdated Show resolved Hide resolved
include/maliput_sparse/parser/validator.h Show resolved Hide resolved
include/maliput_sparse/parser/validator.h Outdated Show resolved Hide resolved
src/parser/validator.cc Outdated Show resolved Hide resolved
src/parser/validator.cc Outdated Show resolved Hide resolved
src/geometry/utility/geometry.cc Outdated Show resolved Hide resolved
src/geometry/utility/geometry.cc Outdated Show resolved Hide resolved
src/loader/road_geometry_loader.cc Outdated Show resolved Hide resolved
include/maliput_sparse/parser/validator.h Outdated Show resolved Hide resolved
Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com>
agalbachicar
agalbachicar previously approved these changes Dec 20, 2022
Copy link
Contributor

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

It's looking better! PTAL to my final comments.

include/maliput_sparse/parser/validator.h Outdated Show resolved Hide resolved
src/parser/validator.cc Outdated Show resolved Hide resolved
src/parser/validator.cc Outdated Show resolved Hide resolved
Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com>
Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com>
agalbachicar
agalbachicar previously approved these changes Dec 23, 2022
Copy link
Contributor

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

LGTM

/// @param validate_geometric_adjacency Whether to validate geometric adjacency.
/// @param config The maliput_sparse::parser::ValidatorConfig to use.
/// @returns A vector of maliput_sparse::parser::Validator::Error.
std::vector<Validator::Error> ValidateLaneAdjacency(const Parser* parser, const bool& validate_geometric_adjacency,
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: const bool& -> bool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

src/parser/validation_methods.h Outdated Show resolved Hide resolved
src/parser/validator.cc Outdated Show resolved Hide resolved
Signed-off-by: Franco Cipollone <franco.c@ekumenlabs.com>
Copy link
Contributor

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

LGTM

@francocipollone francocipollone merged commit e43343b into main Dec 23, 2022
@francocipollone francocipollone deleted the francocipollone/adjacency_checker branch December 23, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants