Main MRPT website > C++ reference for MRPT 1.9.9
CFixedIntervalsNRD.h
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 #ifndef CFIXEDINTERVALSNRD_H
11 #define CFIXEDINTERVALSNRD_H
12 
14 #include <mrpt/obs/CSensoryFrame.h>
18 
20 
21 namespace mrpt
22 {
23 namespace graphslam
24 {
25 namespace deciders
26 {
27 /**\brief Fixed Intervals Odometry-based Node Registration
28  *
29  * ## Description
30  *
31  * Determine whether to insert a new pose in the graph given the distance and
32  * angle thresholds. When the odometry readings indicate that any of the
33  * thresholds has been surpassed, with regards to the previous registered
34  * pose, a new node is added in the graph.
35  *
36  * Current decider is a minimal, simple implementation of the
37  * CNodeRegistrationDecider interface which can be used for 2D datasets.
38  * Decider *does not guarantee* thread safety when accessing the GRAPH_T
39  * resource. This is handled by the CGraphSlamEngine instance.
40  *
41  * ### Specifications
42  *
43  * - Map type: 2D
44  * - MRPT rawlog format: #1, #2
45  * - Graph Type: CPosePDFGaussianInf
46  * - Observations Used: CObservationOdometry, CActionRobotMovement2D
47  * - Node Registration Strategy: Fixed Odometry Intervals
48  *
49  * ### .ini Configuration Parameters
50  *
51  * \htmlinclude graphslam-engine_config_params_preamble.txt
52  *
53  * - \b class_verbosity
54  * + \a Section : NodeRegistrationDeciderParameters
55  * + \a Default value : 1 (mrpt::system::LVL_INFO)
56  * + \a Required : FALSE
57  *
58  * - \b registration_max_distance
59  * + \a Section : NodeRegistrationDeciderParameters
60  * + \a Default value : 0.5 // meters
61  * + \a Required : FALSE
62  *
63  * - \b registration_max_angle
64  * + \a Section : NodeRegistrationDeciderParameters
65  * + \a Default value : 60 // degrees
66  * + \a Required : FALSE
67  *
68  * \ingroup mrpt_graphslam_grp
69  */
70 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
73  GRAPH_T>
74 {
75  public:
76  // Public functions
77  //////////////////////////////////////////////////////////////
78 
79  /**\brief Handy typedefs */
80  /**\{*/
81  /**\brief Node Registration Decider */
82  using node_reg =
84 
85  /**\brief type of graph constraints */
86  using constraint_t = typename GRAPH_T::constraint_t;
87  /**\brief type of underlying poses (2D/3D). */
88  using pose_t = typename GRAPH_T::constraint_t::type_value;
89  using global_pose_t = typename GRAPH_T::global_pose_t;
90 
92  double, constraint_t::state_length, constraint_t::state_length>;
93  /**\brief Node Registration Decider */
94  using parent_t =
96  /**\}*/
97 
98  /**\brief Class constructor */
100  /**\brief Class destructor */
102 
103  void loadParams(const std::string& source_fname);
104  void printParams() const;
105  void getDescriptiveReport(std::string* report_str) const;
106 
107  /**\brief Method makes use of the CActionCollection/CObservation to update
108  * the
109  * odometry estimation from the last inserted pose
110  *
111  * \return True upon successful node registration in the graph
112  */
113  bool updateState(
115  mrpt::obs::CSensoryFrame::Ptr observations,
116  mrpt::obs::CObservation::Ptr observation);
117 
118  /**\brief Parameters structure for managing the relevant to the decider
119  * variables in a compact manner
120  */
122  {
123  public:
124  TParams();
125  ~TParams();
126 
127  void loadFromConfigFile(
129  const std::string& section);
130  void dumpToTextStream(std::ostream& out) const;
131  /**\brief Return a string with the configuration parameters
132  */
133  void getAsString(std::string* params_out) const;
134  std::string getAsString() const;
135 
136  // max values for new node registration
139  };
140 
141  // Public members
142  // ////////////////////////////
144 
145  protected:
146  // protected functions
147  //////////////////////////////////////////////////////////////
148  /**\name Registration Conditions Specifiers
149  */
150  /**\{ */
151  /**\brief If estimated position surpasses the registration max values since
152  * the previous registered node, register a new node in the graph.
153  *
154  * \return True on successful registration.
155  */
158  const mrpt::poses::CPose2D& p1, const mrpt::poses::CPose2D& p2) const;
160  const mrpt::poses::CPose3D& p1, const mrpt::poses::CPose3D& p2) const;
161  /**\} */
162 
163  // protected members
164  //////////////////////////////////////////////////////////////
165 
166  /**\brief pose_t estimation using only odometry information. Handy for
167  * observation-only rawlogs.
168  */
170  /**\brief pose_t estimation using only odometry information. Handy for
171  * observation-only rawlogs.
172  */
174  /**\brief Keep track of whether we are reading from an observation-only
175  * rawlog file or from an action-observation rawlog
176  */
178 };
179 } // namespace deciders
180 } // namespace graphslam
181 } // namespace mrpt
182 
183 #include "CFixedIntervalsNRD_impl.h"
184 #endif /* end of include guard: CFIXEDINTERVALSNRD_H */
mrpt::obs::CObservation::Ptr
std::shared_ptr< CObservation > Ptr
Definition: CObservation.h:45
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::getAsString
std::string getAsString() const
Definition: CFixedIntervalsNRD_impl.h:289
mrpt::graphslam::deciders::CNodeRegistrationDecider
Interface for implementing node registration classes.
Definition: CNodeRegistrationDecider.h:37
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::dumpToTextStream
void dumpToTextStream(std::ostream &out) const
This method should clearly display all the contents of the structure in textual form,...
Definition: CFixedIntervalsNRD_impl.h:245
mrpt::obs::CSensoryFrame::Ptr
std::shared_ptr< CSensoryFrame > Ptr
Definition: CSensoryFrame.h:56
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::registration_max_distance
double registration_max_distance
Definition: CFixedIntervalsNRD.h:137
mrpt::graphslam::deciders::CFixedIntervalsNRD::CFixedIntervalsNRD
CFixedIntervalsNRD()
Class constructor.
Definition: CFixedIntervalsNRD_impl.h:23
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams
Parameters structure for managing the relevant to the decider variables in a compact manner.
Definition: CFixedIntervalsNRD.h:121
mrpt
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
Definition: CKalmanFilterCapable.h:30
mrpt::graphslam::deciders::CFixedIntervalsNRD::params
TParams params
Definition: CFixedIntervalsNRD.h:143
CActionCollection.h
mrpt::graphslam::deciders::CFixedIntervalsNRD::pose_t
typename GRAPH_T::constraint_t::type_value pose_t
type of underlying poses (2D/3D).
Definition: CFixedIntervalsNRD.h:88
mrpt::graphslam::deciders::CFixedIntervalsNRD::updateState
bool updateState(mrpt::obs::CActionCollection::Ptr action, mrpt::obs::CSensoryFrame::Ptr observations, mrpt::obs::CObservation::Ptr observation)
Method makes use of the CActionCollection/CObservation to update the odometry estimation from the las...
Definition: CFixedIntervalsNRD_impl.h:37
mrpt::graphslam::deciders::CFixedIntervalsNRD
Fixed Intervals Odometry-based Node Registration.
Definition: CFixedIntervalsNRD.h:71
source
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
mrpt::graphslam::deciders::CFixedIntervalsNRD::getDescriptiveReport
void getDescriptiveReport(std::string *report_str) const
Fill the provided string with a detailed report of the decider/optimizer state.
Definition: CFixedIntervalsNRD_impl.h:194
mrpt::graphslam::deciders::CFixedIntervalsNRD::m_last_odometry_only_pose
pose_t m_last_odometry_only_pose
pose_t estimation using only odometry information.
Definition: CFixedIntervalsNRD.h:173
CConfigFileBase.h
mrpt::graphslam::deciders::CFixedIntervalsNRD::m_curr_odometry_only_pose
pose_t m_curr_odometry_only_pose
pose_t estimation using only odometry information.
Definition: CFixedIntervalsNRD.h:169
mrpt::graphslam::deciders::CFixedIntervalsNRD::global_pose_t
typename GRAPH_T::global_pose_t global_pose_t
Definition: CFixedIntervalsNRD.h:89
mrpt::config::CConfigFileBase
This class allows loading and storing values and vectors of different types from a configuration text...
Definition: config/CConfigFileBase.h:44
mrpt::graphslam::deciders::CFixedIntervalsNRD::m_observation_only_rawlog
bool m_observation_only_rawlog
Keep track of whether we are reading from an observation-only rawlog file or from an action-observati...
Definition: CFixedIntervalsNRD.h:177
mrpt::poses::CPose2D
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
Definition: CPose2D.h:40
mrpt::poses::CPose3D
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
Definition: CPose3D.h:88
mrpt::graphslam::deciders::CFixedIntervalsNRD::printParams
void printParams() const
Definition: CFixedIntervalsNRD_impl.h:184
mrpt::graphslam::deciders::CFixedIntervalsNRD::constraint_t
typename GRAPH_T::constraint_t constraint_t
type of graph constraints
Definition: CFixedIntervalsNRD.h:86
mrpt::config::CLoadableOptions
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
Definition: config/CLoadableOptions.h:28
CNodeRegistrationDecider.h
mrpt::math::CMatrixFixedNumeric< double, constraint_t::state_length, constraint_t::state_length >
CSensoryFrame.h
mrpt::graphslam::deciders::CFixedIntervalsNRD::checkRegistrationCondition
bool checkRegistrationCondition()
If estimated position surpasses the registration max values since the previous registered node,...
Definition: CFixedIntervalsNRD_impl.h:104
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::TParams
TParams()
Definition: CFixedIntervalsNRD_impl.h:237
CLoadableOptions.h
mrpt::graphslam::deciders::CFixedIntervalsNRD::~CFixedIntervalsNRD
~CFixedIntervalsNRD()
Class destructor.
Definition: CFixedIntervalsNRD_impl.h:29
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::registration_max_angle
double registration_max_angle
Definition: CFixedIntervalsNRD.h:138
string
GLsizei const GLchar ** string
Definition: glext.h:4101
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::loadFromConfigFile
void loadFromConfigFile(const mrpt::config::CConfigFileBase &source, const std::string &section)
This method load the options from a ".ini"-like file or memory-stored string list.
Definition: CFixedIntervalsNRD_impl.h:253
mrpt::obs::CActionCollection::Ptr
std::shared_ptr< CActionCollection > Ptr
Definition: CActionCollection.h:30
CObservationOdometry.h
CFixedIntervalsNRD_impl.h
mrpt::graphslam::deciders::CFixedIntervalsNRD::loadParams
void loadParams(const std::string &source_fname)
Load the necessary for the decider/optimizer configuration parameters.
Definition: CFixedIntervalsNRD_impl.h:165
mrpt::graphslam::deciders::CFixedIntervalsNRD::TParams::~TParams
~TParams()
Definition: CFixedIntervalsNRD_impl.h:241



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