scenario_simulator_v2 C++ API
Functions | Variables
test_hermite_curve.cpp File Reference
#include <gtest/gtest.h>
#include <geometry/spline/hermite_curve.hpp>
#include "../expect_eq_macros.hpp"
#include "../test_utils.hpp"
Include dependency graph for test_hermite_curve.cpp:

Functions

math::geometry::HermiteCurve makeLine1 ()
 Helper function generating straight line: p(0,0) v(1,0)-> p(1,0) v(1,0) More...
 
math::geometry::HermiteCurve makeLine2 ()
 Helper function generating straight line: p(0,0) v(1,1)-> p(2,2) v(1,1) More...
 
math::geometry::HermiteCurve makeCurve1 (bool concave_upward=true)
 Helper function generating curve: p(0,0) v(1,0)-> p(1,1) v(0,1) More...
 
math::geometry::HermiteCurve makeCurve2 ()
 Helper function generating curve: p(0,0) v(1,0)-> p(1,-1) v(0,-1) More...
 
math::geometry::HermiteCurve makeCurve3 ()
 Helper function generating curve: p(1,1) v(0,-1)-> p(0,0) v(-1,0) More...
 
math::geometry::HermiteCurve makeCurve4 ()
 Helper function generating curve: p(1,-1) v(0,1)-> p(0,0) v(-1,0) More...
 
void generateReferenceTrajectory (double start_x, double start_y, double increment_x, double increment_y, std::vector< geometry_msgs::msg::Point > &vec, unsigned int start_idx=0u)
 Helper function generating a reference trajectory for testing. More...
 
 TEST (HermiteCurveTest, initializationLine)
 
 TEST (HermiteCurveTest, initializationCurve)
 
 TEST (HermiteCurveTest, initializationParams)
 
 TEST (HermiteCurveTest, getTrajectoryZero)
 
 TEST (HermiteCurveTest, getTrajectory)
 
 TEST (HermiteCurveTest, getTrajectoryReversed)
 
 TEST (HermiteCurveTest, getTrajectoryPast1)
 
 TEST (HermiteCurveTest, getTrajectoryPast2)
 
 TEST (HermiteCurveTest, getPointLine)
 
 TEST (HermiteCurveTest, getPointCurve)
 
 TEST (HermiteCurveTest, get2DCurvatureLine)
 
 TEST (HermiteCurveTest, get2DCurvatureCurve)
 
 TEST (HermiteCurveTest, getMaximum2DCurvatureLine)
 
 TEST (HermiteCurveTest, getMaximum2DCurvatureCurve)
 
 TEST (HermiteCurveTest, getLengthNoParameter)
 
 TEST (HermiteCurveTest, getLengthParameter)
 
 TEST (HermiteCurveTest, getSValue)
 
 TEST (HermiteCurveTest, getSValueDenormalized)
 
 TEST (HermiteCurveTest, getSquaredDistanceIn2D)
 
 TEST (HermiteCurveTest, getSquaredDistanceIn2DZeroDistance)
 
 TEST (HermiteCurveTest, getSquaredDistanceVector)
 
 TEST (HermiteCurveTest, getSquaredDistanceVectorZeroDistance)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DLine)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DLineNoCollision)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DCurve)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DCurveEdge)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DVectorWrongCases)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DVectorOneCollision)
 
 TEST (HermiteCurveTest, getCollisionPointIn2DVectorMultipleCollisions)
 
 TEST (HermiteCurveTest, getTangentVector1)
 
 TEST (HermiteCurveTest, getTangentVector2)
 
 TEST (HermiteCurveTest, getTangentVector3)
 
 TEST (HermiteCurveTest, getTangentVector4)
 
 TEST (HermiteCurveTest, getTangentVectorDenormalized1)
 
 TEST (HermiteCurveTest, getTangentVectorDenormalized2)
 
 TEST (HermiteCurveTest, getTangentVectorDenormalized3)
 
 TEST (HermiteCurveTest, getTangentVectorDenormalized4)
 
 TEST (HermiteCurveTest, getNormalVector1)
 
 TEST (HermiteCurveTest, getNormalVector2)
 
 TEST (HermiteCurveTest, getNormalVector3)
 
 TEST (HermiteCurveTest, getNormalVector4)
 
 TEST (HermiteCurveTest, getNormalVectorDenormalized1)
 
 TEST (HermiteCurveTest, getNormalVectorDenormalized2)
 
 TEST (HermiteCurveTest, getNormalVectorDenormalized3)
 
 TEST (HermiteCurveTest, getNormalVectorDenormalized4)
 
int main (int argc, char **argv)
 

Variables

constexpr double EPS = 1e-3
 

Function Documentation

◆ generateReferenceTrajectory()

void generateReferenceTrajectory ( double  start_x,
double  start_y,
double  increment_x,
double  increment_y,
std::vector< geometry_msgs::msg::Point > &  vec,
unsigned int  start_idx = 0u 
)

Helper function generating a reference trajectory for testing.

Parameters
start_xstarting X position
start_ystarting Y position
increment_xincrement over X axis on every step
increment_yincrement over Y axis on every step
vecvector container to generate a reference trajectory in (has to be the size of desired trajectory)
start_idxindex from which to start

◆ main()

int main ( int  argc,
char **  argv 
)

◆ makeCurve1()

math::geometry::HermiteCurve makeCurve1 ( bool  concave_upward = true)

Helper function generating curve: p(0,0) v(1,0)-> p(1,1) v(0,1)

