dubins_cc_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 fields2cover as f2c
9 import math
10 import numpy as np
11 from .PP_checker import IsPathCorrect
12 
13 def near(a, b, error = 1e-7):
14  assert abs(a - b) < error
15 
17  robot = f2c.Robot(2.1, 2.5);
18  robot.setCruiseVel(2.0);
19  robot.setMaxCurv(1.0);
20  robot.setMaxDiffCurv(2.0);
21 
22  turn = f2c.PP_DubinsCurvesCC();
23  start = f2c.Point(0.0, 0.0);
24  end = f2c.Point(-3.0, 0.0);
25  path = turn.createTurn(robot, start, 0.5 * math.pi, end, 1.5 * math.pi);
26 
27  IsPathCorrect(path, start, 0.5 * math.pi, end, 1.5 * math.pi);
28 
30  robot = f2c.Robot(2.1, 2.5);
31  robot.setCruiseVel(2.0);
32  robot.setMaxCurv(1.0);
33  robot.setMaxDiffCurv(2.0);
34  turn = f2c.PP_DubinsCurvesCC();
35  turn.using_cache = False;
36  for ang in np.arange(0.25, math.pi, 0.25):
37  start = f2c.Point(0.0, 0.0);
38  end = f2c.Point(4.0, 0.0);
39  path = turn.createTurn(robot, start, ang, end, ang + math.pi);
40  IsPathCorrect(path, start, ang, end, ang + math.pi);
41 
path_planning.dubins_cc_test.test_fields2cover_pp_dubins_cc_turnDist
def test_fields2cover_pp_dubins_cc_turnDist()
Definition: dubins_cc_test.py:16
path_planning.dubins_cc_test.near
def near(a, b, error=1e-7)
Definition: dubins_cc_test.py:13
path_planning.dubins_cc_test.test_fields2cover_pp_dubins_cc_randomPoints
def test_fields2cover_pp_dubins_cc_randomPoints()
Definition: dubins_cc_test.py:29
IsPathCorrect
testing::AssertionResult IsPathCorrect(const F2CPath &path, F2CPoint start, double start_ang, F2CPoint end, double end_ang, bool check_y_lower_limit=true)
Definition: path_planning_checker.hpp:57


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