scenario_simulator_v2 C++ API
Public Member Functions | Friends | List of all members
math::geometry::HermiteCurve Class Reference

#include <hermite_curve.hpp>

Public Member Functions

 HermiteCurve (const geometry_msgs::msg::Pose &start_pose, const geometry_msgs::msg::Pose &goal_pose, const geometry_msgs::msg::Vector3 &start_vec, const geometry_msgs::msg::Vector3 &goal_vec)
 
 HermiteCurve (double ax, double bx, double cx, double dx, double ay, double by, double cy, double dy, double az, double bz, double cz, double dz)
 
std::vector< geometry_msgs::msg::Point > getTrajectory (size_t num_points=30) const
 
const std::vector< geometry_msgs::msg::Point > getTrajectory (double start_s, double end_s, double resolution, bool denormalize_s=false) const
 
const geometry_msgs::msg::Pose getPose (double s, bool denormalize_s=false, bool fill_pitch=true) const
 
const geometry_msgs::msg::Point getPoint (double s, bool denormalize_s=false) const
 
const geometry_msgs::msg::Vector3 getTangentVector (double s, bool denormalize_s=false) const
 
const geometry_msgs::msg::Vector3 getNormalVector (double s, bool denormalize_s=false) const
 
double get2DCurvature (double s, bool denormalize_s=false) const
 
double getMaximum2DCurvature () const
 
double getLength (size_t num_points) const
 get length of the hermite curve. Calculate distance of two points on hermite curve and accumulate it's distance More...
 
double getLength () const
 
std::optional< double > getSValue (const geometry_msgs::msg::Pose &pose, double threshold_distance=3.0, bool denormalize_s=false) const
 
double getSquaredDistanceIn2D (const geometry_msgs::msg::Point &point, double s, bool denormalize_s=false) const
 
geometry_msgs::msg::Vector3 getSquaredDistanceVector (const geometry_msgs::msg::Point &point, double s, bool denormalize_s=false) const
 
std::set< double > getCollisionPointsIn2D (const geometry_msgs::msg::Point &point0, const geometry_msgs::msg::Point &point1, bool search_backward=false, bool denormalize_s=false) const
 
std::optional< double > getCollisionPointIn2D (const geometry_msgs::msg::Point &point0, const geometry_msgs::msg::Point &point1, bool search_backward=false, bool denormalize_s=false) const
 
std::set< double > getCollisionPointsIn2D (const std::vector< geometry_msgs::msg::Point > &polygon, bool search_backward=false, bool close_start_end=true, bool denormalize_s=false) const
 
std::optional< double > getCollisionPointIn2D (const std::vector< geometry_msgs::msg::Point > &polygon, bool search_backward=false, bool close_start_end=true, bool denormalize_s=false) const
 

Friends

class HermiteCurveTest
 

Constructor & Destructor Documentation

◆ HermiteCurve() [1/2]

math::geometry::HermiteCurve::HermiteCurve ( const geometry_msgs::msg::Pose &  start_pose,
const geometry_msgs::msg::Pose &  goal_pose,
const geometry_msgs::msg::Vector3 &  start_vec,
const geometry_msgs::msg::Vector3 &  goal_vec 
)

◆ HermiteCurve() [2/2]

math::geometry::HermiteCurve::HermiteCurve ( double  ax,
double  bx,
double  cx,
double  dx,
double  ay,
double  by,
double  cy,
double  dy,
double  az,
double  bz,
double  cz,
double  dz 
)

Member Function Documentation

◆ get2DCurvature()

double math::geometry::HermiteCurve::get2DCurvature ( double  s,
bool  denormalize_s = false 
) const

◆ getCollisionPointIn2D() [1/2]

std::optional< double > math::geometry::HermiteCurve::getCollisionPointIn2D ( const geometry_msgs::msg::Point &  point0,
const geometry_msgs::msg::Point &  point1,
bool  search_backward = false,
bool  denormalize_s = false 
) const

◆ getCollisionPointIn2D() [2/2]

