Class CorridorHL

Inheritance Relationships

Base Type

Class Documentation

class CorridorHL : public f2c::hg::HeadlandGeneratorBase

Class to open a corridor where cells border each other, leaving the edges that face the outer boundary or a void untouched.

Meant for cells that came out of a decomposition and already have a headland around the field: shrinking every border again would take a second headland off ground that has one.

Public Functions

virtual F2CCells generateHeadlands(const F2CCells &field, double dist_headland) override

Open a corridor of the given width between cells that share a border.

Parameters:
  • field – Cells that share borders, usually from a decomposition.

  • dist_headland – Width of the corridor.

Returns:

Mainland area

std::vector<CorridorShare> corridorShares(const F2CCells &field, CorridorShareMode mode = CorridorShareMode::ASYMMETRIC) const

Split the corridor between each pair of cells that share a border.

This is the rule generateHeadlands() applies, on its own: which cell gives the corridor, how much of it, and over which part of the border.

Parameters:
  • field – Cells that share borders, usually from a decomposition.

  • mode – Rule to split the corridor with.

Returns:

One share per ordered pair of cells that touch along a border.

void setShareMode(CorridorShareMode mode)

Rule generateHeadlands() uses to split the corridor.

Defaults to ASYMMETRIC.

CorridorShareMode getShareMode() const

Rule generateHeadlands() currently uses to split the corridor.

virtual F2CCells generateHeadlandArea(const F2CCells &field, double swath_width, int n_swaths) override

Open a corridor wide enough for n_swaths passes.

Parameters:
  • field – Borders of the field and the obstacles on it.

  • swath_width – Width of each headland swath.

  • n_swaths – Number of headland swaths.

Returns:

Mainland area

virtual std::vector<F2CCells> generateHeadlandSwaths(const F2CCells &field, double swath_width, int n_swaths, bool dir_out2in = true) override

Widen the corridor one swath at a time.

Parameters:
  • field – Borders of the field and the obstacles on it.

  • swath_width – Width of each headland swath.

  • n_swaths – Number of headland swaths.

  • dir_out2in – When true, the widest corridor comes first.

Returns:

Vector of size n_swaths, each one carved a swath wider.

F2CCells generateHeadlands(const F2CCell &field, const F2CRobot &robot, double track_ang)

Get the regions of a cell without the headlands the robot needs to turn.

Parameters:
  • field – Borders of the cell and the obstacles on it.

  • robot – Robot doing the coverage.

  • track_ang – Angle of the swaths on the cell.

Returns:

Mainland area

F2CCells generateHeadlands(const F2CCells &field, const F2CRobot &robot, const std::vector<double> &track_angs)

Get the regions of the field without the headlands the robot needs.

Parameters:
  • field – Borders of the field and the obstacles on it.

  • robot – Robot doing the coverage.

  • track_angs – Angle of the swaths on each cell.

Returns:

Mainland area

F2CCells generateHeadlands(const F2CCells &field, double dist_headland) = 0

Get the regions of the field without headlands.

Parameters:
  • _field – Original field

  • _dist_headland – Width of the headland

Returns:

Field without headlands

virtual F2CCells generateHeadlands(const F2CCell &field, const F2CRobot &robot, double track_ang)

Get the regions of a cell without the headlands the robot needs to turn.

Parameters:
  • field – Borders of the cell and the obstacles on it.

  • robot – Robot doing the coverage.

  • track_ang – Angle of the swaths on the cell.

Returns:

Mainland area

virtual F2CCells generateHeadlands(const F2CCells &field, const F2CRobot &robot, const std::vector<double> &track_angs)

Get the regions of the field without the headlands the robot needs.

Parameters:
  • field – Borders of the field and the obstacles on it.

  • robot – Robot doing the coverage.

  • track_angs – Angle of the swaths on each cell.

Returns:

Mainland area

double maxHLWidthRequired(const F2CRobot &robot) const

Width of the headland a robot can need on a border, at worst.