Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Static Private Member Functions
mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS > Class Template Reference

Detailed Description

template<class CPOSE, class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
class mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >

A directed graph of pose constraints, with edges being the relative poses between pairs of nodes identified by their numeric IDs (of type mrpt::graphs::TNodeID).

A link or edge between two nodes "i" and "j", that is, the pose $ p_{ij} *$, holds the relative position of "j" with respect to "i". These poses are stored in the edges in the format specified by the template argument CPOSE. Users should employ the following derived classes depending on the desired representation of edges:

Two main members store all the information in this class:

Graphs can be loaded and saved to text file in the format used by TORO & HoG-man (more on the format here), using loadFromTextFile and saveToTextFile.

This class is the base for representing networks of poses, which are the main data type of a series of SLAM algorithms implemented in the library mrpt-slam, in the namespace mrpt::graphslam.

The template arguments are:

See also
mrpt::graphslam

Definition at line 122 of file CNetworkOfPoses.h.

#include <mrpt/graphs/CNetworkOfPoses.h>

Inheritance diagram for mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >:
Inheritance graph

Classes

struct  global_pose_t
 The type of each global pose in nodes: an extension of the constraint_no_pdf_t pose with any optional user-defined data. More...
 

Public Types

using edges_map_t = mrpt::aligned_std_multimap< TPairNodeIDs, edge_t >
 The type of the member edges. More...
 
using iterator = typename edges_map_t::iterator
 
using reverse_iterator = typename edges_map_t::reverse_iterator
 
using const_iterator = typename edges_map_t::const_iterator
 
using const_reverse_iterator = typename edges_map_t::const_reverse_iterator
 

Public Member Functions

iterator begin ()
 
const_iterator begin () const
 
iterator rbegin ()
 
const_iterator rbegin () const
 
iterator end ()
 
const_iterator end () const
 
iterator rend ()
 
const_iterator rend () const
 
Edges/nodes utility methods
size_t edgeCount () const
 The number of edges in the graph. More...
 
void clearEdges ()
 Erase all edges. More...
 
void insertEdge (TNodeID from_nodeID, TNodeID to_nodeID, const edge_t &edge_value)
 Insert an edge (from -> to) with the given edge value. More...
 
void insertEdgeAtEnd (TNodeID from_nodeID, TNodeID to_nodeID, const edge_t &edge_value)
 Insert an edge (from -> to) with the given edge value (more efficient version to be called if you know that the end will go at the end of the sorted std::multimap). More...
 
bool edgeExists (TNodeID from_nodeID, TNodeID to_nodeID) const
 Test if the given directed edge exists. More...
 
edge_t & getEdge (TNodeID from_nodeID, TNodeID to_nodeID)
 Return a reference to the content of a given edge. More...
 
const edge_t & getEdge (TNodeID from_nodeID, TNodeID to_nodeID) const
 Return a reference to the content of a given edge. More...
 
std::pair< iterator, iteratorgetEdges (TNodeID from_nodeID, TNodeID to_nodeID)
 Return a pair<first,last> of iterators to the range of edges between two given nodes. More...
 
std::pair< const_iterator, const_iteratorgetEdges (TNodeID from_nodeID, TNodeID to_nodeID) const
 Return a pair<first,last> of const iterators to the range of edges between two given nodes. More...
 
void eraseEdge (TNodeID from_nodeID, TNodeID to_nodeID)
 Erase all edges between the given nodes (it has no effect if no edge existed) More...
 
void getAllNodes (std::set< TNodeID > &lstNode_IDs) const
 Return a list of all the node_ID's of the graph, generated from all the nodes that appear in the list of edges. More...
 
std::set< TNodeIDgetAllNodes () const
 Less efficient way to get all nodes that returns a copy of the set object. More...
 
size_t countDifferentNodesInEdges () const
 Count how many different node IDs appear in the graph edges. More...
 
void getNeighborsOf (const TNodeID nodeID, std::set< TNodeID > &neighborIDs) const
 Return the list of all neighbors of "nodeID", by creating a list of their node IDs. More...
 
std::set< TNodeIDgetNeighborsOf (const TNodeID nodeID) const
 Return the list of all neighbors of "nodeID", by creating a list of their node IDs. More...
 
