Public Member Functions | Static Public Member Functions | Protected Attributes | Static Private Member Functions | List of all members
f2c::pp::TurningBase Class Referenceabstract

Base class for turn planners. More...

#include <turning_base.h>

Inheritance diagram for f2c::pp::TurningBase:
Inheritance graph
[legend]

Public Member Functions

virtual F2CPath createSimpleTurn (const F2CRobot &robot, double dist_start_pos, double start_angle, double end_angle)=0
 Create a turn. More...
 
F2CPath createTurn (const F2CRobot &robot, const F2CPoint &start_pos, double start_angle, const F2CPoint &end_pos, double end_angle)
 Create a turn that goes from one point with a certain angle to another point. More...
 
F2CPath createTurnIfNotCached (const F2CRobot &robot, double dist_start_pos, double start_angle, double end_angle)
 Generate a turn if it has not been computed before. More...
 
double getDiscretization () const
 Get discretization distance from points in the turn. More...
 
bool getUsingCache () const
 Get if turns are being cached or not. More...
 
void setDiscretization (double d)
 Set discretization distance from points in the turn. More...
 
void setUsingCache (bool c)
 Set if cache should be used when planning same turn as before. More...
 
virtual ~TurningBase ()=default
 

Static Public Member Functions

static bool isTurnValid (const F2CPath &path, double dist_start_end, double end_angle, double max_dist_error=0.05, double max_rot_error=0.1)
 Check if turn is valid. More...
 
static std::vector< double > transformToNormalTurn (const F2CPoint &start_pos, double start_angle, const F2CPoint &end_pos, double end_angle)
 Transform the turn parameters representation from two points with two angles to one distance and two angles. More...
 

Protected Attributes

double discretization {0.01}
 
std::map< std::vector< int >, F2CPathpath_cache_
 
bool using_cache {true}
 

Static Private Member Functions

static void correctPath (F2CPath &path, const F2CPoint &start_pos, const F2CPoint &end_pos, float max_error_dist=0.05)
 

Detailed Description

Base class for turn planners.

Definition at line 22 of file turning_base.h.

Constructor & Destructor Documentation

◆ ~TurningBase()

virtual f2c::pp::TurningBase::~TurningBase ( )
virtualdefault

Member Function Documentation

◆ correctPath()

void f2c::pp::TurningBase::correctPath ( F2CPath path,
const F2CPoint start_pos,
const F2CPoint end_pos,
float  max_error_dist = 0.05 
)
staticprivate

Definition at line 65 of file turning_base.cpp.

◆ createSimpleTurn()

virtual F2CPath f2c::pp::TurningBase::createSimpleTurn ( const F2CRobot robot,
double  dist_start_pos,
double  start_angle,
double  end_angle 
)
pure virtual

Create a turn.

Parameters
dist_start_posDistance between start and end point
start_angleAngle when going into the headland (0 deg is the angle of the headland)
end_angleAngle when going out of the headland

Implemented in f2c::pp::DubinsCurves, f2c::pp::DubinsCurvesCC, f2c::pp::ReedsSheppCurves, and f2c::pp::ReedsSheppCurvesHC.

◆ createTurn()

F2CPath f2c::pp::TurningBase::createTurn ( const F2CRobot robot,
const F2CPoint start_pos,
double  start_angle,
const F2CPoint end_pos,
double  end_angle 
)

Create a turn that goes from one point with a certain angle to another point.

Start and end point are connected with a line that creates the inferior border of the turn.

Parameters
start_posStart point
start_angleStart angle
end_posEnd point
end_angleEnd angle
Returns
Path with the computed turn

Definition at line 30 of file turning_base.cpp.

◆ createTurnIfNotCached()

F2CPath f2c::pp::TurningBase::createTurnIfNotCached ( const F2CRobot robot,
double  dist_start_pos,
double  start_angle,
double  end_angle 
)

Generate a turn if it has not been computed before.

Parameters
dist_start_posDistance between start and end point
start_angleAngle when going into the headland (0 deg is the angle of the headland)
end_angleAngle when going out of the headland

Definition at line 81 of file turning_base.cpp.

◆ getDiscretization()

double f2c::pp::TurningBase::getDiscretization ( ) const

Get discretization distance from points in the turn.

Definition at line 114 of file turning_base.cpp.

◆ getUsingCache()

bool f2c::pp::TurningBase::getUsingCache ( ) const

Get if turns are being cached or not.

Definition at line 122 of file turning_base.cpp.

◆ isTurnValid()

bool f2c::pp::TurningBase::isTurnValid ( const F2CPath path,
double  dist_start_end,
double  end_angle,
double  max_dist_error = 0.05,
double  max_rot_error = 0.1 
)
static

Check if turn is valid.

Definition at line 100 of file turning_base.cpp.

◆ setDiscretization()

void f2c::pp::TurningBase::setDiscretization ( double  d)

Set discretization distance from points in the turn.

Definition at line 118 of file turning_base.cpp.

◆ setUsingCache()

void f2c::pp::TurningBase::setUsingCache ( bool  c)

Set if cache should be used when planning same turn as before.

Definition at line 126 of file turning_base.cpp.

◆ transformToNormalTurn()

std::vector< double > f2c::pp::TurningBase::transformToNormalTurn ( const F2CPoint start_pos,
double  start_angle,
const F2CPoint end_pos,
double  end_angle 
)
static

Transform the turn parameters representation from two points with two angles to one distance and two angles.

Parameters
start_posStart point
start_angleStart angle
end_posEnd point
end_angleEnd angle
Returns
Vector with the values of the new representation

Definition at line 11 of file turning_base.cpp.

Member Data Documentation

◆ discretization

double f2c::pp::TurningBase::discretization {0.01}
protected

Definition at line 92 of file turning_base.h.

◆ path_cache_

std::map<std::vector<int>, F2CPath> f2c::pp::TurningBase::path_cache_
protected

Definition at line 91 of file turning_base.h.

◆ using_cache

bool f2c::pp::TurningBase::using_cache {true}
protected

Definition at line 93 of file turning_base.h.


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


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