Function hateb_local_planner::check_line_segments_intersection_2d

Function Documentation

inline bool hateb_local_planner::check_line_segments_intersection_2d(const Eigen::Ref<const Eigen::Vector2d> &line1_start, const Eigen::Ref<const Eigen::Vector2d> &line1_end, const Eigen::Ref<const Eigen::Vector2d> &line2_start, const Eigen::Ref<const Eigen::Vector2d> &line2_end, Eigen::Vector2d *intersection = NULL)

Helper function to check whether two line segments intersects.

Parameters:
  • line1_start – 2D point representing the start of the first line segment

  • line1_end – 2D point representing the end of the first line segment

  • line2_start – 2D point representing the start of the second line segment

  • line2_end – 2D point representing the end of the second line segment

  • intersection[out] [optional] Write intersection point to destination (the value is only written, if both lines intersect, e.g. if the function returns true)

Returns:

true if both line segments intersect