8 import fields2cover
as f2c
11 assert pytest.approx(a) == pytest.approx(b)
16 robot = f2c.Robot(2.0, 2.0);
17 robot.setMinTurningRadius(2);
18 robot.setMaxDiffCurv(0.1);
20 const_hl = f2c.HG_Const_gen();
21 ring1 = f2c.LinearRing()
22 ring2 = f2c.LinearRing()
23 ring3 = f2c.LinearRing()
24 ring1.addPoint(0,0); ring1.addPoint(100,0); ring1.addPoint(100,100); ring1.addPoint(0,100); ring1.addPoint(0,0)
25 ring2.addPoint(20,20); ring2.addPoint(20,30); ring2.addPoint(30,30); ring2.addPoint(30,20); ring2.addPoint(20,20)
26 ring3.addPoint(60,60); ring3.addPoint(80,60); ring3.addPoint(80,80); ring3.addPoint(60,80); ring3.addPoint(60,60)
28 cells = f2c.Cells(f2c.Cell(ring1))
29 cells.addRing(0, ring2)
30 cells.addRing(0, ring3)
33 no_hl = const_hl.generateHeadlandArea(cells, robot.getCovWidth(), 3);
34 hl_swaths = const_hl.generateHeadlandSwaths(cells, robot.getCovWidth(), 3,
False);
36 decomp = f2c.DECOMP_Boustrophedon();
37 decomp.setSplitAngle(0.0);
40 bf = f2c.SG_BruteForce();
41 swaths = bf.generateSwaths(3.1416, robot.getCovWidth(), no_hl);
43 route_planner = f2c.RP_RoutePlannerBase()
44 route = route_planner.genRoute(hl_swaths[1], swaths)
46 path_planner = f2c.PP_PathPlanning();
47 dubins = f2c.PP_DubinsCurves();
49 path_dubins = path_planner.planPath(robot, route, dubins)