Skip to content

Commit

Permalink
fix(utils): improve monotonic bound generation logic (#4706)
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <[email protected]>
  • Loading branch information
satoshi-ota authored Aug 24, 2023
1 parent be626b7 commit 59c7eda
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions planning/behavior_path_planner/src/utils/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,8 +1795,22 @@ void makeBoundLongitudinallyMonotonic(
continue;
}

for (size_t j = intersect_idx.get() + 1; j < bound_with_pose.size(); j++) {
set_orientation(ret, j, getPose(path_points.at(i)).orientation);
if (i + 1 == path_points.size()) {
for (size_t j = intersect_idx.get(); j < bound_with_pose.size(); j++) {
if (j + 1 == bound_with_pose.size()) {
const auto yaw =
calcAzimuthAngle(bound_with_pose.at(j - 1).position, bound_with_pose.at(j).position);
set_orientation(ret, j, createQuaternionFromRPY(0.0, 0.0, yaw));
} else {
const auto yaw =
calcAzimuthAngle(bound_with_pose.at(j).position, bound_with_pose.at(j + 1).position);
set_orientation(ret, j, createQuaternionFromRPY(0.0, 0.0, yaw));
}
}
} else {
for (size_t j = intersect_idx.get() + 1; j < bound_with_pose.size(); j++) {
set_orientation(ret, j, getPose(path_points.at(i)).orientation);
}
}

constexpr size_t OVERLAP_CHECK_NUM = 3;
Expand Down

0 comments on commit 59c7eda

Please sign in to comment.