Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
mrpt::nav::CHolonomicND Class Reference

Detailed Description

An implementation of the holonomic reactive navigation method "Nearness-Diagram".

The algorithm "Nearness-Diagram" was proposed in:

Nearness diagram (ND) navigation: collision avoidance in troublesome scenarios, IEEE Transactions on Robotics and Automation, Minguez, J. and Montano, L., vol. 20, no. 1, pp. 45-59, 2004.

These are the optional parameters of the method which can be set by means of a configuration file passed to the constructor or to CHolonomicND::initialize() or directly in CHolonomicND::options

[ND_CONFIG]
factorWeights=1.0 0.5 2.0 0.4
// 1: Free space
// 2: Dist. in sectors
// 3: Closer to target (euclidean)
// 4: Hysteresis
WIDE_GAP_SIZE_PERCENT = 0.25
MAX_SECTOR_DIST_FOR_D2_PERCENT = 0.25
RISK_EVALUATION_SECTORS_PERCENT = 0.25
RISK_EVALUATION_DISTANCE = 0.15 // In normalized ps-meters [0,1]
TARGET_SLOW_APPROACHING_DISTANCE = 0.60 // For stopping gradually
TOO_CLOSE_OBSTACLE = 0.02 // In normalized ps-meters
See also
CAbstractHolonomicReactiveMethod,CReactiveNavigationSystem

Definition at line 51 of file CHolonomicND.h.

#include <mrpt/nav/holonomic/CHolonomicND.h>

Inheritance diagram for mrpt::nav::CHolonomicND:
Inheritance graph

Classes

struct  TGap
 The structure used to store a detected gap in obstacles. More...
 
struct  TOptions
 Algorithm options. More...
 

Public Types

enum  TSituations { SITUATION_TARGET_DIRECTLY = 1 , SITUATION_SMALL_GAP , SITUATION_WIDE_GAP , SITUATION_NO_WAY_FOUND }
 The set of posible situations for each trajectory. More...
 
typedef std::vector< TGapTGapArray
 

Public Member Functions

 CHolonomicND (const mrpt::utils::CConfigFileBase *INI_FILE=NULL)
 Initialize the parameters of the navigator, from some configuration file, or default values if set to NULL.
 
void navigate (const mrpt::math::TPoint2D &target, const std::vector< float > &obstacles, double maxRobotSpeed, double &desiredDirection, double &desiredSpeed, CHolonomicLogFileRecordPtr &logRecord)
 This method performs the holonomic navigation itself.
 
void initialize (const mrpt::utils::CConfigFileBase &INI_FILE)
 Initialize the parameters of the navigator.
 

Public Attributes

TOptions options
 Parameters of the algorithm (can be set manually or loaded from CHolonomicND::initialize or options.loadFromConfigFile(), etc.)
 

Private Member Functions

unsigned int direction2sector (const double a, const unsigned int N)
 
void gapsEstimator (const std::vector< float > &obstacles, const mrpt::math::TPoint2D &in_target, TGapArray &gaps)
 Find gaps in the obtacles.
 
void searchBestGap (const std::vector< float > &in_obstacles, const double in_maxObsRange, const TGapArray &in_gaps, const mrpt::math::TPoint2D &in_target, unsigned int &out_selDirection, double &out_selEvaluation, TSituations &out_situation, double &out_riskEvaluation, CLogFileRecord_NDPtr log)
 Search the best gap.
 
void calcRepresentativeSectorForGap (TGap &gap, const mrpt::math::TPoint2D &target, const std::vector< float > &obstacles)
 Fills in the representative sector field in the gap structure:
 
void evaluateGaps (const std::vector< float > &in_obstacles, const float in_maxObsRange, const TGapArray &in_gaps, const unsigned int TargetSector, const float TargetDist, std::vector< double > &out_gaps_evaluation)
 Evaluate each gap:
 

Private Attributes

unsigned int m_last_selected_sector
 

Member Typedef Documentation

◆ TGapArray

Definition at line 89 of file CHolonomicND.h.

Member Enumeration Documentation

◆ TSituations

The set of posible situations for each trajectory.

(mrpt::utils::TEnumType works with this enum)

