A directed graph of pose constraints, with edges being the relative poses between pairs of nodes identified by their numeric IDs (of type mrpt::utils::TNodeID).
A link or edge between two nodes "i" and "j", that is, the pose , 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:
Definition at line 104 of file CNetworkOfPoses.h.
#include <mrpt/graphs/CNetworkOfPoses.h>
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 | |
typedef CPOSE | edge_underlying_t |
typedef mrpt::aligned_containers< TPairNodeIDs, edge_t >::multimap_t | edges_map_t |
The type of the member edges. More... | |
typedef edges_map_t::iterator | iterator |
typedef edges_map_t::reverse_iterator | reverse_iterator |
typedef edges_map_t::const_iterator | const_iterator |
typedef edges_map_t::const_reverse_iterator | const_reverse_iterator |
Typedef's | |
typedef mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS > | BASE |
The base class "CDirectedGraph<CPOSE,EDGE_ANNOTATIONS>" */. More... | |
typedef CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS > | self_t |
My own type. More... | |
typedef CPOSE | constraint_t |
The type of PDF poses in the contraints (edges) (=CPOSE template argument) More... | |
typedef NODE_ANNOTATIONS | node_annotations_t |
The extra annotations in nodes, apart from a constraint_no_pdf_t. More... | |
typedef EDGE_ANNOTATIONS | edge_annotations_t |
The extra annotations in edges, apart from a constraint_t. More... | |
typedef MAPS_IMPLEMENTATION | maps_implementation_t |
The type of map's implementation (=MAPS_IMPLEMENTATION template argument) More... | |
typedef CPOSE::type_value | constraint_no_pdf_t |
The type of edges or their means if they are PDFs (that is, a simple "edge" value) More... | |
typedef MAPS_IMPLEMENTATION::template map< mrpt::utils::TNodeID, CPOSE > | global_poses_pdf_t |
A map from pose IDs to their global coordinate estimates, with uncertainty. More... | |
typedef MAPS_IMPLEMENTATION::template map< mrpt::utils::TNodeID, global_pose_t > | global_poses_t |
A map from pose IDs to their global coordinate estimates, without uncertainty (the "most-likely value") More... | |
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 |
I/O methods | |
void | saveToTextFile (const std::string &fileName) const |
Saves to a text file in the format used by TORO, HoG-man, G2O. More... | |
void | writeAsText (std::ostream &o) const |
Writes as text in the format used by TORO, HoG-man, G2O. 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... | |
void | readAsText (std::istream &i) |
Reads as text in the format used by TORO, HoG-man, G2O. More... | |
Ctors & Dtors | |
CNetworkOfPoses () | |
Default constructor (just sets root to "0" and edges_store_inverse_poses to "false") 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, iterator > | getEdges (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_iterator > | getEdges (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< TNodeID > | getAllNodes () 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< TNodeID > | getNeighborsOf (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 |
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::utils::TNodeID | root |
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 (default) if an edge i->j stores the normal relative pose of j as seen from i: True if an edge i->j stores the inverse relateive pose, that is, i as seen from 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... | |
Utility methods | |
void | getAs3DObject (mrpt::opengl::CSetOfObjectsPtr object, const mrpt::utils::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 | chi2 () const |
Returns the total chi-squared error of the graph. 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::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 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... | |
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... | |
typedef mrpt::graphs::CDirectedGraph<CPOSE,EDGE_ANNOTATIONS> mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::BASE |
The base class "CDirectedGraph<CPOSE,EDGE_ANNOTATIONS>" */.
Definition at line 109 of file CNetworkOfPoses.h.
|
inherited |
Definition at line 71 of file CDirectedGraph.h.
|
inherited |
Definition at line 72 of file CDirectedGraph.h.
typedef CPOSE::type_value mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::constraint_no_pdf_t |
The type of edges or their means if they are PDFs (that is, a simple "edge" value)
Definition at line 117 of file CNetworkOfPoses.h.
typedef CPOSE mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::constraint_t |
The type of PDF poses in the contraints (edges) (=CPOSE template argument)
Definition at line 112 of file CNetworkOfPoses.h.
typedef EDGE_ANNOTATIONS mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::edge_annotations_t |
The extra annotations in edges, apart from a constraint_t.
Definition at line 114 of file CNetworkOfPoses.h.
|
inherited |
Definition at line 66 of file CDirectedGraph.h.
|
inherited |
The type of the member edges.
Definition at line 68 of file CDirectedGraph.h.
typedef MAPS_IMPLEMENTATION::template map<mrpt::utils::TNodeID,CPOSE> mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::global_poses_pdf_t |
A map from pose IDs to their global coordinate estimates, with uncertainty.
Definition at line 159 of file CNetworkOfPoses.h.
typedef MAPS_IMPLEMENTATION::template map<mrpt::utils::TNodeID,global_pose_t> mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::global_poses_t |
A map from pose IDs to their global coordinate estimates, without uncertainty (the "most-likely value")
Definition at line 162 of file CNetworkOfPoses.h.
|
inherited |
Definition at line 69 of file CDirectedGraph.h.
typedef MAPS_IMPLEMENTATION mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::maps_implementation_t |
The type of map's implementation (=MAPS_IMPLEMENTATION template argument)
Definition at line 116 of file CNetworkOfPoses.h.
typedef NODE_ANNOTATIONS mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::node_annotations_t |
The extra annotations in nodes, apart from a constraint_no_pdf_t.
Definition at line 113 of file CNetworkOfPoses.h.
|
inherited |
Definition at line 70 of file CDirectedGraph.h.
typedef CNetworkOfPoses<CPOSE,MAPS_IMPLEMENTATION,NODE_ANNOTATIONS,EDGE_ANNOTATIONS> mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::self_t |
My own type.
Definition at line 110 of file CNetworkOfPoses.h.
|
inline |
Default constructor (just sets root to "0" and edges_store_inverse_poses to "false")
Definition at line 814 of file CNetworkOfPoses.h.
|
inlinestaticprivate |
Add a virtual edge between two nodes in the given graph.
Edge is called virtual as its value will be determined solely on the pose difference of the given nodeIDs
Definition at line 827 of file CNetworkOfPoses.h.
References ASSERTMSG_, mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::insertEdge(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::connectGraphPartitions(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph().
|
inlineinherited |
Definition at line 83 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getGlobalSquareError().
|
inlineinherited |
Definition at line 87 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inline |
Returns the total chi-squared error of the graph.
Shortcut for getGlobalSquareError(false).
Definition at line 310 of file CNetworkOfPoses.h.
|
inline |
Empty all edges, nodes and set root to ID 0.
Definition at line 793 of file CNetworkOfPoses.h.
References mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::edges, mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::edges_store_inverse_poses, mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes, and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::root.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph().
|
inlineinherited |
Erase all edges.
Definition at line 96 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
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.
Definition at line 306 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().
|
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
Definition at line 729 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().
|
inlineinherited |
Count how many different node IDs appear in the graph edges.
Definition at line 180 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
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.
Definition at line 297 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().
|
inlineinherited |
The number of edges in the graph.
Definition at line 95 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Test if the given directed edge exists.
Definition at line 118 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Definition at line 85 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError().
|
inlineinherited |
Definition at line 89 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Erase all edges between the given nodes (it has no effect if no edge existed)
Definition at line 159 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inline |
Find the edges between the nodes in the node_IDs set and fill given graph pointer accordingly.
[in] | node_IDs | Set of nodes, between which, edges should be found and inserted in the given sub_graph pointer |
[in] | root_node_in | Node ID to be used as the root node of sub_graph. If this is not given, the lowest nodeID is to be used. |
[out] | CNetworkOfPoses | pointer that is to be filled. |
[in] | auto_expand_set | If 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 342 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, EDGE_ANNOTATIONS >::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< CPOSE, EDGE_ANNOTATIONS >::edges, mrpt::format(), 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.
|
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:
Definition at line 218 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
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 231 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
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 165 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Less efficient way to get all nodes that returns a copy of the set object.
Definition at line 176 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::getAllNodes().
|
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 259 of file CNetworkOfPoses.h.
|
inlineinherited |
Return a reference to the content of a given edge.
If several edges exist between the given nodes, the first one is returned.
std::exception | if the given edge does not exist |
Definition at line 127 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges, mrpt::format(), and THROW_EXCEPTION.
|
inlineinherited |
Return a reference to the content of a given edge.
If several edges exist between the given nodes, the first one is returned.
std::exception | if the given edge does not exist |
Definition at line 140 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges, mrpt::format(), and THROW_EXCEPTION.
|
inlineinherited |
Return a pair<first,last> of iterators to the range of edges between two given nodes.
Definition at line 149 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Return a pair<first,last> of const iterators to the range of edges between two given nodes.
Definition at line 153 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
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.
std::exception | On global poses not in nodes |
Definition at line 767 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().
|
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.
std::exception | On edge not existing or global poses not in nodes |
Definition at line 785 of file CNetworkOfPoses.h.
References ASSERTMSG_, mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::edges, mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::end(), mrpt::format(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError().
|
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.
std::exception | On global poses not in nodes |
Definition at line 317 of file CNetworkOfPoses.h.
References mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::begin(), and mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::edges.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::chi2().
|
inlineinherited |
Return the list of all neighbors of "nodeID", by creating a list of their node IDs.
Definition at line 192 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Return the list of all neighbors of "nodeID", by creating a list of their node IDs.
Definition at line 204 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::getNeighborsOf().
|
inlineinherited |
Insert an edge (from -> to) with the given edge value.
Definition at line 100 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges, and MRPT_ALIGN16.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::mergeGraph().
|
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).
Definition at line 109 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges, and MRPT_ALIGN16.
|
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).
[in] | fileName | The file to load. |
[in] | collapse_dup_edges | If true, collapseDuplicatedEdges will be called automatically after loading (note that this operation may take significant time for very large graphs). |
On | any error, as a malformed line or loading a 3D graph in a 2D graph. |
Definition at line 231 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().
|
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.
[in] | other | Graph (of the same type) that is to be integrated with own graph. |
[in] | Hypotheses | that join own and other graph. |
[in] | hypots_from_other_to_self | Specify the direction of the THypothesis objects in the common_hypots. If true (default) they are directed from other to own graph (other own), |
[out] | old_to_new_nodeID_mappings_out | Map 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 600 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::format(), mrpt::graphs::CDirectedGraph< CPOSE, EDGE_ANNOTATIONS >::insertEdge(), MRPT_END, MRPT_START, and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes.
|
inline |
Return number of nodes in the list nodes of global coordinates (may be different that all nodes appearing in edges)
Definition at line 805 of file CNetworkOfPoses.h.
References mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes.
|
inlineinherited |
Definition at line 84 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Definition at line 88 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inline |
Reads as text in the format used by TORO, HoG-man, G2O.
See: https://www.mrpt.org/Graph-SLAM_maps
On | any error |
Definition at line 244 of file CNetworkOfPoses.h.
References mrpt::graphs::detail::graph_ops< graph_t >::load_graph_of_poses_from_text_stream().
|
inlineinherited |
Definition at line 86 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Definition at line 90 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::edges.
|
inlineinherited |
Save the graph in a Graphviz (.dot files) text format; useful for quickly rendering the graph with "dot".
Definition at line 252 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::begin(), mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::end(), and mrpt::mrpt::format().
|
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 284 of file CDirectedGraph.h.
References mrpt::graphs::CDirectedGraph< TYPE_EDGES, EDGE_ANNOTATIONS >::saveAsDot().
|
inline |
Saves to a text file in the format used by TORO, HoG-man, G2O.
See: https://www.mrpt.org/Graph-SLAM_maps
On | any error |
Definition at line 198 of file CNetworkOfPoses.h.
References mrpt::graphs::detail::graph_ops< graph_t >::save_graph_of_poses_to_text_file().
|
inline |
Writes as text in the format used by TORO, HoG-man, G2O.
See: https://www.mrpt.org/Graph-SLAM_maps
On | any error |
Definition at line 208 of file CNetworkOfPoses.h.
References mrpt::graphs::detail::graph_ops< graph_t >::save_graph_of_poses_to_ostream().
|
inherited |
The public member with the directed edges in the graph.
Definition at line 77 of file CDirectedGraph.h.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getEdgeSquareError(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::getGlobalSquareError().
bool mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::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 i->j stores the inverse relateive pose, that is, i as seen from j: .
Definition at line 185 of file CNetworkOfPoses.h.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear().
global_poses_t mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodes |
The nodes (vertices) of the graph, with their estimated "global" (with respect to root) position, without an associated covariance.
Definition at line 173 of file CNetworkOfPoses.h.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::addVirtualEdge(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear(), mrpt::hmtslam::CHierarchicalMapMHPartition::computeGloballyConsistentNodeCoordinates(), mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawEdges(), mrpt::graphs::detail::CMRVisualizer< CPOSE, MAPS_IMPLEMENTATION, TMRSlamNodeAnnotations, EDGE_ANNOTATIONS >::drawNodePoints(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph(), mrpt::graphs::detail::graph_ops< graph_t >::load_graph_of_poses_from_text_stream(), mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::mergeGraph(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::nodeCount().
mrpt::utils::TNodeID mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::root |
The ID of the node that is the origin of coordinates, used as reference by all coordinates in nodes.
By default, root is the ID "0".
Definition at line 178 of file CNetworkOfPoses.h.
Referenced by mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::clear(), mrpt::hmtslam::CHierarchicalMapMHPartition::computeGloballyConsistentNodeCoordinates(), and mrpt::graphs::CNetworkOfPoses< CPOSE, MAPS_IMPLEMENTATION, NODE_ANNOTATIONS, EDGE_ANNOTATIONS >::extractSubGraph().
Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020 |