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



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