8 import fields2cover
as f2c
11 robot = f2c.Robot(2.0, 6.0)
12 field = rand.generateRandField(1e4, 5);
13 cells = field.getField();
14 const_hl = f2c.HG_Const_gen()
15 no_hl = const_hl.generateHeadlands(cells, 3.0 * robot.getWidth())
16 bf = f2c.SG_BruteForce()
18 swaths = bf.generateSwaths(math.pi, robot.getCovWidth(), no_hl.getGeometry(0))
20 snake_sorter = f2c.RP_Snake()
21 swaths = snake_sorter.genSortedSwaths(swaths)
22 swaths.at(0).getPath().exportToWkt()
25 robot.setMinTurningRadius(2)
26 robot.setMaxDiffCurv(0.1)
27 path_planner = f2c.PP_PathPlanning()
29 print(
"####### Tutorial 6.1 Dubins curves ######")
30 dubins = f2c.PP_DubinsCurves()
31 path_dubins = path_planner.planPath(robot, swaths, dubins);
41 print(
"\n\n####### Tutorial 6.2 Dubins curves with Continuous curvature ######");
42 dubins_cc = f2c.PP_DubinsCurvesCC();
43 path_dubins_cc = path_planner.planPath(robot, swaths, dubins_cc);
52 print(
"\n\n####### Tutorial 6.3 Reeds-Shepp curves ######")
53 reeds_shepp = f2c.PP_ReedsSheppCurves();
54 path_reeds_shepp = path_planner.planPath(robot, swaths, reeds_shepp);
63 print(
"\n\n####### Tutorial 6.4 Reeds-Shepp curves with Continuous curvature ######")
64 reeds_shepp_hc = f2c.PP_ReedsSheppCurvesHC();
65 path_reeds_shepp_hc = path_planner.planPath(robot, swaths, reeds_shepp_hc);