MRPT  1.9.9
TUncertaintyPath.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 TUNCERTAINTYPATH_H
11 #define TUNCERTAINTYPATH_H
12 
15 
16 #include <string>
17 
18 namespace mrpt::graphslam
19 {
20 /**\brief Holds the data of an information path.
21  *
22  * Path comprises of nodes (TNodeID type) and constraints between them.
23  * Only consecutive nodes are connected by edges, thus \em path.
24  *
25  * \sa mrpt::deciders::CLoopCloserERD
26  * \ingroup mrpt_graphslam_grp
27  */
28 template <class GRAPH_T = typename mrpt::graphs::CNetworkOfPoses2DInf>
30 {
31  /**\brief Handy typedefs */
32  /**\{*/
33  /**\brief type of graph constraints */
34  using constraint_t = typename GRAPH_T::constraint_t;
35  /**\brief type of underlying poses (2D/3D). */
36  using pose_t = typename constraint_t::type_value;
38  /**\}*/
39 
40  // methods
41  // ////////////////////////////
43  TUncertaintyPath(const mrpt::graphs::TNodeID& starting_node);
45  const mrpt::graphs::TNodeID& starting_node,
46  const mrpt::graphs::TNodeID& ending_node, const constraint_t& edge);
48  void clear();
49  /**\return True if it is indeed empty.
50  */
51  bool isEmpty() const;
52  /**\brief Assert that the current path is between the given nodeIDs.
53  *
54  * Call to this method practically checks if the give nodes match the source
55  * and destination nodeIDs.
56  *
57  * \note Assertions will be executed only in \b Debug builds
58  *
59  * \exception std::runtime_error in case the conditions don't hold
60  */
62  const mrpt::graphs::TNodeID& from,
63  const mrpt::graphs::TNodeID& to) const;
64 
65  // no need to load anything..
66  void loadFromConfigFile(
68  const std::string& section);
69  void dumpToTextStream(std::ostream& out) const;
70  std::string getAsString() const;
71  void getAsString(std::string* str) const;
72 
73  /**\brief Return the source node of this path */
74  const mrpt::graphs::TNodeID& getSource() const;
75  /**\brief Return the Destination node of this path */
77  double getDeterminant();
78  /**\brief Test if the current path has a lower uncertainty than the other
79  * path.
80  *
81  * \return True if the current path does have a lower uncertainty
82  */
83  bool hasLowerUncertaintyThan(const self_t& other) const;
84  /**\brief add a new link in the current path.
85  *
86  * Add the node that the path traverses and the information matrix of
87  * the extra link
88  */
89  void addToPath(const mrpt::graphs::TNodeID& node, const constraint_t& edge);
90  self_t& operator+=(const self_t& other);
91  // results...
92  bool operator==(const self_t& other) const;
93  bool operator!=(const self_t& other) const;
94 
95  friend std::ostream& operator<<(std::ostream& o, const self_t& obj)
96  {
97  o << obj.getAsString() << endl;
98  return o;
99  }
100 
101  /**\brief Nodes that the Path comprises of.
102  *
103  * Nodes in the path are added to the end of the vector.
104  */
105  std::vector<mrpt::graphs::TNodeID> nodes_traversed;
106  /**\brief Current path position + corresponding covariance */
108 
109  /**Determine whether the determinant of the Path is up-to-date and
110  * can be directly fetched or has to be computed again */
111  /**\{*/
114  /**\}*/
115 };
116 }
117 #include "TUncertaintyPath_impl.h"
118 
119 #endif /* end of include guard: TUNCERTAINTYPATH_H */
120 
121 
const mrpt::graphs::TNodeID & getSource() const
Return the source node of this path.
bool determinant_is_updated
Determine whether the determinant of the Path is up-to-date and can be directly fetched or has to be ...
Holds the data of an information path.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...
typename constraint_t::type_value pose_t
type of underlying poses (2D/3D).
GLsizei GLsizei GLuint * obj
Definition: glext.h:4070
const mrpt::graphs::TNodeID & getDestination() const
Return the Destination node of this path.
SLAM methods related to graphs of pose constraints.
This class allows loading and storing values and vectors of different types from a configuration text...
constraint_t curr_pose_pdf
Current path position + corresponding covariance.
friend std::ostream & operator<<(std::ostream &o, const self_t &obj)
GLsizei const GLchar ** string
Definition: glext.h:4101
bool hasLowerUncertaintyThan(const self_t &other) const
Test if the current path has a lower uncertainty than the other path.
void addToPath(const mrpt::graphs::TNodeID &node, const constraint_t &edge)
add a new link in the current path.
bool operator==(const self_t &other) const
bool operator!=(const self_t &other) const
GLsizei GLsizei GLchar * source
Definition: glext.h:4082
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.
uint64_t TNodeID
A generic numeric type for unique IDs of nodes or entities.
Definition: TNodeID.h:16
self_t & operator+=(const self_t &other)
std::vector< mrpt::graphs::TNodeID > nodes_traversed
Nodes that the Path comprises of.
void assertIsBetweenNodeIDs(const mrpt::graphs::TNodeID &from, const mrpt::graphs::TNodeID &to) const
Assert that the current path is between the given nodeIDs.
typename GRAPH_T::constraint_t constraint_t
Handy typedefs.
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.



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