Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 committed Aug 18, 2022
1 parent 3baed53 commit 3eee1ab
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions planning/obstacle_avoidance_planner/src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1484,12 +1484,11 @@ ObstacleAvoidancePlanner::alignVelocity(
size_t prev_begin_idx = 0;
for (size_t i = 0; i < fine_traj_points_with_vel.size(); ++i) {
auto truncated_points = points_utils::clipForwardPoints(path_points, prev_begin_idx, 5.0);
if (truncated_points.empty()) {
truncated_points = std::vector<autoware_auto_planning_msgs::msg::PathPoint>(
path_points.begin() + prev_begin_idx, path_points.end());
}
if (truncated_points.size() < 2) {
truncated_points = path_points;
// 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;
Expand Down

0 comments on commit 3eee1ab

Please sign in to comment.