15 #ifndef GEOMETRY__POLYGON__LINE_SEGMENT_
16 #define GEOMETRY__POLYGON__LINE_SEGMENT_
19 #include <geometry_msgs/msg/point.hpp>
20 #include <geometry_msgs/msg/pose.hpp>
21 #include <geometry_msgs/msg/quaternion.hpp>
22 #include <geometry_msgs/msg/vector3.hpp>
34 const geometry_msgs::msg::Vector3
vector;
42 const geometry_msgs::msg::Point &
start_point,
const geometry_msgs::msg::Vector3 & vec,
45 auto isIntersect2D(
const geometry_msgs::msg::Point & point)
const -> bool;
47 auto isInBounds2D(
const geometry_msgs::msg::Point & point)
const -> bool;
49 auto getPoint(
const double s,
const bool denormalize_s =
false) const
50 -> geometry_msgs::msg::Point;
51 auto
getPose(const
double s, const
bool denormalize_s = false, const
bool fill_pitch = true) const
52 -> geometry_msgs::msg::Pose;
54 const geometry_msgs::msg::Point & point, const
bool denormalize_s = false) const
55 ->
std::optional<
double>;
57 ->
std::optional<
double>;
59 ->
std::optional<geometry_msgs::msg::Point>;
61 const geometry_msgs::msg::Pose & pose,
double threshold_distance,
bool denormalize_s) const
62 ->
std::optional<
double>;
66 const geometry_msgs::msg::Point & point, const
double s, const
bool denormalize_s = false) const
69 const geometry_msgs::msg::Point & point, const
double s, const
bool denormalize_s = false) const
70 -> geometry_msgs::msg::Vector3;
74 auto denormalize(const
std::optional<
double> & s, const
bool throw_error_on_out_of_range = true)
75 const ->
std::optional<
double>;
76 auto denormalize(const
double s) const ->
double;
80 const
std::
vector<geometry_msgs::msg::Point> & points, const
bool close_start_end = false)
Definition: line_segment.hpp:30
const double length_2d
Definition: line_segment.hpp:37
auto getSquaredDistanceVector(const geometry_msgs::msg::Point &point, const double s, const bool denormalize_s=false) const -> geometry_msgs::msg::Vector3
Get 3D vector from specified 3D point to specified 3D point on line segment.
Definition: line_segment.cpp:256
const double length
Definition: line_segment.hpp:36
auto relativePointPosition2D(const geometry_msgs::msg::Point &point) const -> int
Determines the relative position of a point with respect to the line segment.
Definition: line_segment.cpp:357
const geometry_msgs::msg::Vector3 vector_2d
Definition: line_segment.hpp:35
auto get2DIntersectionSValue(const geometry_msgs::msg::Point &point, const bool denormalize_s=false) const -> std::optional< double >
Find intersection point of 1 line segment and 1 point.
Definition: line_segment.cpp:168
const geometry_msgs::msg::Vector3 vector
Definition: line_segment.hpp:34
auto getSquaredDistanceIn2D(const geometry_msgs::msg::Point &point, const double s, const bool denormalize_s=false) const -> double
Get squared distance (Square of euclidean distance) between specified 3D point and specified 3D point...
Definition: line_segment.cpp:242
auto getNormalVector() const -> geometry_msgs::msg::Vector3
Get normal vector of the line segment.
Definition: line_segment.cpp:217
LineSegment(const geometry_msgs::msg::Point &start_point, const geometry_msgs::msg::Point &end_point)
Definition: line_segment.cpp:30
auto getIntersection2D(const LineSegment &line) const -> std::optional< geometry_msgs::msg::Point >
Find intersection point of two line segments.
Definition: line_segment.cpp:207
const geometry_msgs::msg::Point start_point
Definition: line_segment.hpp:32
auto getPose(const double s, const bool denormalize_s=false, const bool fill_pitch=true) const -> geometry_msgs::msg::Pose
Get pose on the line segment from s value. Orientation of thee return value was calculated from the v...
Definition: line_segment.cpp:107
auto get2DVectorSlope() const -> double
Definition: line_segment.cpp:226
auto isIntersect2D(const geometry_msgs::msg::Point &point) const -> bool
Checking the intersection with 1 line segment and 1 point in 2D (x,y) coordinate. Ignore z axis.
Definition: line_segment.cpp:125
auto getSValue(const geometry_msgs::msg::Pose &pose, double threshold_distance, bool denormalize_s) const -> std::optional< double >
Definition: line_segment.cpp:137
auto getPoint(const double s, const bool denormalize_s=false) const -> geometry_msgs::msg::Point
Get point on the line segment from s value.
Definition: line_segment.cpp:73
const geometry_msgs::msg::Point end_point
Definition: line_segment.hpp:33
auto isInBounds2D(const geometry_msgs::msg::Point &point) const -> bool
Checks if the given point lies within the bounding box of the line segment.
Definition: line_segment.cpp:334
auto getLineSegments(const std::vector< geometry_msgs::msg::Point > &points, const bool close_start_end=false) -> std::vector< LineSegment >
Get the line segments from points.
Definition: line_segment.cpp:308
Definition: bounding_box.hpp:32