-
Notifications
You must be signed in to change notification settings - Fork 646
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(lane_change): add new structs (TransientData) to store commonly used values #8849
Closed
zulfaqar-azmi-t4
wants to merge
18
commits into
autowarefoundation:main
from
zulfaqar-azmi-t4:lc-rename-min-lc-length-to-buffer
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b461626
renaming min_lane_change_buffer to current_lc_buffer
zulfaqar-azmi-t4 030a1ab
change argument for the general function
zulfaqar-azmi-t4 1cdfb95
rename function name
zulfaqar-azmi-t4 f910d0a
do it also for maximum
zulfaqar-azmi-t4 0781964
change parameter type for lc param
zulfaqar-azmi-t4 564edde
add transient data
zulfaqar-azmi-t4 4cf9c92
ego dist to terminal end
zulfaqar-azmi-t4 765d744
style(pre-commit): autofix
pre-commit-ci[bot] 3b6a295
refactor maximum buffer
zulfaqar-azmi-t4 00c9d47
ego to end of lane
zulfaqar-azmi-t4 26dd220
fix terminal path not generated
zulfaqar-azmi-t4 877459c
return boundary, common data ptr in isLCrequired and ablc fix
zulfaqar-azmi-t4 22e32bd
clang-tidy
zulfaqar-azmi-t4 d5b7eba
change to dist to terminal start
zulfaqar-azmi-t4 e2378a9
fix header file
zulfaqar-azmi-t4 2a1b2f4
fix some bug
zulfaqar-azmi-t4 78de706
fix abort computation
zulfaqar-azmi-t4 bb4f783
fix some computation issue
zulfaqar-azmi-t4 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
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -82,7 +82,7 @@ bool AvoidanceByLaneChange::specialRequiredCheck() const | |||||||||||||||||
|
||||||||||||||||||
const auto & nearest_object = data.target_objects.front(); | ||||||||||||||||||
const auto minimum_avoid_length = calcMinAvoidanceLength(nearest_object); | ||||||||||||||||||
const auto minimum_lane_change_length = calcMinimumLaneChangeLength(); | ||||||||||||||||||
const auto minimum_lane_change_length = calc_minimum_dist_buffer(); | ||||||||||||||||||
|
||||||||||||||||||
lane_change_debug_.execution_area = createExecutionArea( | ||||||||||||||||||
getCommonParam().vehicle_info, getEgoPose(), | ||||||||||||||||||
|
@@ -273,16 +273,12 @@ double AvoidanceByLaneChange::calcMinAvoidanceLength(const ObjectData & nearest_ | |||||||||||||||||
return avoidance_helper_->getMinAvoidanceDistance(shift_length); | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
double AvoidanceByLaneChange::calcMinimumLaneChangeLength() const | ||||||||||||||||||
double AvoidanceByLaneChange::calc_minimum_dist_buffer() const | ||||||||||||||||||
{ | ||||||||||||||||||
const auto current_lanes = get_current_lanes(); | ||||||||||||||||||
if (current_lanes.empty()) { | ||||||||||||||||||
RCLCPP_DEBUG(logger_, "no empty lanes"); | ||||||||||||||||||
return std::numeric_limits<double>::infinity(); | ||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
return utils::lane_change::calculation::calc_minimum_lane_change_length( | ||||||||||||||||||
getRouteHandler(), current_lanes.back(), *lane_change_parameters_, direction_); | ||||||||||||||||||
const auto lc_length_and_dist_buffer = | ||||||||||||||||||
utils::lane_change::calculation::calc_lc_length_and_dist_buffer( | ||||||||||||||||||
common_data_ptr_, get_current_lanes()); | ||||||||||||||||||
return std::get<1>(lc_length_and_dist_buffer).min; | ||||||||||||||||||
Comment on lines
+278
to
+281
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. (minor) I think you can do something like this which is a bit easier to read.
Suggested change
|
||||||||||||||||||
} | ||||||||||||||||||
|
||||||||||||||||||
double AvoidanceByLaneChange::calcLateralOffset() const | ||||||||||||||||||
|
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
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
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.
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.
If I understand the code correctly, the new return value in case
current_lanes
is empty is0
compared toinfinity()
previously. Is this okay ?calc_lc_length_and_dist_buffer()
returns{}
whenlanes
is empty.{}
uses the default constructor ofpair
which uses the default constructor ofBoundary
which setsmin = 0.0
.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.
@zulfaqar-azmi-t4 did you check this issue ?