Commit d4d0804 1 parent dc5d76a commit d4d0804 Copy full SHA for d4d0804
File tree 1 file changed +6
-3
lines changed
planning/behavior_path_planner/src/scene_module/avoidance
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -2025,13 +2025,16 @@ PathWithLaneId AvoidanceModule::extendBackwardLength(const PathWithLaneId & orig
2025
2025
planner_data_->parameters .backward_path_length , longest_dist_to_shift_point + extra_margin);
2026
2026
2027
2027
const size_t orig_ego_idx = planner_data_->findEgoIndex (original_path.points );
2028
- const size_t prev_ego_idx = motion_utils::findFirstNearestSegmentIndexWithSoftConstraints (
2028
+ const auto prev_ego_idx = motion_utils::findNearestSegmentIndex (
2029
2029
previous_path.points , getPose (original_path.points .at (orig_ego_idx)),
2030
2030
std::numeric_limits<double >::max (), planner_data_->parameters .ego_nearest_yaw_threshold );
2031
+ if (!prev_ego_idx) {
2032
+ return original_path;
2033
+ }
2031
2034
2032
2035
size_t clip_idx = 0 ;
2033
2036
for (size_t i = 0 ; i < prev_ego_idx; ++i) {
2034
- if (backward_length > calcSignedArcLength (previous_path.points , clip_idx, prev_ego_idx)) {
2037
+ if (backward_length > calcSignedArcLength (previous_path.points , clip_idx, * prev_ego_idx)) {
2035
2038
break ;
2036
2039
}
2037
2040
clip_idx = i;
@@ -2041,7 +2044,7 @@ PathWithLaneId AvoidanceModule::extendBackwardLength(const PathWithLaneId & orig
2041
2044
{
2042
2045
extended_path.points .insert (
2043
2046
extended_path.points .end (), previous_path.points .begin () + clip_idx,
2044
- previous_path.points .begin () + prev_ego_idx);
2047
+ previous_path.points .begin () + * prev_ego_idx);
2045
2048
}
2046
2049
2047
2050
// overwrite backward path velocity by latest one.
You can’t perform that action at this time.
0 commit comments