Skip to content

Commit

Permalink
chore(occlusion_spot): change min distance to insert (#1563)
Browse files Browse the repository at this point in the history
* chore(occlusion_spot): change min distance to insert

Signed-off-by: tanaka3 <[email protected]>

* chore: add TODO

Signed-off-by: tanaka3 <[email protected]>
  • Loading branch information
taikitanaka3 authored and kosuke55 committed Aug 13, 2022
1 parent e24e12d commit 8703106
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,17 @@ int insertSafeVelocityToPath(
PathPointWithLaneId inserted_point;
inserted_point = inout_path->points.at(closest_idx);
size_t insert_idx = closest_idx;
// insert velocity to path if distance is not too close else insert new collision point
// if original path has narrow points it's better to set higher distance threshold
if (planning_utils::isAheadOf(in_pose, inout_path->points.at(closest_idx).point.pose)) {
++insert_idx;
if (insert_idx == static_cast<size_t>(inout_path->points.size())) return -1;
}
// return if index is after the last path point
inserted_point.point.pose = in_pose;
planning_utils::insertVelocity(*inout_path, inserted_point, safe_vel, insert_idx);
// insert velocity to path if distance is not too close else insert new collision point
// if original path has narrow points it's better to set higher distance threshold
// TODO(tanaka): use Spherical Linear Interpolation for inserting point
const double eps = 0.05;
planning_utils::insertVelocity(*inout_path, inserted_point, safe_vel, insert_idx, eps);
return 0;
}

Expand Down

0 comments on commit 8703106

Please sign in to comment.