Enumerator
SITUATION_TARGET_DIRECTLY 
SITUATION_SMALL_GAP 
SITUATION_WIDE_GAP 
SITUATION_NO_WAY_FOUND 

Definition at line 93 of file CHolonomicND.h.

Constructor & Destructor Documentation

◆ CHolonomicND()

mrpt::nav::CHolonomicND::CHolonomicND ( const mrpt::utils::CConfigFileBase INI_FILE = NULL)

Initialize the parameters of the navigator, from some configuration file, or default values if set to NULL.

Member Function Documentation

◆ calcRepresentativeSectorForGap()

void mrpt::nav::CHolonomicND::calcRepresentativeSectorForGap ( TGap gap,
const mrpt::math::TPoint2D target,
const std::vector< float > &  obstacles 
)
private

Fills in the representative sector field in the gap structure:

◆ direction2sector()

unsigned int mrpt::nav::CHolonomicND::direction2sector ( const double  a,
const unsigned int  N 
)
private

◆ evaluateGaps()

void mrpt::nav::CHolonomicND::evaluateGaps ( const std::vector< float > &  in_obstacles,
const float  in_maxObsRange,
const TGapArray in_gaps,
const unsigned int  TargetSector,
const float  TargetDist,
std::vector< double > &  out_gaps_evaluation 
)
private

Evaluate each gap:

◆ gapsEstimator()

void mrpt::nav::CHolonomicND::gapsEstimator ( const std::vector< float > &  obstacles,
const mrpt::math::TPoint2D in_target,
TGapArray gaps 
)
private

Find gaps in the obtacles.

◆ initialize()

void mrpt::nav::CHolonomicND::initialize ( const mrpt::utils::CConfigFileBase INI_FILE)
inlinevirtual

Initialize the parameters of the navigator.

Implements mrpt::nav::CAbstractHolonomicReactiveMethod.

Definition at line 103 of file CHolonomicND.h.

◆ navigate()

void mrpt::nav::CHolonomicND::navigate ( const mrpt::math::TPoint2D target,
const std::vector< float > &  obstacles,
double  maxRobotSpeed,
double &  desiredDirection,
double &  desiredSpeed,
CHolonomicLogFileRecordPtr logRecord 
)
virtual

This method performs the holonomic navigation itself.

Parameters
target[IN] The relative location (x,y) of target point.
obstacles[IN] Distance to obstacles from robot location (0,0). First index refers to -PI direction, and last one to +PI direction. Distances can be dealed as "meters", although they are "pseudometers", see note below.
maxRobotSpeed[IN] Maximum robot speed, in "pseudometers/sec". See note below.
desiredDirection[OUT] The desired motion direction, in the range [-PI,PI]
desiredSpeed[OUT] The desired motion speed in that direction, in "pseudometers"/sec. (See note below)
logRecord[IN/OUT] A placeholder for a pointer to a log record with extra info about the execution. Set to NULL if not required. User must free memory using "delete logRecord" after using it.

NOTE: With "pseudometers" we refer to the distance unit in TP-Space, thus:

pseudometer2= meter2 + (rad * r)2

Implements mrpt::nav::CAbstractHolonomicReactiveMethod.

◆ searchBestGap()

void mrpt::nav::CHolonomicND::searchBestGap ( const std::vector< float > &  in_obstacles,
const double  in_maxObsRange,
const TGapArray in_gaps,
const mrpt::math::TPoint2D in_target,
unsigned int &  out_selDirection,
double &  out_selEvaluation,
TSituations out_situation,
double &  out_riskEvaluation,
CLogFileRecord_NDPtr  log 
)
private

Search the best gap.

Member Data Documentation

◆ m_last_selected_sector

unsigned int mrpt::nav::CHolonomicND::m_last_selected_sector
private

Definition at line 125 of file CHolonomicND.h.

◆ options

TOptions mrpt::nav::CHolonomicND::options

Parameters of the algorithm (can be set manually or loaded from CHolonomicND::initialize or options.loadFromConfigFile(), etc.)

Definition at line 122 of file CHolonomicND.h.




Page generated by Doxygen 1.9.6 for MRPT 1.4.0 SVN: at Fri Jan 20 02:28:26 UTC 2023