◆ makeCurve2()

Helper function generating curve: p(0,0) v(1,0)-> p(1,-1) v(0,-1)

◆ makeCurve3()

Helper function generating curve: p(1,1) v(0,-1)-> p(0,0) v(-1,0)

◆ makeCurve4()

Helper function generating curve: p(1,-1) v(0,1)-> p(0,0) v(-1,0)

◆ makeLine1()

Helper function generating straight line: p(0,0) v(1,0)-> p(1,0) v(1,0)

◆ makeLine2()

Helper function generating straight line: p(0,0) v(1,1)-> p(2,2) v(1,1)

◆ TEST() [1/45]

TEST ( HermiteCurveTest  ,
get2DCurvatureCurve   
)

◆ TEST() [2/45]

TEST ( HermiteCurveTest  ,
get2DCurvatureLine   
)

◆ TEST() [3/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DCurve   
)

◆ TEST() [4/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DCurveEdge   
)

◆ TEST() [5/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DLine   
)

◆ TEST() [6/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DLineNoCollision   
)

◆ TEST() [7/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DVectorMultipleCollisions   
)

◆ TEST() [8/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DVectorOneCollision   
)

◆ TEST() [9/45]

TEST ( HermiteCurveTest  ,
getCollisionPointIn2DVectorWrongCases   
)

◆ TEST() [10/45]

TEST ( HermiteCurveTest  ,
getLengthNoParameter   
)

◆ TEST() [11/45]

TEST ( HermiteCurveTest  ,
getLengthParameter   
)

◆ TEST() [12/45]

TEST ( HermiteCurveTest  ,
getMaximum2DCurvatureCurve   
)

◆ TEST() [13/45]

TEST ( HermiteCurveTest  ,
getMaximum2DCurvatureLine   
)

◆ TEST() [14/45]

TEST ( HermiteCurveTest  ,
getNormalVector1   
)

◆ TEST() [15/45]

TEST ( HermiteCurveTest  ,
getNormalVector2   
)

◆ TEST() [16/45]

TEST ( HermiteCurveTest  ,
getNormalVector3   
)

◆ TEST() [17/45]

TEST ( HermiteCurveTest  ,
getNormalVector4   
)

◆ TEST() [18/45]

TEST ( HermiteCurveTest  ,
getNormalVectorDenormalized1   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [19/45]

TEST ( HermiteCurveTest  ,
getNormalVectorDenormalized2   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [20/45]

TEST ( HermiteCurveTest  ,
getNormalVectorDenormalized3   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [21/45]

TEST ( HermiteCurveTest  ,
getNormalVectorDenormalized4   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [22/45]

TEST ( HermiteCurveTest  ,
getPointCurve   
)

◆ TEST() [23/45]

TEST ( HermiteCurveTest  ,
getPointLine   
)

◆ TEST() [24/45]

TEST ( HermiteCurveTest  ,
getSquaredDistanceIn2D   
)

◆ TEST() [25/45]

TEST ( HermiteCurveTest  ,
getSquaredDistanceIn2DZeroDistance   
)

◆ TEST() [26/45]

TEST ( HermiteCurveTest  ,
getSquaredDistanceVector   
)

◆ TEST() [27/45]

TEST ( HermiteCurveTest  ,
getSquaredDistanceVectorZeroDistance   
)

◆ TEST() [28/45]

TEST ( HermiteCurveTest  ,
getSValue   
)

◆ TEST() [29/45]

TEST ( HermiteCurveTest  ,
getSValueDenormalized   
)
Note
Test function correctness with parameter denormalize_s = true.

◆ TEST() [30/45]

TEST ( HermiteCurveTest  ,
getTangentVector1   
)

◆ TEST() [31/45]

TEST ( HermiteCurveTest  ,
getTangentVector2   
)

◆ TEST() [32/45]

TEST ( HermiteCurveTest  ,
getTangentVector3   
)

◆ TEST() [33/45]

TEST ( HermiteCurveTest  ,
getTangentVector4   
)

◆ TEST() [34/45]

TEST ( HermiteCurveTest  ,
getTangentVectorDenormalized1   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [35/45]

TEST ( HermiteCurveTest  ,
getTangentVectorDenormalized2   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [36/45]

TEST ( HermiteCurveTest  ,
getTangentVectorDenormalized3   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [37/45]

TEST ( HermiteCurveTest  ,
getTangentVectorDenormalized4   
)
Note
Test function correctness with parameter denormalize_s = true with different curves.

◆ TEST() [38/45]

TEST ( HermiteCurveTest  ,
getTrajectory   
)

◆ TEST() [39/45]

TEST ( HermiteCurveTest  ,
getTrajectoryPast1   
)

◆ TEST() [40/45]

TEST ( HermiteCurveTest  ,
getTrajectoryPast2   
)

◆ TEST() [41/45]

TEST ( HermiteCurveTest  ,
getTrajectoryReversed   
)

◆ TEST() [42/45]

TEST ( HermiteCurveTest  ,
getTrajectoryZero   
)

◆ TEST() [43/45]

TEST ( HermiteCurveTest  ,
initializationCurve   
)

◆ TEST() [44/45]

TEST ( HermiteCurveTest  ,
initializationLine   
)

◆ TEST() [45/45]

TEST ( HermiteCurveTest  ,
initializationParams   
)

Variable Documentation

◆ EPS

constexpr double EPS = 1e-3
constexpr