Main MRPT website > C++ reference for MRPT 1.9.9
CAbstractHolonomicReactiveMethod.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 
10 #include "nav-precomp.h" // Precomp header
11 
13 #include <mrpt/utils/CStream.h>
14 
15 using namespace mrpt;
16 using namespace mrpt::utils;
17 using namespace mrpt::nav;
18 
21 
23  const std::string& defaultCfgSectionName)
24  : m_associatedPTG(nullptr),
25  m_enableApproachTargetSlowDown(true),
26  m_cfgSectionName(defaultCfgSectionName)
27 {
28 }
29 CAbstractHolonomicReactiveMethod::~CAbstractHolonomicReactiveMethod() {}
30 /** Defines the name of the section (Default: "FULL_EVAL_CONFIG") */
32  const std::string& sectName)
33 {
34  m_cfgSectionName = sectName;
35 }
37 {
38  return m_cfgSectionName;
39 }
40 
43 {
44  m_associatedPTG = ptg;
45 }
48 {
49  return m_associatedPTG;
50 }
51 
53  const std::string& className) noexcept
54 {
55  try
56  {
58 
59  // Factory:
60  const mrpt::utils::TRuntimeClassId* classId =
62  if (!classId) return nullptr;
63 
65  dynamic_cast<CAbstractHolonomicReactiveMethod*>(
66  classId->createObject()));
67  }
68  catch (...)
69  {
70  return nullptr;
71  }
72 }
73 
75  : targets(), maxRobotSpeed(1.0), maxObstacleDist(1.0), clearance(nullptr)
76 {
77 }
78 
80  : desiredDirection(0), desiredSpeed(0)
81 {
82 }
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
CAbstractHolonomicReactiveMethod
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:44
void registerAllPendingClasses()
Register all pending classes - to be called just before de-serializing an object, for example...
void setAssociatedPTG(mrpt::nav::CParameterizedTrajectoryGenerator *ptg)
Optionally, sets the associated PTG, just in case a derived class requires this info (not required fo...
IMPLEMENTS_VIRTUAL_SERIALIZABLE(CAbstractHolonomicReactiveMethod, CSerializable, mrpt::nav) CAbstractHolonomicReactiveMethod
A base class for holonomic reactive navigation methods.
This is the base class for any user-defined PTG.
mrpt::utils::CObject * createObject() const
Definition: CObject.cpp:93
std::shared_ptr< CAbstractHolonomicReactiveMethod > Ptr
GLsizei const GLchar ** string
Definition: glext.h:4101
const TRuntimeClassId * findRegisteredClass(const std::string &className)
Return info about a given class by its name, or nullptr if the class is not registered.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
mrpt::nav::CParameterizedTrajectoryGenerator * m_associatedPTG
If applicable, this will contain the argument of the most recent call to setAssociatedPTG() ...
static CAbstractHolonomicReactiveMethod::Ptr Factory(const std::string &className) noexcept
std::string getConfigFileSectionName() const
Gets the name of the section used in initialize()
std::string m_cfgSectionName
used in setConfigFileSectionName(), initialize()
A structure that holds runtime class type information.
Definition: CObject.h:31
void setConfigFileSectionName(const std::string &sectName)
Defines the name of the section used in initialize()
mrpt::nav::CParameterizedTrajectoryGenerator * getAssociatedPTG() const
Returns the pointer set by setAssociatedPTG()



Page generated by Doxygen 1.8.14 for MRPT 1.9.9 Git: ae4571287 Thu Nov 23 00:06:53 2017 +0100 at dom oct 27 23:51:55 CET 2019