scenario_simulator_v2 C++ API
|
#include <line_segment.hpp>
Public Member Functions | |
LineSegment (const geometry_msgs::msg::Point &start_point, const geometry_msgs::msg::Point &end_point) | |
LineSegment (const geometry_msgs::msg::Point &start_point, const geometry_msgs::msg::Vector3 &vec, double length) | |
~LineSegment () | |
LineSegment & | operator= (const LineSegment &) |
auto | getPoint (const double s, const bool denormalize_s=false) const -> geometry_msgs::msg::Point |
Get point on the line segment from s value. More... | |
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 vector of the line segment. More... | |
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. More... | |
auto | isIntersect2D (const LineSegment &l0) const -> bool |
Checking the intersection with 2 line segments in 2D (x,y) coordinate. Ignore z axis. More... | |
auto | getIntersection2DSValue (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. More... | |
auto | getIntersection2DSValue (const LineSegment &line, const bool denormalize_s=false) const -> std::optional< double > |
Get S value of the intersection point of two line segment. More... | |
auto | getIntersection2D (const LineSegment &line) const -> std::optional< geometry_msgs::msg::Point > |
Find intersection point of two line segments. More... | |
auto | getSValue (const geometry_msgs::msg::Pose &pose, double threshold_distance, bool denormalize_s) const -> std::optional< double > |
auto | getVector () const -> geometry_msgs::msg::Vector3 |
auto | getNormalVector () const -> geometry_msgs::msg::Vector3 |
Get normal vector of the line segment. More... | |
auto | get2DVector () const -> geometry_msgs::msg::Vector3 |
auto | getLength () const -> double |
auto | get2DLength () const -> double |
auto | getSlope () const -> double |
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 on line segment in 2D. (x,y) More... | |
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. More... | |
Public Attributes | |
const geometry_msgs::msg::Point | start_point |
const geometry_msgs::msg::Point | end_point |
math::geometry::LineSegment::LineSegment | ( | const geometry_msgs::msg::Point & | start_point, |
const geometry_msgs::msg::Point & | end_point | ||
) |
math::geometry::LineSegment::LineSegment | ( | const geometry_msgs::msg::Point & | start_point, |
const geometry_msgs::msg::Vector3 & | vec, | ||
double | length | ||
) |
math::geometry::LineSegment::~LineSegment | ( | ) |
auto math::geometry::LineSegment::get2DLength | ( | ) | const -> double |
auto math::geometry::LineSegment::get2DVector | ( | ) | const -> geometry_msgs::msg::Vector3 |
auto math::geometry::LineSegment::getIntersection2D | ( | const LineSegment & | line | ) | const -> std::optional<geometry_msgs::msg::Point> |
Find intersection point of two line segments.
line | Line segment of you want to find intersection. |
auto math::geometry::LineSegment::getIntersection2DSValue | ( | 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.
point | point of you want to find intersection. |
auto math::geometry::LineSegment::getIntersection2DSValue | ( | const LineSegment & | line, |
const bool | denormalize_s = false |
||
) | const -> std::optional<double> |
Get S value of the intersection point of two line segment.
line | The line segment you want to check intersection. |
denormalize_s | If true, s value should be normalized in range [0,1]. If false, s value is not normalized. |
auto math::geometry::LineSegment::getLength | ( | ) | const -> double |
auto math::geometry::LineSegment::getNormalVector | ( | ) | const -> geometry_msgs::msg::Vector3 |
Get normal vector of the line segment.
auto math::geometry::LineSegment::getPoint | ( | const double | s, |
const bool | denormalize_s = false |
||
) | const -> geometry_msgs::msg::Point |
Get point on the line segment from s value.
s | Normalized s value in coordinate along line segment. |
denormalize_s | If true, s value should be normalized in range [0,1]. If false, s value is not normalized. |
auto math::geometry::LineSegment::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 vector of the line segment.
s | Normalized s value in coordinate along line segment. |
denormalize_s | If true, s value should be normalized in range [0,1]. If false, s value is not normalized. |
fill_pitch | If true, the pitch value of the orientation is filled. If false, the pitch value of the orientation is 0. This parameter is introduced for backward-compatibility. |
auto math::geometry::LineSegment::getSlope | ( | ) | const -> double |
auto math::geometry::LineSegment::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 on line segment in 2D. (x,y)
point | Specified 3D point |
S | value of specified 3D point in coordinate along line segment. |
denormalize_s | If true, the s value is denormalized. If false, the s value should be normalized in range [0,1]. |
auto math::geometry::LineSegment::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.
point | Specified 3D point |
s | S value of specified 3D point in coordinate along line segment. |
denormalize_s | If true, the s value is denormalized. If false, the s value should be normalized in range [0,1]. |
auto math::geometry::LineSegment::getSValue | ( | const geometry_msgs::msg::Pose & | pose, |
double | threshold_distance, | ||
bool | denormalize_s | ||
) | const -> std::optional<double> |
auto math::geometry::LineSegment::getVector | ( | ) | const -> geometry_msgs::msg::Vector3 |
auto math::geometry::LineSegment::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.
point | point you want to check intersection. |
auto math::geometry::LineSegment::isIntersect2D | ( | const LineSegment & | l0 | ) | const -> bool |
Checking the intersection with 2 line segments in 2D (x,y) coordinate. Ignore z axis.
l0 | line segments you want to check intersection. |
LineSegment & math::geometry::LineSegment::operator= | ( | const LineSegment & | ) |
const geometry_msgs::msg::Point math::geometry::LineSegment::end_point |
const geometry_msgs::msg::Point math::geometry::LineSegment::start_point |