Class ReqHL

Inheritance Relationships

Base Type

Class Documentation

class ReqHL : public f2c::hg::HeadlandGeneratorBase

Class to generate headlands as wide as each border needs.

A border the swaths run along is only entered, while a border they end on takes a whole turn. Sizing each one on its own leaves the difference to the mainland instead of giving it up on every border.

Public Functions

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

Generate the mainland of a cell covered at a given track angle.

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) override

Generate the mainland of each cell covered at its own track angle.

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. Without one angle per cell, every border keeps the widest headland.

Returns:

Mainland area

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

Generate headland area of the field at a given distance from borders.

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

  • dist_headland – Distance between exterior and interior borders of the headlands.

Returns:

Mainland area

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

Generate headland area of the field for a given number of swaths with given width.

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:

Headland area

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

Generate headland swaths of the field for a given number of swaths with given width.

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, headland swaths are created from outer borders to inner borders. Otherwise, they are created from inner borders to outers.

Returns:

Vector of size n_swaths for each headland swath.

double requiredHeadlandDist(const F2CRobot &robot, double track_ang, double border_ang) const

Width of the headland a border needs.

Parameters:
  • robot – Robot doing the coverage.

  • track_ang – Angle of the swaths on the cell.

  • border_ang – Angle of the border.

Returns:

Distance between the border and the mainland

std::vector<double> requiredHeadlandDist(const F2CRobot &robot, double track_ang, const F2CLinearRing &ring) const

Width of the headland each segment of a ring needs.

Parameters:
  • robot – Robot doing the coverage.

  • track_ang – Angle of the swaths on the cell.

  • ring – Border of the cell or of an obstacle on it.

Returns:

Distance for each segment of ring

double maxHLWidthRequired(const F2CRobot &robot) const

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