@@ -496,6 +496,36 @@ TEST(time_optimal_trajectory_generation, testPluginAPI)
496
496
ASSERT_EQ (first_trajectory_msg_end, third_trajectory_msg_end);
497
497
}
498
498
499
+ TEST (time_optimal_trajectory_generation, testRelevantZeroMaxAccelerationsInvalidateTrajectory)
500
+ {
501
+ const Eigen::Vector2d max_velocity (1 , 1 );
502
+ const Path path (std::list<Eigen::VectorXd>{ Eigen::Vector2d (0 , 0 ), Eigen::Vector2d (1 , 1 ) });
503
+
504
+ EXPECT_FALSE (Trajectory (path, max_velocity, /* max_acceleration=*/ Eigen::Vector2d (0 , 1 )).isValid ());
505
+ EXPECT_FALSE (Trajectory (path, max_velocity, /* max_acceleration=*/ Eigen::Vector2d (1 , 0 )).isValid ());
506
+ EXPECT_FALSE (Trajectory (path, max_velocity, /* max_acceleration=*/ Eigen::Vector2d (0 , 0 )).isValid ());
507
+ }
508
+
509
+ TEST (time_optimal_trajectory_generation, testIrrelevantZeroMaxAccelerationsDontInvalidateTrajectory)
510
+ {
511
+ const Eigen::Vector2d max_velocity (1 , 1 );
512
+
513
+ EXPECT_TRUE (Trajectory (Path (std::list<Eigen::VectorXd>{ Eigen::Vector2d (0 , 0 ), Eigen::Vector2d (0 , 1 ) }), max_velocity,
514
+ /* max_acceleration=*/ Eigen::Vector2d (0 , 1 ))
515
+ .isValid ());
516
+ EXPECT_TRUE (Trajectory (Path (std::list<Eigen::VectorXd>{ Eigen::Vector2d (0 , 0 ), Eigen::Vector2d (1 , 0 ) }), max_velocity,
517
+ /* max_acceleration=*/ Eigen::Vector2d (1 , 0 ))
518
+ .isValid ());
519
+ }
520
+
521
+ TEST (time_optimal_trajectory_generation, testTimeStepZeroMakesTrajectoryInvalid)
522
+ {
523
+ EXPECT_FALSE (Trajectory (Path (std::list<Eigen::VectorXd>{ Eigen::Vector2d (0 , 0 ), Eigen::Vector2d (1 , 1 ) }),
524
+ /* max_velocity=*/ Eigen::Vector2d (1 , 1 ), /* max_acceleration=*/ Eigen::Vector2d (1 , 1 ),
525
+ /* time_step=*/ 0 )
526
+ .isValid ());
527
+ }
528
+
499
529
int main (int argc, char ** argv)
500
530
{
501
531
testing::InitGoogleTest (&argc, argv);
0 commit comments