Go to the documentation of this file.
9 #ifndef CONSTRAINED_POSE_NETWORK_H
10 #define CONSTRAINED_POSE_NETWORK_H
103 typedef typename MAPS_IMPLEMENTATION::template map<mrpt::utils::TNodeID,global_pose_t>
global_poses_t;
149 inline void loadFromTextFile(
const std::string &fileName,
bool collapse_dup_edges =
true ) {
198 ASSERTMSG_(itEdge!=
BASE::edges.
end(),
format(
"Request for edge %u->%u that doesn't exist in graph.",
static_cast<unsigned int>(from_id),
static_cast<unsigned int>(to_id)));
228 template <
class CPOSE,
class MAPS_IMPLEMENTATION,
class NODE_ANNOTATIONS,
class EDGE_ANNOTATIONS>
237 template <
class CPOSE,
class MAPS_IMPLEMENTATION,
class NODE_ANNOTATIONS,
class EDGE_ANNOTATIONS>
265 class MAPS_IMPLEMENTATION,
266 class NODE_ANNOTATIONS,
267 class EDGE_ANNOTATIONS
273 return std::string(
"mrpt::graphs::CNetworkOfPoses<")
#define MRPT_DECLARE_TTYPENAME(_TYPE)
A directed graph with the argument of the template specifying the type of the annotations in the edge...
#define ASSERTMSG_(f, __ERROR_MSG)
global_poses_t nodes
The nodes (vertices) of the graph, with their estimated "global" (with respect to root) position,...
global_pose_t(const ARG1 &a1, const ARG2 &a2)
bool edges_store_inverse_poses
False (default) if an edge i->j stores the normal relative pose of j as seen from i: True if an edge...
Traits for using a mrpt::utils::map_as_vector<> (dense, fastest representation)
size_t collapseDuplicatedEdges()
Look for duplicated edges (even in opposite directions) between all pairs of nodes and fuse them.
void dijkstra_nodes_estimate()
Spanning tree computation of a simple estimation of the global coordinates of each node just from the...
size_t nodeCount() const
Return number of nodes in the list \nodes of global coordinates (may be differente that all nodes app...
CNetworkOfPoses< mrpt::poses::CPosePDFGaussian, mrpt::utils::map_traits_stdmap > CNetworkOfPoses2DCov
The specialization of CNetworkOfPoses for poses of type CPosePDFGaussian, also implementing serializa...
mrpt::utils::TNodeID root
The ID of the node that is the origin of coordinates, used as reference by all coordinates in \nodes.
Traits for using a std::map<> (sparse representation)
static void read_graph_of_poses_from_binary_file(graph_t *g, mrpt::utils::CStream &in)
CPOSE constraint_t
The type of PDF poses in the contraints (edges) (=CPOSE template argument)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
edges_map_t edges
The public member with the directed edges in the graph.
CNetworkOfPoses< mrpt::poses::CPose3D, mrpt::utils::map_traits_stdmap > CNetworkOfPoses3D
The specialization of CNetworkOfPoses for poses of type mrpt::poses::CPose3D (not a PDF!...
double getEdgeSquareError(const typename BASE::edges_map_t::const_iterator &itEdge, bool ignoreCovariances=true) const
Computes the square error of one pose constraints (edge) with respect to the global poses in \nodes I...
static double graph_edge_sqerror(const graph_t *g, const typename mrpt::graphs::CDirectedGraph< typename graph_t::constraint_t >::edges_map_t::const_iterator &itEdge, bool ignoreCovariances)
The type of each global pose in nodes: an extension of the constraint_no_pdf_t pose with any optional...
MAPS_IMPLEMENTATION maps_implementation_t
The type of map's implementation (=MAPS_IMPLEMENTATION template argument)
CNetworkOfPoses()
Default constructor (just sets root to "0" and edges_store_inverse_poses to "false")
a helper struct with static template functions
static void load_graph_of_poses_from_text_file(graph_t *g, const std::string &fil)
This base class is used to provide a unified interface to files,memory buffers,..Please see the deriv...
static void save_graph_of_poses_to_binary_file(const graph_t *g, mrpt::utils::CStream &out)
mrpt::utils::CStream & operator>>(mrpt::utils::CStream &in, CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS > &obj)
Binary serialization (read) operator "stream >> graph".
CNetworkOfPoses< mrpt::poses::CPose2D, mrpt::utils::map_traits_stdmap > CNetworkOfPoses2D
The specialization of CNetworkOfPoses for poses of type CPose2D (not a PDF!), also implementing seria...
MAPS_IMPLEMENTATION::template map< mrpt::utils::TNodeID, CPOSE > global_poses_pdf_t
A map from pose IDs to their global coordinates estimates, with uncertainty.
static size_t graph_of_poses_collapse_dup_edges(graph_t *g)
void saveToTextFile(const std::string &fileName) const
Saves to a text file in the format used by TORO & HoG-man (more on the format here ) For 2D graphs on...
static void graph_of_poses_dijkstra_init(graph_t *g)
NODE_ANNOTATIONS node_annotations_t
The extra annotations in nodes, apart from a constraint_no_pdf_t.
CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS > self_t
My own type.
void clear()
Empty all edges, nodes and set root to ID 0.
double getGlobalSquareError(bool ignoreCovariances=true) const
Computes the overall square error from all the pose constraints (edges) with respect to the global po...
static void save_graph_of_poses_to_text_file(const graph_t *g, const std::string &fil)
uint64_t TNodeID
The type for node IDs in graphs of different types.
A directed graph of pose constraints, with edges being the relative pose between pairs of nodes inden...
mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS > BASE
The base class "CDirectedGraph<CPOSE,EDGE_ANNOTATIONS>" */.
CPOSE::type_value constraint_no_pdf_t
The type of edges or their means if they are PDFs (that is, a simple "edge" value)
double getEdgeSquareError(const mrpt::utils::TNodeID from_id, const mrpt::utils::TNodeID to_id, bool ignoreCovariances=true) const
Computes the square error of one pose constraints (edge) with respect to the global poses in \nodes I...
EDGE_ANNOTATIONS edge_annotations_t
The extra annotations in edges, apart from a constraint_t.
mrpt::utils::CStream & operator<<(mrpt::utils::CStream &out, const CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS > &obj)
Binary serialization (write) operator "stream << graph".
CNetworkOfPoses< mrpt::poses::CPose3DPDFGaussianInf, mrpt::utils::map_traits_stdmap > CNetworkOfPoses3DInf
The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussianInf, also implementing seri...
CNetworkOfPoses< mrpt::poses::CPosePDFGaussianInf, mrpt::utils::map_traits_stdmap > CNetworkOfPoses2DInf
The specialization of CNetworkOfPoses for poses of type CPosePDFGaussianInf, also implementing serial...
CNetworkOfPoses< mrpt::poses::CPose3DPDFGaussian, mrpt::utils::map_traits_stdmap > CNetworkOfPoses3DCov
The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussian, also implementing seriali...
global_pose_t(const ARG1 &a1)
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
void loadFromTextFile(const std::string &fileName, bool collapse_dup_edges=true)
Loads from a text file in the format used by TORO & HoG-man (more on the format here ) Recognized lin...
edges_map_t::const_iterator const_iterator
A template to obtain the type of its argument as a string at compile time.
MAPS_IMPLEMENTATION::template map< mrpt::utils::TNodeID, global_pose_t > global_poses_t
A map from pose IDs to their global coordinates estimates, without uncertainty (the "most-likely valu...
Page generated by Doxygen 1.8.17 for MRPT 1.4.0 SVN: at Sat Jan 18 22:37:07 UTC 2020 | | |