void getAdjacencyMatrix (MAP_NODEID_SET_NODEIDS &outAdjacency) const
 Return a map from node IDs to all its neighbors (that is, connected nodes, regardless of the edge direction) This is a much more efficient method than calling getNeighborsOf() for each node in the graph. More...
 
void getAdjacencyMatrix (MAP_NODEID_SET_NODEIDS &outAdjacency, const SET_NODEIDS &onlyForTheseNodes) const
 Just like getAdjacencyMatrix but return only the adjacency for those node_ids in the set onlyForTheseNodes (both endings nodes of an edge must be within the set for it to be returned) More...
 
I/O utilities
bool saveAsDot (std::ostream &o, const TGraphvizExportParams &p=TGraphvizExportParams()) const
 Save the graph in a Graphviz (.dot files) text format; useful for quickly rendering the graph with "dot". More...
 
bool saveAsDot (const std::string &fileName, const TGraphvizExportParams &p=TGraphvizExportParams()) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
I/O file methods
void saveToTextFile (const std::string &fileName) const
 Saves to a text file in the format used by TORO & HoG-man (more on the format <a href="http://www.mrpt.org/Robotics_file_formats" * >here) For 2D graphs only VERTEX2 & EDGE2 entries will be saved, and VERTEX3 & EDGE3 entries for 3D graphs. More...
 
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 line entries are: VERTEX2, VERTEX3, EDGE2, EDGE3, EQUIV. More...
 
Edges/nodes utility methods
size_t edgeCount () const
 The number of edges in the graph. More...
 
void clearEdges ()
 Erase all edges. More...
 
void insertEdge (TNodeID from_nodeID, TNodeID to_nodeID, const edge_t &edge_value)
 Insert an edge (from -> to) with the given edge value. More...
 
void insertEdgeAtEnd (TNodeID from_nodeID, TNodeID to_nodeID, const edge_t &edge_value)
 Insert an edge (from -> to) with the given edge value (more efficient version to be called if you know that the end will go at the end of the sorted std::multimap). More...
 
bool edgeExists (TNodeID from_nodeID, TNodeID to_nodeID) const
 Test if the given directed edge exists. More...
 
edge_t & getEdge (TNodeID from_nodeID, TNodeID to_nodeID)
 Return a reference to the content of a given edge. More...
 
const edge_t & getEdge (TNodeID from_nodeID, TNodeID to_nodeID) const
 Return a reference to the content of a given edge. More...
 
std::pair< iterator, iteratorgetEdges (TNodeID from_nodeID, TNodeID to_nodeID)
 Return a pair<first,last> of iterators to the range of edges between two given nodes. More...
 
std::pair< const_iterator, const_iteratorgetEdges (TNodeID from_nodeID, TNodeID to_nodeID) const
 Return a pair<first,last> of const iterators to the range of edges between two given nodes. More...
 
void eraseEdge (TNodeID from_nodeID, TNodeID to_nodeID)
 Erase all edges between the given nodes (it has no effect if no edge existed) More...
 
void getAllNodes (std::set< TNodeID > &lstNode_IDs) const
 Return a list of all the node_ID's of the graph, generated from all the nodes that appear in the list of edges. More...
 
std::set< TNodeIDgetAllNodes () const
 Less efficient way to get all nodes that returns a copy of the set object. More...
 
size_t countDifferentNodesInEdges () const
 Count how many different node IDs appear in the graph edges. More...
 
void getNeighborsOf (const TNodeID nodeID, std::set< TNodeID > &neighborIDs) const
 Return the list of all neighbors of "nodeID", by creating a list of their node IDs. More...
 
std::set< TNodeIDgetNeighborsOf (const TNodeID nodeID) const
 Return the list of all neighbors of "nodeID", by creating a list of their node IDs. More...
 
void getAdjacencyMatrix (MAP_NODEID_SET_NODEIDS &outAdjacency) const
 Return a map from node IDs to all its neighbors (that is, connected nodes, regardless of the edge direction) This is a much more efficient method than calling getNeighborsOf() for each node in the graph. More...
 
