Skip to content

Commit

Permalink
fix(behavior_velocity_planner): lerp stop point z coordinate (tier4#1370
Browse files Browse the repository at this point in the history
)

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored and boyali committed Oct 3, 2022
1 parent b2f0032 commit d9d8692
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,13 @@ PathPointWithLaneId getBackwardPointFromBasePoint(
PathPointWithLaneId output;
const double dx = p_to.point.pose.position.x - p_from.point.pose.position.x;
const double dy = p_to.point.pose.position.y - p_from.point.pose.position.y;
const double norm = std::hypot(dx, dy);
const double dz = p_to.point.pose.position.z - p_from.point.pose.position.z;
const double norm = std::hypot(dx, dy, dz);

output = p_base;
output.point.pose.position.x += backward_length * dx / norm;
output.point.pose.position.y += backward_length * dy / norm;
output.point.pose.position.z += backward_length * dz / norm;

return output;
}
Expand Down

0 comments on commit d9d8692

Please sign in to comment.