MRPT
2.0.1
|
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
Definition at line 56 of file CHolonomicFullEval.h.
#include <mrpt/nav/holonomic/CHolonomicFullEval.h>
Classes | |
struct | EvalOutput |
struct | TOptions |
Algorithm options. More... | |
Public Member Functions | |
CHolonomicFullEval (const mrpt::config::CConfigFileBase *INI_FILE=nullptr) | |
Initialize the parameters of the navigator, from some configuration file, or default values if set to nullptr. More... | |
void | navigate (const NavInput &ni, NavOutput &no) override |
Invokes the holonomic navigation algorithm itself. More... | |
void | initialize (const mrpt::config::CConfigFileBase &INI_FILE) override |
Initialize the parameters of the navigator, reading from the default section name (see derived classes) or the one set via setConfigFileSectionName() More... | |
void | saveConfigFile (mrpt::config::CConfigFileBase &c) const override |
saves all available parameters, in a forma loadable by initialize() More... | |
double | getTargetApproachSlowDownDistance () const override |
Returns the actual value of this parameter [m], as set via the children class options structure. More... | |
void | setTargetApproachSlowDownDistance (const double dist) override |
Sets the actual value of this parameter [m]. More... | |
void | setConfigFileSectionName (const std::string §Name) |
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::CParameterizedTrajectoryGenerator * | getAssociatedPTG () const |
Returns the pointer set by setAssociatedPTG() More... | |
void | enableApproachTargetSlowDown (bool enable) |
virtual mxArray * | writeToMatlab () 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... | |
RTTI classes and functions for polymorphic hierarchies | |
mrpt::rtti::CObject::Ptr | duplicateGetSmartPtr () const |
Makes a deep copy of the object and returns a smart pointer to it. More... | |
Static Public Member Functions | |
static CAbstractHolonomicReactiveMethod::Ptr | Factory (const std::string &className) noexcept |
static CAbstractHolonomicReactiveMethod * | Create (const std::string &className) noexcept |
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... | |
Protected Member Functions | |
CSerializable virtual methods | |
uint8_t | serializeGetVersion () const override |
Must return the current versioning number of the object. More... | |
void | serializeTo (mrpt::serialization::CArchive &out) const override |
Pure virtual method for writing (serializing) to an abstract archive. More... | |
void | serializeFrom (mrpt::serialization::CArchive &in, uint8_t serial_version) override |
Pure virtual method for reading (deserializing) from an abstract archive. More... | |
CSerializable virtual methods | |
virtual void | serializeTo (CSchemeArchiveBase &out) const |
Virtual method for writing (serializing) to an abstract schema based archive. More... | |
virtual void | serializeFrom (CSchemeArchiveBase &in) |
Virtual method for reading (deserializing) from an abstract schema based archive. More... | |
Protected Attributes | |
mrpt::nav::CParameterizedTrajectoryGenerator * | m_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) |
If desired, override in a derived class to manipulate the final evaluations of each directions. More... | |
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. More... | |
mrpt::obs::CSinCosLookUpTableFor2DScans | m_sincos_lut |
RTTI stuff | |
using | Ptr = std::shared_ptr< mrpt::nav ::CHolonomicFullEval > |
using | ConstPtr = std::shared_ptr< const mrpt::nav ::CHolonomicFullEval > |
using | UniquePtr = std::unique_ptr< mrpt::nav ::CHolonomicFullEval > |
using | ConstUniquePtr = std::unique_ptr< const mrpt::nav ::CHolonomicFullEval > |
static const mrpt::rtti::TRuntimeClassId | runtimeClassId |
static constexpr const char * | className = "mrpt::nav" "::" "CHolonomicFullEval" |
static const mrpt::rtti::TRuntimeClassId * | _GetBaseClass () |
static constexpr auto | getClassName () |
static const mrpt::rtti::TRuntimeClassId & | GetRuntimeClassIdStatic () |
static std::shared_ptr< CObject > | CreateObject () |
template<typename... Args> | |
static Ptr | Create (Args &&... args) |
template<typename Alloc , typename... Args> | |
static Ptr | CreateAlloc (const Alloc &alloc, Args &&... args) |
template<typename... Args> | |
static UniquePtr | CreateUnique (Args &&... args) |
virtual const mrpt::rtti::TRuntimeClassId * | GetRuntimeClass () const override |
Returns information about the class of an object in runtime. More... | |
virtual mrpt::rtti::CObject * | clone () const override |
Returns a deep copy (clone) of the object, indepently of its class. More... | |
using mrpt::nav::CHolonomicFullEval::ConstPtr = std::shared_ptr<const mrpt::nav :: CHolonomicFullEval > |
Definition at line 58 of file CHolonomicFullEval.h.
using mrpt::nav::CHolonomicFullEval::ConstUniquePtr = std::unique_ptr<const mrpt::nav :: CHolonomicFullEval > |
Definition at line 58 of file CHolonomicFullEval.h.
using mrpt::nav::CHolonomicFullEval::Ptr = std::shared_ptr< mrpt::nav :: CHolonomicFullEval > |
A type for the associated smart pointer
Definition at line 58 of file CHolonomicFullEval.h.
using mrpt::nav::CHolonomicFullEval::UniquePtr = std::unique_ptr< mrpt::nav :: CHolonomicFullEval > |
Definition at line 58 of file CHolonomicFullEval.h.
CHolonomicFullEval::CHolonomicFullEval | ( | const mrpt::config::CConfigFileBase * | INI_FILE = nullptr | ) |
Initialize the parameters of the navigator, from some configuration file, or default values if set to nullptr.
Definition at line 35 of file CHolonomicFullEval.cpp.
References initialize().
|
staticprotected |
|
overridevirtual |
Returns a deep copy (clone) of the object, indepently of its class.
Implements mrpt::rtti::CObject.
|
inlinestatic |
Definition at line 58 of file CHolonomicFullEval.h.
|
staticnoexceptinherited |
Class factory from class name, e.g.
"CHolonomicVFF"
, etc.
std::logic_error | On invalid or missing parameters. |
|
inlinestatic |
Definition at line 58 of file CHolonomicFullEval.h.
|
static |
|
inlinestatic |
Definition at line 58 of file CHolonomicFullEval.h.
|
private |
Definition at line 557 of file CHolonomicFullEval.cpp.
References M_PI, mrpt::round(), and mrpt::math::wrapToPi().
|
inlineinherited |
Makes a deep copy of the object and returns a smart pointer to it.
Definition at line 204 of file CObject.h.
References mrpt::rtti::CObject::clone().
Referenced by mrpt::obs::CRawlog::insert().
|
inlineinherited |
Definition at line 119 of file CAbstractHolonomicReactiveMethod.h.
References mrpt::nav::CAbstractHolonomicReactiveMethod::m_enableApproachTargetSlowDown.
Referenced by mrpt::nav::CAbstractPTGBasedReactive::build_movement_candidate().
|
private |
Evals one single target of the potentially many of them in NavInput.
Definition at line 69 of file CHolonomicFullEval.cpp.
References mrpt::abs_diff(), mrpt::obs::T2DScanProperties::aperture, ASSERT_, ASSERT_ABOVE_, ASSERT_EQUAL_, mrpt::math::TSegment2D::distance(), mrpt::keep_max(), mrpt::keep_min(), M_PI, mrpt::math::norm(), mrpt::obs::T2DScanProperties::nRays, NUM_FACTORS, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::obstacles, mrpt::nav::CHolonomicFullEval::EvalOutput::phase_scores, mrpt::math::TSegment2D::point1, mrpt::math::TSegment2D::point2, mrpt::obs::T2DScanProperties::rightToLeft, mrpt::round(), mrpt::square(), mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::targets, val, mrpt::math::TPoint2D_data< T >::x, and mrpt::math::TPoint2D_data< T >::y.
|
staticnoexceptinherited |
Definition at line 51 of file CAbstractHolonomicReactiveMethod.cpp.
References mrpt::rtti::TRuntimeClassId::createObject(), mrpt::rtti::findRegisteredClass(), mrpt::ptr_cast< CAST_TO >::from(), and mrpt::rtti::registerAllPendingClasses().
Referenced by mrpt::nav::CAbstractPTGBasedReactive::setHolonomicMethod().
|
inherited |
Returns the pointer set by setAssociatedPTG()
Definition at line 46 of file CAbstractHolonomicReactiveMethod.cpp.
References mrpt::nav::CAbstractHolonomicReactiveMethod::m_associatedPTG.
|
inlinestatic |
Definition at line 58 of file CHolonomicFullEval.h.
|
inherited |
Gets the name of the section used in initialize()
Definition at line 35 of file CAbstractHolonomicReactiveMethod.cpp.
References mrpt::nav::CAbstractHolonomicReactiveMethod::m_cfgSectionName.
|
overridevirtual |
Returns information about the class of an object in runtime.
Reimplemented from mrpt::nav::CAbstractHolonomicReactiveMethod.
|
static |
|
inlineoverridevirtual |
Returns the actual value of this parameter [m], as set via the children class options structure.
Implements mrpt::nav::CAbstractHolonomicReactiveMethod.
Definition at line 122 of file CHolonomicFullEval.h.
References options, and mrpt::nav::CHolonomicFullEval::TOptions::TARGET_SLOW_APPROACHING_DISTANCE.
|
overridevirtual |
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.
Definition at line 48 of file CHolonomicFullEval.cpp.
Invokes the holonomic navigation algorithm itself.
See the description of the input/output structures for details on each parameter.
Implements mrpt::nav::CAbstractHolonomicReactiveMethod.
Definition at line 377 of file CHolonomicFullEval.cpp.
References ASSERT_, ASSERT_EQUAL_, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::clearance, mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::desiredDirection, mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::desiredSpeed, TGap::k_from, mrpt::keep_max(), mrpt::keep_min(), mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::logRecord, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::maxObstacleDist, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::maxRobotSpeed, mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::obstacles, mrpt::square(), mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::targets, and val.
|
privatevirtual |
If desired, override in a derived class to manipulate the final evaluations of each directions.
Definition at line 809 of file CHolonomicFullEval.cpp.
|
overridevirtual |
saves all available parameters, in a forma loadable by initialize()
Implements mrpt::nav::CAbstractHolonomicReactiveMethod.
Definition at line 43 of file CHolonomicFullEval.cpp.
|
overrideprotectedvirtual |
Pure virtual method for reading (deserializing) from an abstract archive.
Users don't call this method directly. Instead, use stream >> object;
.
in | The input binary stream where the object data must read from. |
version | The version of the object stored in the stream: use this version number in your code to know how to read the incoming data. |
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 755 of file CHolonomicFullEval.cpp.
References mrpt::nav::CHolonomicFullEval::TOptions::clearance_threshold_ratio, mrpt::nav::CHolonomicFullEval::TOptions::factorNormalizeOrNot, mrpt::nav::CHolonomicFullEval::TOptions::factorWeights, mrpt::nav::CHolonomicFullEval::TOptions::gap_width_ratio_threshold, mrpt::nav::CHolonomicFullEval::TOptions::HYSTERESIS_SECTOR_COUNT, m_last_selected_sector, MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION, mrpt::nav::CHolonomicFullEval::TOptions::OBSTACLE_SLOW_DOWN_DISTANCE, options, mrpt::nav::CHolonomicFullEval::TOptions::PHASE_FACTORS, mrpt::nav::CHolonomicFullEval::TOptions::PHASE_THRESHOLDS, mrpt::nav::CHolonomicFullEval::TOptions::TARGET_SLOW_APPROACHING_DISTANCE, and mrpt::nav::CHolonomicFullEval::TOptions::TOO_CLOSE_OBSTACLE.
|
inlineprotectedvirtualinherited |
Virtual method for reading (deserializing) from an abstract schema based archive.
Definition at line 74 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
overrideprotectedvirtual |
Must return the current versioning number of the object.
Start in zero for new classes, and increments each time there is a change in the stored format.
Implements mrpt::serialization::CSerializable.
Definition at line 739 of file CHolonomicFullEval.cpp.
|
overrideprotectedvirtual |
Pure virtual method for writing (serializing) to an abstract archive.
Users don't call this method directly. Instead, use stream << object;
.
std::exception | On any I/O error |
Implements mrpt::serialization::CSerializable.
Definition at line 740 of file CHolonomicFullEval.cpp.
References mrpt::nav::CHolonomicFullEval::TOptions::clearance_threshold_ratio, mrpt::nav::CHolonomicFullEval::TOptions::factorNormalizeOrNot, mrpt::nav::CHolonomicFullEval::TOptions::factorWeights, mrpt::nav::CHolonomicFullEval::TOptions::gap_width_ratio_threshold, mrpt::nav::CHolonomicFullEval::TOptions::HYSTERESIS_SECTOR_COUNT, m_last_selected_sector, mrpt::nav::CHolonomicFullEval::TOptions::OBSTACLE_SLOW_DOWN_DISTANCE, options, out, mrpt::nav::CHolonomicFullEval::TOptions::PHASE_FACTORS, mrpt::nav::CHolonomicFullEval::TOptions::PHASE_THRESHOLDS, mrpt::nav::CHolonomicFullEval::TOptions::TARGET_SLOW_APPROACHING_DISTANCE, and mrpt::nav::CHolonomicFullEval::TOptions::TOO_CLOSE_OBSTACLE.
|
inlineprotectedvirtualinherited |
Virtual method for writing (serializing) to an abstract schema based archive.
Definition at line 64 of file CSerializable.h.
References mrpt::serialization::CSerializable::GetRuntimeClass(), and THROW_EXCEPTION.
|
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)
Definition at line 40 of file CAbstractHolonomicReactiveMethod.cpp.
References mrpt::nav::CAbstractHolonomicReactiveMethod::m_associatedPTG.
|
inherited |
Defines the name of the section used in initialize()
Defines the name of the section (Default: "FULL_EVAL_CONFIG")
Definition at line 30 of file CAbstractHolonomicReactiveMethod.cpp.
References mrpt::nav::CAbstractHolonomicReactiveMethod::m_cfgSectionName.
|
inlineoverridevirtual |
Sets the actual value of this parameter [m].
Implements mrpt::nav::CAbstractHolonomicReactiveMethod.
Definition at line 126 of file CHolonomicFullEval.h.
References options, and mrpt::nav::CHolonomicFullEval::TOptions::TARGET_SLOW_APPROACHING_DISTANCE.
|
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.
mxArray
(caller is responsible of memory freeing) or nullptr is class does not support conversion to MATLAB. Definition at line 90 of file CSerializable.h.
|
static |
Definition at line 58 of file CHolonomicFullEval.h.
|
protectedinherited |
If applicable, this will contain the argument of the most recent call to setAssociatedPTG()
Definition at line 127 of file CAbstractHolonomicReactiveMethod.h.
Referenced by mrpt::nav::CAbstractHolonomicReactiveMethod::getAssociatedPTG(), and mrpt::nav::CAbstractHolonomicReactiveMethod::setAssociatedPTG().
|
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 137 of file CHolonomicFullEval.h.
|
protectedinherited |
Whether to decrease speed when approaching target.
Definition at line 129 of file CAbstractHolonomicReactiveMethod.h.
Referenced by mrpt::nav::CAbstractHolonomicReactiveMethod::enableApproachTargetSlowDown().
|
private |
Definition at line 132 of file CHolonomicFullEval.h.
Referenced by serializeFrom(), and serializeTo().
|
private |
Definition at line 155 of file CHolonomicFullEval.h.
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 120 of file CHolonomicFullEval.h.
Referenced by getTargetApproachSlowDownDistance(), serializeFrom(), serializeTo(), and setTargetApproachSlowDownDistance().
|
staticprotected |
Definition at line 58 of file CHolonomicFullEval.h.
Page generated by Doxygen 1.8.14 for MRPT 2.0.1 Git: 0fef1a6d7 Fri Apr 3 23:00:21 2020 +0200 at vie abr 3 23:20:28 CEST 2020 |