void getAdjacencyMatrix (MAP_NODEID_SET_NODEIDS &outAdjacency, const SET_NODEIDS &onlyForTheseNodes) const
 Just like getAdjacencyMatrix but return only the adjacency for those node_ids in the set onlyForTheseNodes (both endings nodes of an edge must be within the set for it to be returned) More...
 
I/O utilities
bool saveAsDot (std::ostream &o, const TGraphvizExportParams &p=TGraphvizExportParams()) const
 Save the graph in a Graphviz (.dot files) text format; useful for quickly rendering the graph with "dot". More...
 
bool saveAsDot (const std::string &fileName, const TGraphvizExportParams &p=TGraphvizExportParams()) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 

Public Attributes

edges_map_t edges
 The public member with the directed edges in the graph. More...
 
Data members
global_poses_t nodes
 The nodes (vertices) of the graph, with their estimated "global" (with respect to root) position, without an associated covariance. More...
 
mrpt::graphs::TNodeID root {0}
 The ID of the node that is the origin of coordinates, used as reference by all coordinates in nodes. More...
 
bool edges_store_inverse_poses {false}
 False (default) if an edge i->j stores the normal relative pose of j as seen from i: $ \Delta_i^j = j \ominus i $ True if an edge i->j stores the inverse relateive pose, that is, i as seen from j: $ \Delta_i^j = i \ominus j $. More...
 

Static Private Member Functions

static void addVirtualEdge (self_t *graph, const TNodeID &from, const TNodeID &to)
 Add a virtual edge between two nodes in the given graph. More...
 

Typedef's

using BASE = mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >
 The base class "CDirectedGraph<CPOSE,EDGE_ANNOTATIONS>". More...
 
using self_t = CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >
 My own type. More...
 
using constraint_t = CPOSE
 The type of PDF poses in the contraints (edges) (=CPOSE template argument) More...
 
using node_annotations_t = NODE_ANNOTATIONS
 The extra annotations in nodes, apart from a constraint_no_pdf_t. More...
 
using edge_annotations_t = EDGE_ANNOTATIONS
 The extra annotations in edges, apart from a constraint_t. More...
 
using maps_implementation_t = MAPS_IMPLEMENTATION
 The type of map's implementation (=MAPS_IMPLEMENTATION template argument) More...
 
using constraint_no_pdf_t = typename CPOSE::type_value
 The type of edges or their means if they are PDFs (that is, a simple "edge" value) More...
 
using global_poses_pdf_t = typename MAPS_IMPLEMENTATION::template map< mrpt::graphs::TNodeID, CPOSE >
 A map from pose IDs to their global coordinate estimates, with uncertainty. More...
 
using global_poses_t = typename MAPS_IMPLEMENTATION::template map< mrpt::graphs::TNodeID, global_pose_t >
 A map from pose IDs to their global coordinate estimates, without uncertainty (the "most-likely value") More...
 
constexpr static auto getClassName ()
 

Utility methods

static void connectGraphPartitions (self_t *sub_graph, const std::set< TNodeID > &groupA, const std::set< TNodeID > &groupB)
 Add an edge between the last node of the group with the lower nodeIDs and the first node of the higher nodeIDs. More...
 
void getAs3DObject (mrpt::opengl::CSetOfObjects::Ptr object, const mrpt::system::TParametersDouble &viz_params) const
 Return 3D Visual Representation of the edges and nodes in the network of poses. More...
 
void dijkstra_nodes_estimate ()
 Spanning tree computation of a simple estimation of the global coordinates of each node just from the information in all edges, sorted in a Dijkstra tree based on the current "root" node. More...
 
size_t collapseDuplicatedEdges ()
 Look for duplicated edges (even in opposite directions) between all pairs of nodes and fuse them. More...
 
double getGlobalSquareError (bool ignoreCovariances=true) const
 Computes the overall square error from all the pose constraints (edges) with respect to the global poses in nodes If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error. More...
 
void extractSubGraph (const std::set< TNodeID > &node_IDs, self_t *sub_graph, const TNodeID root_node_in=INVALID_NODEID, const bool &auto_expand_set=true) const
 Find the edges between the nodes in the node_IDs set and fill given graph pointer accordingly. More...
 
