Skip to content

Commit

Permalink
fix(obstacle_avoidance_planner): deal with wider path interval (#1616)
Browse files Browse the repository at this point in the history
* fix(obstacle_avoidance_planner): deal with wider path interval

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 committed Mar 28, 2023
1 parent ff81998 commit 508c6af
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion planning/obstacle_avoidance_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,13 @@ ObstacleAvoidancePlanner::alignVelocity(
auto fine_traj_points_with_vel = fine_traj_points_with_path_zero_vel;
size_t prev_begin_idx = 0;
for (size_t i = 0; i < fine_traj_points_with_vel.size(); ++i) {
const auto truncated_points = points_utils::clipForwardPoints(path_points, prev_begin_idx, 5.0);
auto truncated_points = points_utils::clipForwardPoints(path_points, prev_begin_idx, 5.0);
if (truncated_points.size() < 2) {
// NOTE: At least, two points must be contained in truncated_points
truncated_points = std::vector<autoware_auto_planning_msgs::msg::PathPoint>(
path_points.begin() + prev_begin_idx,
path_points.begin() + std::min(path_points.size(), prev_begin_idx + 2));
}

const auto & target_pose = fine_traj_points_with_vel[i].pose;
const auto closest_seg_idx_optional = motion_utils::findNearestSegmentIndex(
Expand Down

0 comments on commit 508c6af

Please sign in to comment.