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



Page generated by Doxygen 1.8.14 for MRPT 2.0.0 Git: b38439d21 Tue Mar 31 19:58:06 2020 +0200 at miƩ abr 1 00:50:30 CEST 2020