reeds_shepp_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(1.0);
21 
22  turn = f2c.PP_ReedsSheppCurves();
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  IsPathCorrect(path, start, 0.5 * math.pi, end, 1.5 * math.pi, False);
27 
29  robot = f2c.Robot(2.1, 2.5);
30  robot.setCruiseVel(2.0);
31  robot.setMaxCurv(1.0);
32  robot.setMaxDiffCurv(1.0);
33  turn = f2c.PP_ReedsSheppCurves();
34  turn.using_cache = False;
35  for ang in np.arange(0.25, math.pi, 0.25):
36  start = f2c.Point(0.0, 0.0);
37  end = f2c.Point(4.0, 0.0);
38  path = turn.createTurn(robot, start, ang, end, ang + math.pi);
39  IsPathCorrect(path, start, ang, end, ang + math.pi, False);
40 
path_planning.reeds_shepp_test.test_fields2cover_pp_reeds_shepp_turnDist
def test_fields2cover_pp_reeds_shepp_turnDist()
Definition: reeds_shepp_test.py:16
path_planning.reeds_shepp_test.near
def near(a, b, error=1e-7)
Definition: reeds_shepp_test.py:13
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
path_planning.reeds_shepp_test.test_fields2cover_pp_reeds_shepp_randomPoints
def test_fields2cover_pp_reeds_shepp_randomPoints()
Definition: reeds_shepp_test.py:28


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