MRPT  2.0.2
CAbstractHolonomicReactiveMethod.cpp
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://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() = default;
29 /** Defines the name of the section (Default: "FULL_EVAL_CONFIG") */
30 void CAbstractHolonomicReactiveMethod::setConfigFileSectionName(
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  classId->createObject());
65  }
66  catch (...)
67  {
69  }
70 }
71 
74 
75  = default;
std::shared_ptr< CObject > createObject() const
Definition: CObject.cpp:79
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:31
CAbstractHolonomicReactiveMethod(const std::string &defaultCfgSectionName)
ctor
This is the base class for any user-defined PTG.
std::shared_ptr< CAbstractHolonomicReactiveMethod > Ptr
const TRuntimeClassId * findRegisteredClass(const std::string &className, const bool allow_ignore_namespace=true)
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()
static CAST_TO::Ptr from(const CAST_FROM_PTR &ptr)
Definition: CObject.h:356
std::string m_cfgSectionName
used in setConfigFileSectionName(), initialize()
mrpt::nav::CParameterizedTrajectoryGenerator * getAssociatedPTG() const
Returns the pointer set by setAssociatedPTG()



Page generated by Doxygen 1.8.14 for MRPT 2.0.2 Git: 9b4fd2465 Mon May 4 16:59:08 2020 +0200 at lun may 4 17:26:07 CEST 2020