void mergeGraph (const self_t &other, const typename std::vector< detail::THypothesis< self_t >> &common_hypots, const bool hypots_from_other_to_self=true, std::map< TNodeID, TNodeID > *old_to_new_nodeID_mappings_out=NULL)
 Integrate given graph into own graph using the list of provided common THypotheses. More...
 
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 If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error. More...
 
double getEdgeSquareError (const mrpt::graphs::TNodeID from_id, const mrpt::graphs::TNodeID to_id, bool ignoreCovariances=true) const
 Computes the square error of one pose constraints (edge) with respect to the global poses in nodes If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error. More...
 
void clear ()
 Empty all edges, nodes and set root to ID 0. More...
 
size_t nodeCount () const
 Return number of nodes in the list nodes of global coordinates (may be different that all nodes appearing in edges) More...
 

Member Typedef Documentation

◆ BASE

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::BASE = mrpt::graphs::CDirectedGraph<CPOSE, EDGE_ANNOTATIONS>

The base class "CDirectedGraph<CPOSE,EDGE_ANNOTATIONS>".

Definition at line 129 of file CNetworkOfPoses.h.

◆ const_iterator

using mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::const_iterator = typename edges_map_t::const_iterator
inherited

Definition at line 94 of file CDirectedGraph.h.

◆ const_reverse_iterator

using mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::const_reverse_iterator = typename edges_map_t::const_reverse_iterator
inherited

Definition at line 95 of file CDirectedGraph.h.

◆ constraint_no_pdf_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::constraint_no_pdf_t = typename CPOSE::type_value

The type of edges or their means if they are PDFs (that is, a simple "edge" value)

Definition at line 147 of file CNetworkOfPoses.h.

◆ constraint_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::constraint_t = CPOSE

The type of PDF poses in the contraints (edges) (=CPOSE template argument)

Definition at line 136 of file CNetworkOfPoses.h.

◆ edge_annotations_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::edge_annotations_t = EDGE_ANNOTATIONS

The extra annotations in edges, apart from a constraint_t.

Definition at line 140 of file CNetworkOfPoses.h.

◆ edges_map_t

The type of the member edges.

Definition at line 91 of file CDirectedGraph.h.

◆ global_poses_pdf_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::global_poses_pdf_t = typename MAPS_IMPLEMENTATION::template map< mrpt::graphs::TNodeID, CPOSE>

A map from pose IDs to their global coordinate estimates, with uncertainty.

Definition at line 224 of file CNetworkOfPoses.h.

◆ global_poses_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::global_poses_t = typename MAPS_IMPLEMENTATION::template map< mrpt::graphs::TNodeID, global_pose_t>

A map from pose IDs to their global coordinate estimates, without uncertainty (the "most-likely value")

Definition at line 229 of file CNetworkOfPoses.h.

◆ iterator

using mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::iterator = typename edges_map_t::iterator
inherited

Definition at line 92 of file CDirectedGraph.h.

◆ maps_implementation_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::maps_implementation_t = MAPS_IMPLEMENTATION

The type of map's implementation (=MAPS_IMPLEMENTATION template argument)

Definition at line 144 of file CNetworkOfPoses.h.

◆ node_annotations_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::node_annotations_t = NODE_ANNOTATIONS

The extra annotations in nodes, apart from a constraint_no_pdf_t.

Definition at line 138 of file CNetworkOfPoses.h.

◆ reverse_iterator

using mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::reverse_iterator = typename edges_map_t::reverse_iterator
inherited

Definition at line 93 of file CDirectedGraph.h.

◆ self_t

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
using mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::self_t = CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS>

My own type.

Definition at line 132 of file CNetworkOfPoses.h.

Member Function Documentation

◆ addVirtualEdge()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
static void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::addVirtualEdge ( self_t graph,
const TNodeID from,
const TNodeID to 
)
inlinestaticprivate

◆ begin() [1/2]

Definition at line 106 of file CDirectedGraph.h.

◆ begin() [2/2]

Definition at line 110 of file CDirectedGraph.h.

◆ clear()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear ( )
inline

◆ clearEdges()

Erase all edges.

Definition at line 120 of file CDirectedGraph.h.

◆ collapseDuplicatedEdges()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
size_t mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::collapseDuplicatedEdges ( )
inline

Look for duplicated edges (even in opposite directions) between all pairs of nodes and fuse them.

Upon return, only one edge remains between each pair of nodes with the mean & covariance (or information matrix) corresponding to the Bayesian fusion of all the Gaussians.

Returns
Overall number of removed edges.

Definition at line 361 of file CNetworkOfPoses.h.

References mrpt::graphs::detail::graph_ops< graph_t >::graph_of_poses_collapse_dup_edges().

Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::loadFromTextFile().

◆ connectGraphPartitions()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
static void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::connectGraphPartitions ( self_t sub_graph,
const std::set< TNodeID > &  groupA,
const std::set< TNodeID > &  groupB 
)
inlinestatic

Add an edge between the last node of the group with the lower nodeIDs and the first node of the higher nodeIDs.

Given groups of nodes should only contain consecutive nodeIDs and there should be no overlapping between them

Note
It is assumed that the sets of nodes are already in ascending order (default std::set behavior.

Definition at line 850 of file CNetworkOfPoses.h.

References mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::addVirtualEdge(), and ASSERTMSG_.

Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph().

◆ countDifferentNodesInEdges()

size_t mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::countDifferentNodesInEdges
inlineinherited

Count how many different node IDs appear in the graph edges.

Definition at line 235 of file CDirectedGraph.h.

◆ dijkstra_nodes_estimate()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::dijkstra_nodes_estimate ( )
inline

Spanning tree computation of a simple estimation of the global coordinates of each node just from the information in all edges, sorted in a Dijkstra tree based on the current "root" node.

Note
The "global" coordinates are with respect to the node with the ID specified in root.
This method takes into account the value of edges_store_inverse_poses
See also
node, root

Definition at line 349 of file CNetworkOfPoses.h.

References mrpt::graphs::detail::graph_ops< graph_t >::graph_of_poses_dijkstra_init().

Referenced by mrpt::hmtslam::CHierarchicalMapMHPartition::computeGloballyConsistentNodeCoordinates(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::mergeGraph().

◆ edgeCount()

size_t mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::edgeCount
inlineinherited

The number of edges in the graph.

Definition at line 118 of file CDirectedGraph.h.

◆ edgeExists()

bool mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::edgeExists ( TNodeID  from_nodeID,
TNodeID  to_nodeID 
) const
inlineinherited

Test if the given directed edge exists.

Definition at line 143 of file CDirectedGraph.h.

◆ end() [1/2]

Definition at line 108 of file CDirectedGraph.h.

◆ end() [2/2]

Definition at line 112 of file CDirectedGraph.h.

◆ eraseEdge()

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::eraseEdge ( TNodeID  from_nodeID,
TNodeID  to_nodeID 
)
inlineinherited

Erase all edges between the given nodes (it has no effect if no edge existed)

Definition at line 205 of file CDirectedGraph.h.

◆ extractSubGraph()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph ( const std::set< TNodeID > &  node_IDs,
self_t sub_graph,
const TNodeID  root_node_in = INVALID_NODEID,
const bool &  auto_expand_set = true 
) const
inline

Find the edges between the nodes in the node_IDs set and fill given graph pointer accordingly.

Parameters
[in]node_IDsSet of nodes, between which, edges should be found and inserted in the given sub_graph pointer
[in]root_node_inNode ID to be used as the root node of sub_graph. If this is not given, the lowest nodeID is to be used.
[out]CNetworkOfPosespointer that is to be filled.
[in]auto_expand_setIf true and in case the node_IDs set contains non-consecutive nodes the returned set is expanded with the in-between nodes. This makes sure that the final graph is always connected. If auto_expand_set is false but there exist non-consecutive nodes, virtual edges are inserted in the parts that the graph is not connected

Definition at line 404 of file CNetworkOfPoses.h.

References mrpt::math::absDiff(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::addVirtualEdge(), ASSERT_, ASSERTMSG_, mrpt::graphs::CDirectedGraph< CPOSE, mrpt::graphs::detail::edge_annotations_empty >::begin(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear(), mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::clearEdges(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::connectGraphPartitions(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::dijkstra_nodes_estimate(), mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges, mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::getNeighborsOf(), mrpt::graphs::detail::NotConnectedGraph::getUnconnectedNodeIDs(), mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::insertEdge(), INVALID_NODEID, mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes, and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::root.

◆ getAdjacencyMatrix() [1/2]

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getAdjacencyMatrix ( MAP_NODEID_SET_NODEIDS &  outAdjacency) const
inlineinherited

Return a map from node IDs to all its neighbors (that is, connected nodes, regardless of the edge direction) This is a much more efficient method than calling getNeighborsOf() for each node in the graph.

Possible values for the template argument MAP_NODEID_SET_NODEIDS are:

  • std::map<TNodeID, std::set<TNodeID> >
  • mrpt::utils::map_as_vector<TNodeID, std::set<TNodeID> >
    See also
    getNeighborsOf

Definition at line 281 of file CDirectedGraph.h.

◆ getAdjacencyMatrix() [2/2]

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getAdjacencyMatrix ( MAP_NODEID_SET_NODEIDS &  outAdjacency,
const SET_NODEIDS &  onlyForTheseNodes 
) const
inlineinherited

Just like getAdjacencyMatrix but return only the adjacency for those node_ids in the set onlyForTheseNodes (both endings nodes of an edge must be within the set for it to be returned)

Definition at line 297 of file CDirectedGraph.h.

◆ getAllNodes() [1/2]

std::set<TNodeID> mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getAllNodes
inlineinherited

Less efficient way to get all nodes that returns a copy of the set object.

See also
getAllNodes( std::set<TNodeID> &lstNode_IDs)

Definition at line 226 of file CDirectedGraph.h.

◆ getAllNodes() [2/2]

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getAllNodes ( std::set< TNodeID > &  lstNode_IDs) const
inlineinherited

Return a list of all the node_ID's of the graph, generated from all the nodes that appear in the list of edges.

Definition at line 213 of file CDirectedGraph.h.

◆ getAs3DObject()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getAs3DObject ( mrpt::opengl::CSetOfObjects::Ptr  object,
const mrpt::system::TParametersDouble viz_params 
) const
inline

Return 3D Visual Representation of the edges and nodes in the network of poses.

Method makes the call to the corresponding method of the CVisualizer class instance.

Definition at line 312 of file CNetworkOfPoses.h.

◆ getClassName()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
constexpr static auto mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getClassName ( )
inlinestaticconstexpr

Definition at line 149 of file CNetworkOfPoses.h.

References mrpt::typemeta::literal().

◆ getEdge() [1/2]

edge_t& mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getEdge ( TNodeID  from_nodeID,
TNodeID  to_nodeID 
)
inlineinherited

Return a reference to the content of a given edge.

If several edges exist between the given nodes, the first one is returned.

Exceptions
std::exceptionif the given edge does not exist
See also
getEdges

Definition at line 155 of file CDirectedGraph.h.

◆ getEdge() [2/2]

const edge_t& mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getEdge ( TNodeID  from_nodeID,
TNodeID  to_nodeID 
) const
inlineinherited

Return a reference to the content of a given edge.

If several edges exist between the given nodes, the first one is returned.

Exceptions
std::exceptionif the given edge does not exist
See also
getEdges

Definition at line 174 of file CDirectedGraph.h.

◆ getEdges() [1/2]

std::pair<iterator, iterator> mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getEdges ( TNodeID  from_nodeID,
TNodeID  to_nodeID 
)
inlineinherited

Return a pair<first,last> of iterators to the range of edges between two given nodes.

See also
getEdge

Definition at line 189 of file CDirectedGraph.h.

◆ getEdges() [2/2]

std::pair<const_iterator, const_iterator> mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getEdges ( TNodeID  from_nodeID,
TNodeID  to_nodeID 
) const
inlineinherited

Return a pair<first,last> of const iterators to the range of edges between two given nodes.

See also
getEdge

Definition at line 196 of file CDirectedGraph.h.

◆ getEdgeSquareError() [1/2]

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
double mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError ( const mrpt::graphs::TNodeID  from_id,
const mrpt::graphs::TNodeID  to_id,
bool  ignoreCovariances = true 
) const
inline

Computes the square error of one pose constraints (edge) with respect to the global poses in nodes If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.

Exceptions
std::exceptionOn edge not existing or global poses not in nodes

Definition at line 905 of file CNetworkOfPoses.h.

References ASSERTMSG_, mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges, mrpt::graphs::CDirectedGraph< CPOSE, mrpt::graphs::detail::edge_annotations_empty >::end(), mrpt::format(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError().

◆ getEdgeSquareError() [2/2]

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
double mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError ( const typename BASE::edges_map_t::const_iterator itEdge,
bool  ignoreCovariances = true 
) const
inline

Computes the square error of one pose constraints (edge) with respect to the global poses in nodes If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.

Exceptions
std::exceptionOn global poses not in nodes

Definition at line 889 of file CNetworkOfPoses.h.

References mrpt::graphs::detail::graph_ops< graph_t >::graph_edge_sqerror().

Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError().

◆ getGlobalSquareError()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
double mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getGlobalSquareError ( bool  ignoreCovariances = true) const
inline

Computes the overall square error from all the pose constraints (edges) with respect to the global poses in nodes If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.

See also
getEdgeSquareError
Exceptions
std::exceptionOn global poses not in nodes

Definition at line 374 of file CNetworkOfPoses.h.

References mrpt::graphs::CDirectedGraph< CPOSE, mrpt::graphs::detail::edge_annotations_empty >::begin(), and mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.

◆ getNeighborsOf() [1/2]

std::set<TNodeID> mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getNeighborsOf ( const TNodeID  nodeID) const
inlineinherited

Return the list of all neighbors of "nodeID", by creating a list of their node IDs.

See also
getAdjacencyMatrix

Definition at line 264 of file CDirectedGraph.h.

◆ getNeighborsOf() [2/2]

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::getNeighborsOf ( const TNodeID  nodeID,
std::set< TNodeID > &  neighborIDs 
) const
inlineinherited

Return the list of all neighbors of "nodeID", by creating a list of their node IDs.

See also
getAdjacencyMatrix

Definition at line 249 of file CDirectedGraph.h.

◆ insertEdge()

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::insertEdge ( TNodeID  from_nodeID,
TNodeID  to_nodeID,
const edge_t &  edge_value 
)
inlineinherited

Insert an edge (from -> to) with the given edge value.

See also
insertEdgeAtEnd

Definition at line 123 of file CDirectedGraph.h.

◆ insertEdgeAtEnd()

void mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::insertEdgeAtEnd ( TNodeID  from_nodeID,
TNodeID  to_nodeID,
const edge_t &  edge_value 
)
inlineinherited

Insert an edge (from -> to) with the given edge value (more efficient version to be called if you know that the end will go at the end of the sorted std::multimap).

See also
insertEdge

Definition at line 134 of file CDirectedGraph.h.

◆ loadFromTextFile()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::loadFromTextFile ( const std::string fileName,
bool  collapse_dup_edges = true 
)
inline

Loads from a text file in the format used by TORO & HoG-man (more on the format here) Recognized line entries are: VERTEX2, VERTEX3, EDGE2, EDGE3, EQUIV.

If an unknown entry is found, a warning is dumped to std::cerr (only once for each unknown keyword). An exception will be raised if trying to load a 3D graph into a 2D class (in the opposite case, missing 3D data will default to zero).

Parameters
[in]fileNameThe file to load.
[in]collapse_dup_edgesIf true, collapseDuplicatedEdges will be called automatically after loading (note that this operation may take significant time for very large graphs).
See also
loadFromBinaryFile, saveToTextFile
Exceptions
Onany error, as a malformed line or loading a 3D graph in a 2D graph.

Definition at line 294 of file CNetworkOfPoses.h.

References mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::collapseDuplicatedEdges(), and mrpt::graphs::detail::graph_ops< graph_t >::load_graph_of_poses_from_text_file().

◆ mergeGraph()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::mergeGraph ( const self_t other,
const typename std::vector< detail::THypothesis< self_t >> &  common_hypots,
const bool  hypots_from_other_to_self = true,
std::map< TNodeID, TNodeID > *  old_to_new_nodeID_mappings_out = NULL 
)
inline

Integrate given graph into own graph using the list of provided common THypotheses.

Nodes of the other graph are renumbered upon integration in own graph.

Parameters
[in]otherGraph (of the same type) that is to be integrated with own graph.
[in]Hypothesesthat join own and other graph.
[in]hypots_from_other_to_selfSpecify the direction of the THypothesis objects in the common_hypots. If true (default) they are directed from other to own graph (other \rightarrow own),
[out]old_to_new_nodeID_mappings_outMap from the old nodeIDs that are in the given graph to the new nodeIDs that have been inserted (by this method) in own graph.

Definition at line 713 of file CNetworkOfPoses.h.

References ASSERT_, ASSERTMSG_, mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::begin(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::dijkstra_nodes_estimate(), mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::end(), mrpt::graphs::CDirectedGraph< CPOSE, mrpt::graphs::detail::edge_annotations_empty >::insertEdge(), MRPT_END, MRPT_START, and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes.

◆ nodeCount()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
size_t mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodeCount ( ) const
inline

Return number of nodes in the list nodes of global coordinates (may be different that all nodes appearing in edges)

See also
mrpt::graphs::CDirectedGraph::countDifferentNodesInEdges

Definition at line 934 of file CNetworkOfPoses.h.

References mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes.

◆ rbegin() [1/2]

Definition at line 107 of file CDirectedGraph.h.

◆ rbegin() [2/2]

Definition at line 111 of file CDirectedGraph.h.

◆ rend() [1/2]

Definition at line 109 of file CDirectedGraph.h.

◆ rend() [2/2]

Definition at line 113 of file CDirectedGraph.h.

◆ saveAsDot() [1/2]

bool mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::saveAsDot ( const std::string fileName,
const TGraphvizExportParams p = TGraphvizExportParams() 
) const
inlineinherited

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 365 of file CDirectedGraph.h.

◆ saveAsDot() [2/2]

bool mrpt::graphs::CDirectedGraph< CPOSE , mrpt::graphs::detail::edge_annotations_empty >::saveAsDot ( std::ostream &  o,
const TGraphvizExportParams p = TGraphvizExportParams() 
) const
inlineinherited

Save the graph in a Graphviz (.dot files) text format; useful for quickly rendering the graph with "dot".

Returns
false on any error

Definition at line 323 of file CDirectedGraph.h.

◆ saveToTextFile()

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
void mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::saveToTextFile ( const std::string fileName) const
inline

Saves to a text file in the format used by TORO & HoG-man (more on the format <a href="http://www.mrpt.org/Robotics_file_formats" * >here) For 2D graphs only VERTEX2 & EDGE2 entries will be saved, and VERTEX3 & EDGE3 entries for 3D graphs.

Note that EQUIV entries will not be saved, but instead several EDGEs will be stored between the same node IDs.

See also
saveToBinaryFile, loadFromTextFile
Exceptions
Onany error

Definition at line 270 of file CNetworkOfPoses.h.

References mrpt::graphs::detail::graph_ops< graph_t >::save_graph_of_poses_to_text_file().

Member Data Documentation

◆ edges

The public member with the directed edges in the graph.

Definition at line 100 of file CDirectedGraph.h.

◆ edges_store_inverse_poses

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
bool mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::edges_store_inverse_poses {false}

False (default) if an edge i->j stores the normal relative pose of j as seen from i: $ \Delta_i^j = j \ominus i $ True if an edge i->j stores the inverse relateive pose, that is, i as seen from j: $ \Delta_i^j = i \ominus j $.

Definition at line 252 of file CNetworkOfPoses.h.

Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear().

◆ nodes

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
global_poses_t mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes

◆ root

template<class CPOSE , class MAPS_IMPLEMENTATION = mrpt::containers::map_traits_stdmap, class NODE_ANNOTATIONS = mrpt::graphs::detail::TNodeAnnotationsEmpty, class EDGE_ANNOTATIONS = mrpt::graphs::detail::edge_annotations_empty>
mrpt::graphs::TNodeID mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::root {0}



Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST