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-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 }
CAbstractHolonomicReactiveMethod.h
mrpt::nav::CAbstractHolonomicReactiveMethod::getAssociatedPTG
mrpt::nav::CParameterizedTrajectoryGenerator * getAssociatedPTG() const
Returns the pointer set by setAssociatedPTG()
Definition: CAbstractHolonomicReactiveMethod.cpp:46
nav-precomp.h
IMPLEMENTS_VIRTUAL_SERIALIZABLE
IMPLEMENTS_VIRTUAL_SERIALIZABLE(CAbstractHolonomicReactiveMethod, CSerializable, mrpt::nav) CAbstractHolonomicReactiveMethod
Definition: CAbstractHolonomicReactiveMethod.cpp:18
mrpt::rtti::TRuntimeClassId
A structure that holds runtime class type information.
Definition: CObject.h:30
mrpt::rtti::registerAllPendingClasses
void registerAllPendingClasses()
Register all pending classes - to be called just before de-serializing an object, for example.
Definition: internal_class_registry.cpp:133
mrpt::nav::CAbstractHolonomicReactiveMethod::m_cfgSectionName
std::string m_cfgSectionName
used in setConfigFileSectionName(), initialize()
Definition: CAbstractHolonomicReactiveMethod.h:136
mrpt::nav
Definition: CAbstractHolonomicReactiveMethod.h:23
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::nav::CAbstractHolonomicReactiveMethod::NavInput::NavInput
NavInput()
Definition: CAbstractHolonomicReactiveMethod.cpp:73
mrpt::nav::CAbstractHolonomicReactiveMethod::Ptr
std::shared_ptr< CAbstractHolonomicReactiveMethod > Ptr
Definition: CAbstractHolonomicReactiveMethod.h:35
mrpt::nav::CAbstractHolonomicReactiveMethod
A base class for holonomic reactive navigation methods.
Definition: CAbstractHolonomicReactiveMethod.h:32
mrpt::nav::CAbstractHolonomicReactiveMethod::NavOutput::NavOutput
NavOutput()
Definition: CAbstractHolonomicReactiveMethod.cpp:78
mrpt::nav::CAbstractHolonomicReactiveMethod::Factory
static CAbstractHolonomicReactiveMethod::Ptr Factory(const std::string &className) noexcept
Definition: CAbstractHolonomicReactiveMethod.cpp:51
mrpt::rtti::TRuntimeClassId::createObject
mrpt::rtti::CObject * createObject() const
Definition: CObject.cpp:79
mrpt::nav::CAbstractHolonomicReactiveMethod::setAssociatedPTG
void setAssociatedPTG(mrpt::nav::CParameterizedTrajectoryGenerator *ptg)
Optionally, sets the associated PTG, just in case a derived class requires this info (not required fo...
Definition: CAbstractHolonomicReactiveMethod.cpp:40
mrpt::nav::CAbstractHolonomicReactiveMethod::setConfigFileSectionName
void setConfigFileSectionName(const std::string &sectName)
Defines the name of the section used in initialize()
Definition: CAbstractHolonomicReactiveMethod.cpp:30
mrpt::nav::CAbstractHolonomicReactiveMethod::CAbstractHolonomicReactiveMethod
CAbstractHolonomicReactiveMethod(const std::string &defaultCfgSectionName)
ctor
mrpt::nav::CAbstractHolonomicReactiveMethod::m_associatedPTG
mrpt::nav::CParameterizedTrajectoryGenerator * m_associatedPTG
If applicable, this will contain the argument of the most recent call to setAssociatedPTG()
Definition: CAbstractHolonomicReactiveMethod.h:130
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::nav::CAbstractHolonomicReactiveMethod::getConfigFileSectionName
std::string getConfigFileSectionName() const
Gets the name of the section used in initialize()
Definition: CAbstractHolonomicReactiveMethod.cpp:35
CArchive.h
mrpt::nav::CParameterizedTrajectoryGenerator
This is the base class for any user-defined PTG.
Definition: CParameterizedTrajectoryGenerator.h:76
mrpt::rtti::findRegisteredClass
const TRuntimeClassId * findRegisteredClass(const std::string &className)
Return info about a given class by its name, or nullptr if the class is not registered.
Definition: internal_class_registry.cpp:202



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST