path_planning_test.cpp
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 #include <gtest/gtest.h>
8 #include <numeric>
9 #include <fstream>
10 #include "fields2cover.h"
11 #include "../test_helpers/path_planning_checker.hpp"
12 #include "../test_helpers/robot_data.hpp"
13 
14 TEST(DISABLED_fields2cover_pp_pp, planPathForConnection) {
18  F2CMultiPoint mp;
19  auto path1 = path_planner.planPathForConnection(robot,
20  F2CPoint(0, 0), M_PI * 0.5, mp, F2CPoint(2, 0), M_PI * 1.5, dubins);
21  EXPECT_NEAR(path1.length(), M_PI, 1e-2);
22 
23  mp.addPoint(30, 40);
24 
25  auto path2 = path_planner.planPathForConnection(robot,
26  F2CPoint(0, 0), M_PI * 0.5, mp, F2CPoint(60, 0), M_PI * 1.5, dubins);
27  EXPECT_NEAR(path2.length(), 100, 10.0);
28 
29  mp.addPoint(33, 40);
30  auto path3 = path_planner.planPathForConnection(robot,
31  F2CPoint(30, 38), M_PI * 0.5, mp, F2CPoint(33, 37), M_PI * 1.5, dubins);
32  EXPECT_NEAR(path3.length(), 2 + 3 + 3, 1);
33 
34  EXPECT_TRUE(isPathCorrect(path1));
35  EXPECT_TRUE(isPathCorrect(path2));
36  EXPECT_TRUE(isPathCorrect(path3));
37 }
38 
f2c::pp::DubinsCurves
Dubins' curves planner.
Definition: dubins_curves.h:17
6_path_planning.path_planner
path_planner
Definition: 6_path_planning.py:27
f2c::pp::PathPlanning
Path planning class to connect a path using a TurningBase class method.
Definition: path_planning.h:19
2_objective_functions.robot
robot
Definition: 2_objective_functions.py:76
fields2cover.h
6_path_planning.dubins
dubins
Definition: 6_path_planning.py:30
f2c::types::MultiPoint::addPoint
void addPoint(const Point &p)
Definition: MultiPoint.cpp:87
f2c::types::MultiPoint
Definition: MultiPoint.h:18
getSimpleRobot
F2CRobot getSimpleRobot()
Definition: robot_data.hpp:13
f2c::types::Robot
Definition: Robot.h:25
TEST
TEST(DISABLED_fields2cover_pp_pp, planPathForConnection)
Definition: path_planning_test.cpp:14
isPathCorrect
testing::AssertionResult isPathCorrect(const F2CPath &path)
Definition: path_planning_checker.hpp:16
F2CPoint
f2c::types::Point F2CPoint
Definition: types.h:38


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31