9 import fields2cover
as f2c
11 def near(a, b, error = 1e-7):
12 assert abs(a - b) < error
16 path1 = f2c.LineString();
17 path2 = f2c.LineString();
18 path3 = f2c.LineString();
19 path1.addPoint( 0.0, 0.0);
20 path1.addPoint( 0.0, 1.0);
21 path2.addPoint( 3.0, 1.0);
22 path2.addPoint( 3.0, 0.0);
23 swath1 = f2c.Swath(path1);
24 swath2 = f2c.Swath(path2);
25 swaths = f2c.Swaths();
26 [swaths.push_back(i)
for i
in [swath1, swath2]]
29 robot.setMaxCurv(1.0/1.5);
30 path_planner = f2c.PP_PathPlanning();
31 dubins = f2c.PP_DubinsCurves();
33 path = path_planner.planPath(robot,swaths, dubins);
35 near(path.length(), 2 + 1.5 * math.pi, 0.1);