8 import fields2cover
as f2c
10 DATA_PATH = os.path.dirname(os.path.realpath(__file__))+
"/" + 2 *
"../"+
"data/";
13 field =
f2c.Parser().importFieldGml(DATA_PATH +
"test1.xml");
14 orig_field = field.clone();
18 robot = f2c.Robot(2.0, 6.0);
19 const_hl = f2c.HG_Const_gen()
20 no_hl = const_hl.generateHeadlands(field.getField(), 3.0 * robot.getWidth())
21 bf = f2c.SG_BruteForce()
22 swaths = bf.generateSwaths(math.pi, robot.getCovWidth(), no_hl.getGeometry(0))
23 snake_sorter = f2c.RP_Snake()
24 swaths = snake_sorter.genSortedSwaths(swaths)
26 robot.setMinTurningRadius(2)
27 path_planner = f2c.PP_PathPlanning()
28 dubins = f2c.PP_DubinsCurves()
29 path = path_planner.planPath(robot, swaths, dubins);
43 ps = [path_gps.getState(i).point
for i
in range(path_gps.size())]
44 L = f2c.LineString(f2c.VectorPoint(ps))