| 11 | #include "fields2cover/types.h" |
| 12 | |
| 13 | TEST(fields2cover_obj_pathLength, computeCost) { |
| 14 | f2c::types::Robot robot(2.1); |
| 15 | robot.setMinTurningRadius(1.5); |
| 16 | f2c::pp::DubinsCurves turn; |
| 17 | F2CPoint start(0.0, 0.0), end(-3.0, 0.0); |
| 18 | f2c::obj::PathLength obj; |
| 19 | |
| 20 | auto path = turn.createTurn(robot, |
| 21 | start, boost::math::constants::half_pi<double>(), |
| 22 | end, 3.0 * boost::math::constants::half_pi<double>()); |
| 23 | |
| 24 | EXPECT_NEAR(obj.computeCost(path), 3 * M_PI / 2.0, 1e-2); |
| 25 | EXPECT_NEAR(obj.computeCostWithMinimizingSign(path), 3 * M_PI / 2.0, 1e-2); |
| 26 | } |
| 27 | |
| 28 | TEST(fields2cover_obj_pathLength, params_check) { |
| 29 | f2c::obj::PathLength objective; |
nothing calls this directly
no test coverage detected