MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / TEST

Function TEST

tests/cpp/objectives/pp_obj/path_length_test.cpp:13–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11#include "fields2cover/types.h"
12
13TEST(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
28TEST(fields2cover_obj_pathLength, params_check) {
29 f2c::obj::PathLength objective;

Callers

nothing calls this directly

Calls 6

setMinTurningRadiusMethod · 0.80
createTurnMethod · 0.80
isMaximizingMethod · 0.80
computeCostMethod · 0.45
isMinimizingMethod · 0.45

Tested by

no test coverage detected