Skip to content

Commit

Permalink
fix(avoidance): fix avoidance path chattering (autowarefoundation#2012)
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota committed Oct 4, 2022
1 parent 46008c3 commit 0997af7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,11 @@ AvoidancePlanningData AvoidanceModule::calcAvoidancePlanningData(DebugData & deb
// if the resampled path has only 1 point, use original path.
data.reference_path = center_path;
}

const size_t nearest_segment_index =
findNearestSegmentIndex(data.reference_path.points, data.reference_pose.position);
data.ego_closest_path_index =
findNearestIndex(data.reference_path.points, data.reference_pose.position);
std::min(nearest_segment_index + 1, data.reference_path.points.size() - 1);

// arclength from ego pose (used in many functions)
data.arclength_from_ego = util::calcPathArcLengthArray(
Expand Down

0 comments on commit 0997af7

Please sign in to comment.