6_path_planning.cpp
Go to the documentation of this file.
1 //=============================================================================
2 // Copyright (C) 2021-2024 Wageningen University - All Rights Reserved
3 // Author: Gonzalo Mier
4 // BSD-3 License
5 //=============================================================================
6 
7 
8 #include "fields2cover.h"
9 #include <iostream>
10 
11 int main() {
12  f2c::Random rand(42);
13  F2CRobot robot (2.0, 6.0);
15  F2CCells cells = rand.generateRandField(1e4, 5).getField();
16  F2CCells no_hl = const_hl.generateHeadlands(cells, 3.0 * robot.getWidth());
18  F2CSwaths swaths = bf.generateSwaths(M_PI, robot.getCovWidth(), no_hl.getGeometry(0));
20  swaths = snake_sorter.genSortedSwaths(swaths);
21 
22 
24  robot.setMinTurningRadius(2); // m
25  robot.setMaxDiffCurv(0.1); // 1/m^2
26 
27 
28  std::cout << "####### Tutorial 6.1 Dubins curves ######" << std::endl;
31 
37  f2c::Visualizer::save("Tutorial_6_1_Dubins.png");
38 
39  std::cout << "####### Tutorial 6.2 Dubins curves with Continuous curvature ######" << std::endl;
42 
48  f2c::Visualizer::save("Tutorial_6_2_Dubins_CC.png");
49 
50  std::cout << "####### Tutorial 6.3 Reeds-Shepp curves ######" << std::endl;
53 
59  f2c::Visualizer::save("Tutorial_6_3_Reeds_Shepp.png");
60 
61  std::cout << "####### Tutorial 6.4 Reeds-Shepp curves with Continuous curvature ######" << std::endl;
64 
70  f2c::Visualizer::save("Tutorial_6_4_Reeds_Shepp_HC.png");
71 
72  return 0;
73 }
74 
75 
f2c::pp::DubinsCurves
Dubins' curves planner.
Definition: dubins_curves.h:17
f2c::hg::ConstHL
Class to generate headlands with equal width in each border.
Definition: constant_headland.h:18
5_route_planning.swaths
swaths
Definition: 5_route_planning.py:58
f2c::rp::SnakeOrder
Definition: snake_order.h:16
6_path_planning.path_reeds_shepp_hc
path_reeds_shepp_hc
Definition: 6_path_planning.py:65
1_basic_types.cells
cells
Definition: 1_basic_types.py:93
f2c::Visualizer::plot
static void plot(double x, double y, const std::vector< double > &color={})
Definition: visualizer.cpp:23
6_path_planning.path_planner
path_planner
Definition: 6_path_planning.py:27
main
int main()
Definition: 6_path_planning.cpp:11
f2c::pp::DubinsCurvesCC
Dubins' curves planner with continuous curves.
Definition: dubins_curves_cc.h:17
6_path_planning.path_reeds_shepp
path_reeds_shepp
Definition: 6_path_planning.py:54
6_path_planning.path_dubins_cc
path_dubins_cc
Definition: 6_path_planning.py:43
3_headland_generator.rand
rand
Definition: 3_headland_generator.py:11
f2c::pp::PathPlanning
Path planning class to connect a path using a TurningBase class method.
Definition: path_planning.h:19
f2c::pp::ReedsSheppCurves
Reeds-Shepp's curves planner.
Definition: reeds_shepp_curves.h:17
2_objective_functions.robot
robot
Definition: 2_objective_functions.py:76
fields2cover.h
f2c::pp::ReedsSheppCurvesHC
Reeds-Shepp's curves planner with continuous curves.
Definition: reeds_shepp_curves_hc.h:17
6_path_planning.dubins
dubins
Definition: 6_path_planning.py:30
3_headland_generator.const_hl
const_hl
Definition: 3_headland_generator.py:17
6_path_planning.dubins_cc
dubins_cc
Definition: 6_path_planning.py:42
f2c::types::Path
Definition: Path.h:23
f2c::types::Cells
Definition: Cells.h:21
6_path_planning.path_dubins
path_dubins
Definition: 6_path_planning.py:31
5_route_planning.snake_sorter
snake_sorter
Definition: 5_route_planning.py:81
f2c::types::Robot
Definition: Robot.h:25
f2c::Random
Definition: random.h:23
3_headland_generator.no_hl
no_hl
Definition: 3_headland_generator.py:18
f2c::Visualizer::figure
static void figure()
Create figure to plot on.
Definition: visualizer.cpp:254
f2c::Visualizer::save
static void save(const std::string &file)
Definition: visualizer.cpp:272
f2c::types::Swaths
Definition: Swaths.h:20
5_route_planning.bf
bf
Definition: 5_route_planning.py:25
6_path_planning.reeds_shepp
reeds_shepp
Definition: 6_path_planning.py:53
f2c::sg::BruteForce
Definition: brute_force.h:20
6_path_planning.reeds_shepp_hc
reeds_shepp_hc
Definition: 6_path_planning.py:64


fields2cover
Author(s):
autogenerated on Fri Apr 25 2025 02:18:31