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-2018, 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 
14 
15 using namespace mrpt;
16 using namespace mrpt::nav;
17 
20 
22  const std::string& defaultCfgSectionName)
23  : m_associatedPTG(nullptr),
24  m_enableApproachTargetSlowDown(true),
25  m_cfgSectionName(defaultCfgSectionName)
26 {
27 }
28 CAbstractHolonomicReactiveMethod::~CAbstractHolonomicReactiveMethod() {}
29 /** Defines the name of the section (Default: "FULL_EVAL_CONFIG") */
31  const std::string& sectName)
32 {
33  m_cfgSectionName = sectName;
34 }
36 {
37  return m_cfgSectionName;
38 }
39 
42 {
43  m_associatedPTG = ptg;
44 }
47 {
48  return m_associatedPTG;
49 }
50 
52  const std::string& className) noexcept
53 {
54  try
55  {
57 
58  // Factory:
59  const mrpt::rtti::TRuntimeClassId* classId =
61  if (!classId) return nullptr;
62 
64  dynamic_cast<CAbstractHolonomicReactiveMethod*>(
65  classId->createObject()));
66  }
67  catch (...)
68  {
69  return nullptr;
70  }
71 }
72 
74  : targets(), maxRobotSpeed(1.0), maxObstacleDist(1.0), clearance(nullptr)
75 {
76 }
77 
79  : desiredDirection(0), desiredSpeed(0)
80 {
81 }
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.
A structure that holds runtime class type information.
Definition: CObject.h:30
CAbstractHolonomicReactiveMethod(const std::string &defaultCfgSectionName)
ctor
This is the base class for any user-defined PTG.
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()
mrpt::rtti::CObject * createObject() const
Definition: CObject.cpp:79
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: 7d5e6d718 Fri Aug 24 01:51:28 2018 +0200 at lun nov 2 08:35:50 CET 2020