std::optional< double > math::geometry::HermiteCurve::getCollisionPointIn2D ( const std::vector< geometry_msgs::msg::Point > &  polygon,
bool  search_backward = false,
bool  close_start_end = true,
bool  denormalize_s = false 
) const

◆ getCollisionPointsIn2D() [1/2]

std::set< double > math::geometry::HermiteCurve::getCollisionPointsIn2D ( const geometry_msgs::msg::Point &  point0,
const geometry_msgs::msg::Point &  point1,
bool  search_backward = false,
bool  denormalize_s = false 
) const
Note
Obtain a solution to the cubic equation ax^3 + bx^2 + cx + d = 0 that falls within the range [0, 1].
PolynomialSolver::solveCubicEquation throws common::SimulationError when any x value can satisfy the equation, so the beginning and end point of this curve can collide with the line segment. If search_backward = true, the line segment collisions at the end of the curve. So return 1. If search_backward = false, the line segment collisions at the start of the curve. So return 0.
Denormalize given S value as necessary
If the curve and the line segment to be intersected are parallel to either of the x/y axes, one of the two parameters, tx, ty, will be in the range [0, 1] while the other will be out of that range because of division by zero.

◆ getCollisionPointsIn2D() [2/2]

std::set< double > math::geometry::HermiteCurve::getCollisionPointsIn2D ( const std::vector< geometry_msgs::msg::Point > &  polygon,
bool  search_backward = false,
bool  close_start_end = true,
bool  denormalize_s = false 
) const

◆ getLength() [1/2]

double math::geometry::HermiteCurve::getLength ( ) const
inline

◆ getLength() [2/2]

double math::geometry::HermiteCurve::getLength ( size_t  num_points) const

get length of the hermite curve. Calculate distance of two points on hermite curve and accumulate it's distance

Parameters
num_points
Returns
double length

Approximate distance of two points on hermite curve, ignore terms above the second order of delta s.

◆ getMaximum2DCurvature()

double math::geometry::HermiteCurve::getMaximum2DCurvature ( ) const

◆ getNormalVector()

const geometry_msgs::msg::Vector3 math::geometry::HermiteCurve::getNormalVector ( double  s,
bool  denormalize_s = false 
) const

◆ getPoint()

const geometry_msgs::msg::Point math::geometry::HermiteCurve::getPoint ( double  s,
bool  denormalize_s = false 
) const

◆ getPose()

const geometry_msgs::msg::Pose math::geometry::HermiteCurve::getPose ( double  s,
bool  denormalize_s = false,
bool  fill_pitch = true 
) const
Note
fill_pitch is introduced for backward-compatibility.

◆ getSquaredDistanceIn2D()

double math::geometry::HermiteCurve::getSquaredDistanceIn2D ( const geometry_msgs::msg::Point &  point,
double  s,
bool  denormalize_s = false 
) const

◆ getSquaredDistanceVector()

geometry_msgs::msg::Vector3 math::geometry::HermiteCurve::getSquaredDistanceVector ( const geometry_msgs::msg::Point &  point,
double  s,
bool  denormalize_s = false 
) const

◆ getSValue()

std::optional< double > math::geometry::HermiteCurve::getSValue ( const geometry_msgs::msg::Pose &  pose,
double  threshold_distance = 3.0,
bool  denormalize_s = false 
) const

◆ getTangentVector()

const geometry_msgs::msg::Vector3 math::geometry::HermiteCurve::getTangentVector ( double  s,
bool  denormalize_s = false 
) const

◆ getTrajectory() [1/2]

const std::vector< geometry_msgs::msg::Point > math::geometry::HermiteCurve::getTrajectory ( double  start_s,
double  end_s,
double  resolution,
bool  denormalize_s = false 
) const

◆ getTrajectory() [2/2]

std::vector< geometry_msgs::msg::Point > math::geometry::HermiteCurve::getTrajectory ( size_t  num_points = 30) const

Friends And Related Function Documentation

◆ HermiteCurveTest

friend class HermiteCurveTest
friend

The documentation for this class was generated from the following files: