Main MRPT website > C++ reference for MRPT 1.5.3
List of all members | Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes
mrpt::nav::CHolonomicFullEval Class Reference

Detailed Description

Full evaluation of all possible directions within the discrete set of input directions.

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

# Section name can be changed via setConfigFileSectionName()
[FULL_EVAL_CONFIG]
factorWeights = 1.0 1.0 1.0 0.05 1.0
factorNormalizeOrNot = 0 0 0 0 1
// 0: Clearness in direction
// 1: Closest approach to target along straight line (Euclidean)
// 2: Distance of end collision-free point to target (Euclidean)
// 3: Hysteresis
// 4: Clearness to nearest obstacle along path
TARGET_SLOW_APPROACHING_DISTANCE = 0.20 // Start to reduce speed when closer than this to target [m]
TOO_CLOSE_OBSTACLE = 0.02 // Directions with collision-free distances below this threshold are not elegible.
HYSTERESIS_SECTOR_COUNT = 5 // Range of "sectors" (directions) for hysteresis over successive timesteps
PHASE1_FACTORS = 0 1 2 // Indices of the factors above to be considered in phase 1
PHASE2_FACTORS = 3 4 // Indices of the factors above to be considered in phase 2
PHASE1_THRESHOLD = 0.75 // Phase1 scores must be above this relative range threshold [0,1] to be considered in phase 2 (Default:`0.75`)
See also
CAbstractHolonomicReactiveMethod,CReactiveNavigationSystem

Definition at line 49 of file CHolonomicFullEval.h.

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

Inheritance diagram for mrpt::nav::CHolonomicFullEval:
Inheritance graph

Classes

struct  EvalOutput
 
struct  TOptions
 Algorithm options. More...
 

Public Member Functions

void * operator new (size_t size)
 
void * operator new[] (size_t size)
 
void operator delete (void *ptr) throw ()
 
void operator delete[] (void *ptr) throw ()
 
void operator delete (void *memory, void *ptr) throw ()
 
void * operator new (size_t size, const std::nothrow_t &) throw ()
 
void operator delete (void *ptr, const std::nothrow_t &) throw ()
 
 CHolonomicFullEval (const mrpt::utils::CConfigFileBase *INI_FILE=NULL)
 Initialize the parameters of the navigator, from some configuration file, or default values if set to NULL. More...
 
void navigate (const NavInput &ni, NavOutput &no) MRPT_OVERRIDE
 Invokes the holonomic navigation algorithm itself. More...
 
virtual void initialize (const mrpt::utils::CConfigFileBase &INI_FILE) MRPT_OVERRIDE
 Initialize the parameters of the navigator, reading from the default section name (see derived classes) or the one set via setConfigFileSectionName() More...
 
virtual void saveConfigFile (mrpt::utils::CConfigFileBase &c) const MRPT_OVERRIDE
 saves all available parameters, in a forma loadable by initialize() More...
 
double getTargetApproachSlowDownDistance () const MRPT_OVERRIDE
 Returns the actual value of this parameter [m], as set via the children class options structure. More...
 
void setTargetApproachSlowDownDistance (const double dist) MRPT_OVERRIDE
 Sets the actual value of this parameter [m]. More...
 
void setConfigFileSectionName (const std::string &sectName)
 Defines the name of the section used in initialize() More...
 
std::string getConfigFileSectionName () const
 Gets the name of the section used in initialize() More...
 
void setAssociatedPTG (mrpt::nav::CParameterizedTrajectoryGenerator *ptg)
 Optionally, sets the associated PTG, just in case a derived class requires this info (not required for methods where the robot kinematics are totally abstracted) More...
 
mrpt::nav::CParameterizedTrajectoryGeneratorgetAssociatedPTG () const
 Returns the pointer set by setAssociatedPTG() More...
 
void enableApproachTargetSlowDown (bool enable)
 
virtual mxArraywriteToMatlab () const
 Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class. More...
 
mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer). More...
 
CObject * clone () const
 Cloning interface for smart pointers. More...
 

Static Public Member Functions

static void * operator new (size_t size, void *ptr)
 
static CAbstractHolonomicReactiveMethodCreate (const std::string &className) MRPT_NO_THROWS
 Class factory from class name, e.g. More...
 

Public Attributes

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

Static Public Attributes

static const mrpt::utils::TRuntimeClassId classCObject
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCAbstractHolonomicReactiveMethod
 
RTTI stuff
static const mrpt::utils::TRuntimeClassId classCSerializable
 

Protected Member Functions

CSerializable virtual methods
void writeToStream (mrpt::utils::CStream &out, int *getVersion) const
 Introduces a pure virtual method responsible for writing to a CStream. More...
 
void readFromStream (mrpt::utils::CStream &in, int version)
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori. More...
 

Protected Attributes

mrpt::nav::CParameterizedTrajectoryGeneratorm_associatedPTG
 If applicable, this will contain the argument of the most recent call to setAssociatedPTG() More...
 
bool m_enableApproachTargetSlowDown
 Whether to decrease speed when approaching target. More...
 

Private Member Functions

unsigned int direction2sector (const double a, const unsigned int N)
 
virtual void postProcessDirectionEvaluations (std::vector< double > &dir_evals, const NavInput &ni, unsigned int trg_idx)
 
void evalSingleTarget (unsigned int target_idx, const NavInput &ni, EvalOutput &eo)
 Evals one single target of the potentially many of them in NavInput. More...
 

Private Attributes

unsigned int m_last_selected_sector
 
mrpt::math::CMatrixD m_dirs_scores
 Individual scores for each direction: (i,j), i (row) are directions, j (cols) are scores. Not all directions may have evaluations, in which case a "-1" value will be found. More...
 

RTTI stuff

typedef CHolonomicFullEvalPtr SmartPtr
 
static mrpt::utils::CLASSINIT _init_CHolonomicFullEval
 
static mrpt::utils::TRuntimeClassId classCHolonomicFullEval
 
static const mrpt::utils::TRuntimeClassIdclassinfo
 
static const mrpt::utils::TRuntimeClassId_GetBaseClass ()
 
virtual const mrpt::utils::TRuntimeClassIdGetRuntimeClass () const
 Returns information about the class of an object in runtime. More...
 
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class. More...
 
static mrpt::utils::CObjectCreateObject ()
 
static CHolonomicFullEvalPtr Create ()
 

Member Typedef Documentation

◆ SmartPtr

typedef CHolonomicFullEvalPtr mrpt::nav::CHolonomicFullEval::SmartPtr

A typedef for the associated smart pointer

Definition at line 51 of file CHolonomicFullEval.h.

Constructor & Destructor Documentation

◆ CHolonomicFullEval()

mrpt::nav::CHolonomicFullEval::CHolonomicFullEval ( 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

◆ _GetBaseClass()

static const mrpt::utils::TRuntimeClassId* mrpt::nav::CHolonomicFullEval::_GetBaseClass ( )
staticprotected

◆ clone()

CObject* mrpt::utils::CObject::clone ( ) const
inlineinherited

Cloning interface for smart pointers.

Definition at line 143 of file CObject.h.

◆ Create() [1/2]

static CHolonomicFullEvalPtr mrpt::nav::CHolonomicFullEval::Create ( )
static

◆ Create() [2/2]

static CAbstractHolonomicReactiveMethod* mrpt::nav::CAbstractHolonomicReactiveMethod::Create ( const std::string &  className)
staticinherited

Class factory from class name, e.g.

"CHolonomicVFF", etc.

Exceptions
std::logic_errorOn invalid or missing parameters.

◆ CreateObject()

static mrpt::utils::CObject* mrpt::nav::CHolonomicFullEval::CreateObject ( )
static

◆ direction2sector()

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

◆ duplicate()

virtual mrpt::utils::CObject* mrpt::nav::CHolonomicFullEval::duplicate ( ) const
virtual

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

◆ duplicateGetSmartPtr()

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const
inlineinherited

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 140 of file CObject.h.

◆ enableApproachTargetSlowDown()

void mrpt::nav::CAbstractHolonomicReactiveMethod::enableApproachTargetSlowDown ( bool  enable)
inlineinherited

Definition at line 100 of file CAbstractHolonomicReactiveMethod.h.

◆ evalSingleTarget()

void mrpt::nav::CHolonomicFullEval::evalSingleTarget ( unsigned int  target_idx,
const NavInput ni,
EvalOutput eo 
)
private

Evals one single target of the potentially many of them in NavInput.

◆ getAssociatedPTG()

mrpt::nav::CParameterizedTrajectoryGenerator* mrpt::nav::CAbstractHolonomicReactiveMethod::getAssociatedPTG ( ) const
inherited

Returns the pointer set by setAssociatedPTG()

◆ getConfigFileSectionName()

std::string mrpt::nav::CAbstractHolonomicReactiveMethod::getConfigFileSectionName ( ) const
inherited

Gets the name of the section used in initialize()

◆ GetRuntimeClass()

virtual const mrpt::utils::TRuntimeClassId* mrpt::nav::CHolonomicFullEval::GetRuntimeClass ( ) const
virtual

Returns information about the class of an object in runtime.

Reimplemented from mrpt::nav::CAbstractHolonomicReactiveMethod.

◆ getTargetApproachSlowDownDistance()

double mrpt::nav::CHolonomicFullEval::getTargetApproachSlowDownDistance ( ) const
inlinevirtual

Returns the actual value of this parameter [m], as set via the children class options structure.

See also
setTargetApproachSlowDownDistance()

Implements mrpt::nav::CAbstractHolonomicReactiveMethod.

Definition at line 86 of file CHolonomicFullEval.h.

References mrpt::nav::CHolonomicFullEval::TOptions::TARGET_SLOW_APPROACHING_DISTANCE.

◆ initialize()

virtual void mrpt::nav::CHolonomicFullEval::initialize ( const mrpt::utils::CConfigFileBase c)
virtual

Initialize the parameters of the navigator, reading from the default section name (see derived classes) or the one set via setConfigFileSectionName()

Implements mrpt::nav::CAbstractHolonomicReactiveMethod.

◆ navigate()

void mrpt::nav::CHolonomicFullEval::navigate ( const NavInput ni,
NavOutput no 
)
virtual

Invokes the holonomic navigation algorithm itself.

See the description of the input/output structures for details on each parameter.

Implements mrpt::nav::CAbstractHolonomicReactiveMethod.

◆ operator delete() [1/3]

void mrpt::nav::CHolonomicFullEval::operator delete ( void *  ptr)
throw (
)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator delete() [2/3]

void mrpt::nav::CHolonomicFullEval::operator delete ( void *  memory,
void *  ptr 
)
throw (
)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator delete() [3/3]

void mrpt::nav::CHolonomicFullEval::operator delete ( void *  ptr,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator delete[]()

void mrpt::nav::CHolonomicFullEval::operator delete[] ( void *  ptr)
throw (
)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator new() [1/3]

static void* mrpt::nav::CHolonomicFullEval::operator new ( size_t  size,
void *  ptr 
)
inlinestatic

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator new() [2/3]

void* mrpt::nav::CHolonomicFullEval::operator new ( size_t  size)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator new() [3/3]

void* mrpt::nav::CHolonomicFullEval::operator new ( size_t  size,
const std::nothrow_t &   
)
throw (
)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ operator new[]()

void* mrpt::nav::CHolonomicFullEval::operator new[] ( size_t  size)
inline

Definition at line 51 of file CHolonomicFullEval.h.

◆ postProcessDirectionEvaluations()

virtual void mrpt::nav::CHolonomicFullEval::postProcessDirectionEvaluations ( std::vector< double > &  dir_evals,
const NavInput ni,
unsigned int  trg_idx 
)
privatevirtual

◆ readFromStream()

void mrpt::nav::CHolonomicFullEval::readFromStream ( mrpt::utils::CStream in,
int  version 
)
protectedvirtual

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions
std::exceptionOn any error, see CStream::ReadBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

◆ saveConfigFile()

virtual void mrpt::nav::CHolonomicFullEval::saveConfigFile ( mrpt::utils::CConfigFileBase c) const
virtual

saves all available parameters, in a forma loadable by initialize()

Implements mrpt::nav::CAbstractHolonomicReactiveMethod.

◆ setAssociatedPTG()

void mrpt::nav::CAbstractHolonomicReactiveMethod::setAssociatedPTG ( mrpt::nav::CParameterizedTrajectoryGenerator ptg)
inherited

Optionally, sets the associated PTG, just in case a derived class requires this info (not required for methods where the robot kinematics are totally abstracted)

◆ setConfigFileSectionName()

void mrpt::nav::CAbstractHolonomicReactiveMethod::setConfigFileSectionName ( const std::string &  sectName)
inherited

Defines the name of the section used in initialize()

◆ setTargetApproachSlowDownDistance()

void mrpt::nav::CHolonomicFullEval::setTargetApproachSlowDownDistance ( const double  dist)
inlinevirtual

◆ writeToMatlab()

virtual mxArray* mrpt::utils::CSerializable::writeToMatlab ( ) const
inlinevirtualinherited

Introduces a pure virtual method responsible for writing to a mxArray Matlab object, typically a MATLAB struct whose contents are documented in each derived class.

Returns
A new mxArray (caller is responsible of memory freeing) or NULL is class does not support conversion to MATLAB.

Definition at line 79 of file CSerializable.h.

References BASE_IMPEXP, DEFINE_MRPT_OBJECT_POST, mrpt::utils::ObjectToOctetVector(), mrpt::utils::ObjectToRawString(), mrpt::utils::ObjectToString(), mrpt::utils::OctetVectorToObject(), mrpt::utils::RawStringToObject(), and mrpt::utils::StringToObject().

◆ writeToStream()

void mrpt::nav::CHolonomicFullEval::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const
protectedvirtual

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions
std::exceptionOn any error, see CStream::WriteBuffer
See also
CStream

Implements mrpt::utils::CSerializable.

Member Data Documentation

◆ _init_CHolonomicFullEval

mrpt::utils::CLASSINIT mrpt::nav::CHolonomicFullEval::_init_CHolonomicFullEval
staticprotected

Definition at line 51 of file CHolonomicFullEval.h.

◆ classCAbstractHolonomicReactiveMethod

const mrpt::utils::TRuntimeClassId mrpt::nav::CAbstractHolonomicReactiveMethod::classCAbstractHolonomicReactiveMethod
staticinherited

Definition at line 47 of file CAbstractHolonomicReactiveMethod.h.

◆ classCHolonomicFullEval

mrpt::utils::TRuntimeClassId mrpt::nav::CHolonomicFullEval::classCHolonomicFullEval
static

Definition at line 51 of file CHolonomicFullEval.h.

◆ classCObject

const mrpt::utils::TRuntimeClassId mrpt::utils::CObject::classCObject
staticinherited

Definition at line 128 of file CObject.h.

◆ classCSerializable

const mrpt::utils::TRuntimeClassId mrpt::utils::CSerializable::classCSerializable
staticinherited

Definition at line 42 of file CSerializable.h.

◆ classinfo

const mrpt::utils::TRuntimeClassId* mrpt::nav::CHolonomicFullEval::classinfo
static

Definition at line 51 of file CHolonomicFullEval.h.

◆ m_associatedPTG

mrpt::nav::CParameterizedTrajectoryGenerator* mrpt::nav::CAbstractHolonomicReactiveMethod::m_associatedPTG
protectedinherited

If applicable, this will contain the argument of the most recent call to setAssociatedPTG()

Definition at line 102 of file CAbstractHolonomicReactiveMethod.h.

◆ m_dirs_scores

mrpt::math::CMatrixD mrpt::nav::CHolonomicFullEval::m_dirs_scores
private

Individual scores for each direction: (i,j), i (row) are directions, j (cols) are scores. Not all directions may have evaluations, in which case a "-1" value will be found.

Definition at line 92 of file CHolonomicFullEval.h.

◆ m_enableApproachTargetSlowDown

bool mrpt::nav::CAbstractHolonomicReactiveMethod::m_enableApproachTargetSlowDown
protectedinherited

Whether to decrease speed when approaching target.

Definition at line 103 of file CAbstractHolonomicReactiveMethod.h.

◆ m_last_selected_sector

unsigned int mrpt::nav::CHolonomicFullEval::m_last_selected_sector
private

Definition at line 90 of file CHolonomicFullEval.h.

◆ options

TOptions mrpt::nav::CHolonomicFullEval::options

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

Definition at line 84 of file CHolonomicFullEval.h.




Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Mon Oct 30 10:27:08 UTC 2017