This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
feat(lanelet2_extension): overwriteLaneletsCenterline supports "waypoints" #252
Merged
Merged
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
427143d
feat(lanelet2_extension): centerline is converted to waypoints
takayuki5168 e02bfba
fix lanelet2_extension_python
takayuki5168 125faec
update README
takayuki5168 a933c52
fix
takayuki5168 475bbaa
fix
takayuki5168 d045e04
early return
takayuki5168 6d19fd5
fix clang-tidy
takayuki5168 fc7063d
Update tmp/lanelet2_extension/lib/utilities.cpp
takayuki5168 7d2a538
style(pre-commit): autofix
pre-commit-ci[bot] 45a656c
fix
takayuki5168 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -501,12 +501,28 @@ lanelet::ConstLanelets getExpandedLanelets( | |
} | ||
|
||
void overwriteLaneletsCenterline( | ||
lanelet::LaneletMapPtr lanelet_map, const double resolution, const bool force_overwrite) | ||
lanelet::LaneletMapPtr lanelet_map, const double resolution, const bool use_waypoints, | ||
const bool force_overwrite) | ||
{ | ||
for (auto & lanelet_obj : lanelet_map->laneletLayer) { | ||
if (force_overwrite || !lanelet_obj.hasCustomCenterline()) { | ||
if (force_overwrite) { | ||
const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); | ||
lanelet_obj.setCenterline(fine_center_line); | ||
} else { | ||
if (use_waypoints) { | ||
if (lanelet_obj.hasCustomCenterline()) { | ||
const auto & centerline = lanelet_obj.centerline(); | ||
lanelet_obj.setAttribute("waypoints", centerline.id()); | ||
} | ||
|
||
const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); | ||
lanelet_obj.setCenterline(fine_center_line); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a bit concerned that the function start to exceed what it was originally designed for.
|
||
} else { | ||
if (!lanelet_obj.hasCustomCenterline()) { | ||
const auto fine_center_line = generateFineCenterline(lanelet_obj, resolution); | ||
lanelet_obj.setCenterline(fine_center_line); | ||
} | ||
} | ||
} | ||
takayuki5168 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a comment, since the third argument of the function has changed it's meaning, we should make sure that any other code that uses
force_overwrite
argument should be merged at the same time as this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takayuki5168 Have you checked if the codes in autoware.universe and autoware_tools are fine with the modification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the review.
Yes, I've already checked. The following PR is the change for the universe.
https://github.com/autowarefoundation/autoware.universe/pull/7480/files