Skip to content

Commit

Permalink
fix(control_validator): fix the sign of distance (autowarefoundation#…
Browse files Browse the repository at this point in the history
…4793)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 authored and kminoda committed Aug 30, 2023
1 parent dce64ca commit 4f2b446
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions control/control_validator/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ double calcMaxLateralDistance(
// find nearest segment
const size_t nearest_segment_idx =
motion_utils::findNearestSegmentIndex(reference_trajectory.points, p0);
double temp_dist =
motion_utils::calcLateralOffset(reference_trajectory.points, p0, nearest_segment_idx);
const double temp_dist = std::abs(
motion_utils::calcLateralOffset(reference_trajectory.points, p0, nearest_segment_idx));
if (temp_dist > max_dist) {
max_dist = temp_dist;
}
Expand Down

0 comments on commit 4f2b446

Please sign in to comment.