Main MRPT website > C++ reference for MRPT 1.5.6
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-2016, 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 
13 
15 #include <mrpt/math/CMatrix.h>
16 #include <mrpt/math/data_utils.h>
20 #include <mrpt/poses/CPose2D.h>
21 #include <mrpt/poses/CPose3D.h>
23 
24 #include <string>
25 #include <sstream>
26 
27 namespace mrpt { namespace graphslam {
28 
29 /**\brief Holds the data of an information path.
30  *
31  * Path comprises of nodes (TNodeID type) and constraints between them.
32  * Only consecutive nodes are connected by edges, thus \em path.
33  *
34  * \sa mrpt::deciders::CLoopCloserERD
35  * \ingroup mrpt_graphslam_grp
36  */
37 template<class GRAPH_T=typename mrpt::graphs::CNetworkOfPoses2DInf>
39  /**\brief Handy typedefs */
40  /**\{*/
41  /**\brief type of graph constraints */
42  typedef typename GRAPH_T::constraint_t constraint_t;
43  /**\brief type of underlying poses (2D/3D). */
44  typedef typename constraint_t::type_value pose_t;
46  /**\}*/
47 
48  // methods
49  // ////////////////////////////
51  TUncertaintyPath(const mrpt::utils::TNodeID& starting_node);
53  const mrpt::utils::TNodeID& starting_node,
54  const mrpt::utils::TNodeID& ending_node,
55  const constraint_t& edge);
57  void clear();
58  /**\return True if it is indeed empty.
59  */
60  bool isEmpty() const;
61  /**\brief Assert that the current path is between the given nodeIDs.
62  *
63  * Call to this method practically checks if the give nodes match the source
64  * and destination nodeIDs.
65  *
66  * \exception std::runtime_error in case the conditions don't hold
67  */
69  const mrpt::utils::TNodeID& from,
70  const mrpt::utils::TNodeID& to) const;
71 
72  // no need to load anything..
73  void loadFromConfigFile(
75  const std::string &section);
76  void dumpToTextStream(mrpt::utils::CStream &out) const;
77  std::string getAsString() const;
78  void getAsString(std::string* str) const;
79 
80  /**\brief Return the source node of this path */
81  const mrpt::utils::TNodeID& getSource() const;
82  /**\brief Return the Destination node of this path */
83  const mrpt::utils::TNodeID& getDestination() const;
84  double getDeterminant();
85  /**\brief Test if the current path has a lower uncertainty than the other
86  * path.
87  *
88  * \return True if the current path does have a lower uncertainty
89  */
91  const self_t& other) const;
92  /**\brief add a new link in the current path.
93  *
94  * Add the node that the path traverses and the information matrix of
95  * the extra link
96  */
97  void addToPath(
98  const mrpt::utils::TNodeID& node,
99  const constraint_t& edge);
101  const self_t& other);
102  // results...
103  bool operator==(const self_t& other) const;
104  bool operator!=(const self_t& other) const;
105 
106  friend std::ostream& operator<<(std::ostream& o, const self_t& obj) {
107  o << obj.getAsString() << endl;
108  return o;
109  }
110 
111  /**\brief Nodes that the Path comprises of.
112  *
113  * Nodes in the path are added to the end of the vector.
114  */
115  std::vector<mrpt::utils::TNodeID> nodes_traversed;
116  /**\brief Current path position + corresponding covariance */
118 
119  /**Determine whether the determinant of the Path is up-to-date and
120  * can be directly fetched or has to be computed again */
121  /**\{*/
124  /**\}*/
125 
126 };
127 
128 } } // end of namespaces
129 
130 #include "TUncertaintyPath_impl.h"
131 
132 #endif /* end of include guard: TUNCERTAINTYPATH_H */
bool determinant_is_updated
Determine whether the determinant of the Path is up-to-date and can be directly fetched or has to be ...
std::vector< mrpt::utils::TNodeID > nodes_traversed
Nodes that the Path comprises of.
Holds the data of an information path.
void addToPath(const mrpt::utils::TNodeID &node, const constraint_t &edge)
add a new link in the current path.
GLsizei GLsizei GLuint * obj
Definition: glext.h:3902
This class allows loading and storing values and vectors of different types from a configuration text...
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
Definition: CStream.h:38
TUncertaintyPath< GRAPH_T > self_t
uint64_t TNodeID
The type for node IDs in graphs of different types.
constraint_t curr_pose_pdf
Current path position + corresponding covariance.
constraint_t::type_value pose_t
type of underlying poses (2D/3D).
friend std::ostream & operator<<(std::ostream &o, const self_t &obj)
GLsizei const GLchar ** string
Definition: glext.h:3919
bool hasLowerUncertaintyThan(const self_t &other) const
Test if the current path has a lower uncertainty than the other path.
void assertIsBetweenNodeIDs(const mrpt::utils::TNodeID &from, const mrpt::utils::TNodeID &to) const
Assert that the current path is between the given nodeIDs.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void dumpToTextStream(mrpt::utils::CStream &out) const
This method should clearly display all the contents of the structure in textual form, sending it to a CStream.
void loadFromConfigFile(const mrpt::utils::CConfigFileBase &source, const std::string &section)
This method load the options from a ".ini"-like file or memory-stored string list.
bool operator==(const self_t &other) const
bool operator!=(const self_t &other) const
const mrpt::utils::TNodeID & getSource() const
Return the source node of this path.
GLsizei GLsizei GLchar * source
Definition: glext.h:3908
self_t & operator+=(const self_t &other)
GRAPH_T::constraint_t constraint_t
Handy typedefs.
const mrpt::utils::TNodeID & getDestination() const
Return the Destination node of this path.
This is a virtual base class for sets of options than can be loaded from and/or saved to configuratio...



Page generated by Doxygen 1.8.14 for MRPT 1.5.6 Git: 4c65e8431 Tue Apr 24 08:18:17 2018 +0200 at lun oct 28 01:35:26 CET 2019