path_planning_test.py
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 import pytest
8 import math
9 import fields2cover as f2c
10 
11 def near(a, b, error = 1e-7):
12  assert abs(a - b) < error
13 
14 
16  path1 = f2c.LineString();
17  path2 = f2c.LineString();
18  path3 = f2c.LineString();
19  path1.addPoint( 0.0, 0.0);
20  path1.addPoint( 0.0, 1.0);
21  path2.addPoint( 3.0, 1.0);
22  path2.addPoint( 3.0, 0.0);
23  swath1 = f2c.Swath(path1);
24  swath2 = f2c.Swath(path2);
25  swaths = f2c.Swaths();
26  [swaths.push_back(i) for i in [swath1, swath2]]
27 
28  robot = f2c.Robot();
29  robot.setMaxCurv(1.0/1.5);
30  path_planner = f2c.PP_PathPlanning();
31  dubins = f2c.PP_DubinsCurves();
32 
33  path = path_planner.planPath(robot,swaths, dubins);
34  # Precision is quite low so this is just checking a prediction is done
35  near(path.length(), 2 + 1.5 * math.pi, 0.1);
36 
37 
path_planning.path_planning_test.near
def near(a, b, error=1e-7)
Definition: path_planning_test.py:11
path_planning.path_planning_test.test_fields2cover_pp_pp_turnDist
def test_fields2cover_pp_pp_turnDist()
Definition: path_planning_test.py:15


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