MCPcopy Create free account
hub / github.com/Fields2Cover/Fields2Cover / main

Function main

tutorials/3_headland_generator.cpp:11–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9#include <iostream>
10
11int main() {
12 f2c::Random rand(42);
13 F2CField field = rand.generateRandField(1e4, 5);
14 F2CCells cells = field.getField();
15 F2CRobot robot (2.0, 6.0);
16
17 std::cout << "####### Tutorial 3.1 Constant width headland generator ######" << std::endl;
18 f2c::hg::ConstHL const_hl;
19 F2CCells no_hl = const_hl.generateHeadlands(cells, 3.0 * robot.getWidth());
20 std::cout << "The complete area is " << cells.area() <<
21 ", and the area without headlands is " << no_hl.area() << std::endl;
22
23 f2c::Visualizer::figure();
24 f2c::Visualizer::plot(field);
25 f2c::Visualizer::plot(no_hl);
26 f2c::Visualizer::save("Tutorial_3_1_Const_width.png");
27
28 return 0;
29}
30

Callers

nothing calls this directly

Calls 4

generateRandFieldMethod · 0.80
generateHeadlandsMethod · 0.80
getWidthMethod · 0.45
areaMethod · 0.45

Tested by

no test coverage detected