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

fix(behavior_path_planner): change the condition of updateRTCStatus() in avoidance module #1361

Merged
merged 3 commits into from
Aug 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
change-condition-of-updateRTCStatus-in-avoidance_module
Signed-off-by: jack.song <jack.song@autocore.ai>
  • Loading branch information
shulanbushangshu committed Jul 15, 2022
commit eed467c9f901e14ba39eb22dd3ebbac1a2e92dac
Original file line number Diff line number Diff line change
Expand Up @@ -2096,9 +2096,21 @@ BehaviorModuleOutput AvoidanceModule::plan()
debug_data_.new_shift_points = *new_shift_points;
DEBUG_PRINT("new_shift_points size = %lu", new_shift_points->size());
printShiftPoints(*new_shift_points, "new_shift_points");
if (new_shift_points->back().getRelativeLength() > 0.0) {
int i = new_shift_points->size()-1;
for(;i>0;i--)
{
if(fabs(new_shift_points->at(i).getRelativeLength())<0.01)
{
continue;
}
else
{
break;
}
}
if (new_shift_points->at(i).getRelativeLength() > 0.0) {
removePreviousRTCStatusRight();
} else if (new_shift_points->back().getRelativeLength() < 0.0) {
} else if (new_shift_points->at(i).getRelativeLength() < 0.0) {
removePreviousRTCStatusLeft();
} else {
RCLCPP_WARN_STREAM(getLogger(), "Direction is UNKNOWN");
Expand Down Expand Up @@ -2165,7 +2177,19 @@ CandidateOutput AvoidanceModule::planCandidate() const

if (new_shift_points) { // clip from shift start index for visualize
clipByMinStartIdx(*new_shift_points, shifted_path.path);
output.lateral_shift = new_shift_points->back().getRelativeLength();
int i = new_shift_points->size()-1;
for(;i>0;i--)
{
if(fabs(new_shift_points->at(i).getRelativeLength())<0.01)
{
continue;
}
else
{
break;
}
}
output.lateral_shift = new_shift_points->at(i).getRelativeLength();
output.distance_to_path_change = new_shift_points->front().start_longitudinal;
}

Expand Down