I-Seed drone's onboard service  0.0.9
Public Types | Public Member Functions | List of all members
mission_simple_polygon Class Reference

Mission polygon without self-intersections. More...

#include <mission_simple_polygon.h>

Public Types

using polygon = utils::polygon
 
using point = utils::point
 

Public Member Functions

 mission_simple_polygon (const polygon &poly)
 
 ~mission_simple_polygon ()
 
bool visited () const
 Once the build_path is used the instance is marked as visited. More...
 
double distance (const point &start) const
 The distance from point start to the closest polygon waypoint from where path can be constructed. More...
 
void build_path (const point &start, std::vector< point > *result)
 Build mission path. More...
 
std::size_t waypoint_count () const
 The minimum number of waypoints the polygon can be covered by. More...
 

Detailed Description

Mission polygon without self-intersections.

For each edge of the polygon the mission_directed_polygon instance will be created. Each such instance will be checked for the number of waypoints, and only those with a minimal number of waypoints will be kept. When build_path is called we will use closest instance of mission_directed_polygon for path construction

E.g., the simple polygon {A0, A1, A2, A3, A4} will produce five instances of the directed polygons, shown below by the red arrows.

Member Typedef Documentation

◆ polygon

◆ point

Constructor & Destructor Documentation

◆ mission_simple_polygon()

mission_simple_polygon::mission_simple_polygon ( const polygon poly)
explicit
Here is the call graph for this function:

◆ ~mission_simple_polygon()

mission_simple_polygon::~mission_simple_polygon ( )
default

Member Function Documentation

◆ visited()

auto mission_simple_polygon::visited ( ) const

Once the build_path is used the instance is marked as visited.

Returns
true build_path is called already
false build_path is not called yet

◆ distance()

auto mission_simple_polygon::distance ( const point start) const

The distance from point start to the closest polygon waypoint from where path can be constructed.

◆ build_path()

void mission_simple_polygon::build_path ( const point start,
std::vector< point > *  result 
)

Build mission path.

Parameters
startStarting point of the mission path
resultvector where mission path will be saved
Here is the call graph for this function:

◆ waypoint_count()

auto mission_simple_polygon::waypoint_count ( ) const

The minimum number of waypoints the polygon can be covered by.

Note
Zero number of waypoints can be returned in case if the effective polygon area is zero, i.e. polygon is the result of approximation error

The documentation for this class was generated from the following files: