Class RoutePlannerBase

Class Documentation

class RoutePlannerBase

Public Functions

virtual F2CRoute genRoute(const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, bool show_log = false, double d_tol = 1e-4, bool redirect_swaths = true)

Generate route to cover the swaths on a field.

If two consecutive swaths are far away, the route connects both through the headland.

Parameters:
  • cells – Headland swath rings used to travel through the headlands

  • swaths_by_cells – Swaths to be covered.

  • show_log – Show log from the optimizer

  • d_tol – Tolerance distance to consider if two points are the same.

Returns:

Route that covers all the swaths

void setStartAndEndPoint(const F2CPoint &p)

Set the start and the end of the route.

virtual F2CGraph2D createShortestGraph(const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, double d_tol) const

Create graph to compute the shortest path between two points in the headlands.

Parameters:
  • cells – Headland swath rings used to travel through the headlands

  • swaths_by_cells – Swaths to be covered.

  • d_tol – Tolerance distance to consider if two points are the same.

virtual F2CGraph2D createCoverageGraph(const F2CCells &cells, const F2CSwathsByCells &swaths_by_cells, F2CGraph2D &shortest_graph, double d_tol, bool redirect_swaths = true) const

Create graph to compute the cost of covering the swaths in a given order.

Parameters:
  • cells – Headland swath rings used to travel through the headlands

  • swaths_by_cells – Swaths to be covered.

  • shortest_graph – Graph to compute the shortest path between two nodes.

  • d_tol – Tolerance distance to consider if two points are the same.

virtual ~RoutePlannerBase() = default