Main MRPT website > C++ reference
MRPT logo
Public Member Functions | Static Public Attributes | Protected Member Functions
mrpt::graphs::CNetworkOfPoses3DCov Class Reference

Detailed Description

The specialization of CNetworkOfPoses for poses of type CPose3DPDFGaussian, also implementing serialization.

See also:
CNetworkOfPoses, CNetworkOfPoses2D, CNetworkOfPoses3D, CNetworkOfPoses2DInf, CNetworkOfPoses3DInf

#include <mrpt/graphs/CNetworkOfPoses.h>

Inheritance diagram for mrpt::graphs::CNetworkOfPoses3DCov:
Inheritance graph
[legend]

List of all members.

Public Types

Typedef's
typedef
mrpt::graphs::CDirectedGraph
< CPOSE, EDGE_ANNOTATIONS > 
BASE
 The base class "CDirectedGraph<CPOSE,EDGE_ANNOTATIONS>" */.
typedef CNetworkOfPoses< CPOSE,
MAPS_IMPLEMENTATION,
NODE_ANNOTATIONS,
EDGE_ANNOTATIONS > 
self_t
 My own type.
typedef CPOSE constraint_t
 The type of PDF poses in the contraints (edges) (=CPOSE template argument)
typedef NODE_ANNOTATIONS node_annotations_t
 The extra annotations in nodes, apart from a constraint_no_pdf_t.
typedef EDGE_ANNOTATIONS edge_annotations_t
 The extra annotations in edges, apart from a constraint_t.
typedef MAPS_IMPLEMENTATION maps_implementation_t
 The type of map's implementation (=MAPS_IMPLEMENTATION template argument)
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)
typedef
MAPS_IMPLEMENTATION::template
map< TNodeID, CPOSE > 
global_poses_pdf_t
 A map from pose IDs to their global coordinates estimates, with uncertainty.
typedef
MAPS_IMPLEMENTATION::template
map< TNodeID, global_pose_t > 
global_poses_t
 A map from pose IDs to their global coordinates estimates, without uncertainty (the "most-likely value")

Public Member Functions

mrpt::utils::CObjectPtr duplicateGetSmartPtr () const
 Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).
CObjectclone () const
 Cloning interface for smart pointers.
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 here ) For 2D graphs only VERTEX2 & EDGE2 entries will be saved, and VERTEX3 & EDGE3 entries for 3D graphs.
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.
Utility methods
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.
size_t collapseDuplicatedEdges ()
 Look for duplicated edges (even in opposite directions) between all pairs of nodes and fuse them.
double getGlobalSquareError (bool ignoreCovariances=true) const
 Computes the overall square error from all the pose constraints (edges) with respect to the global poses in If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.
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 If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.
double getEdgeSquareError (const TNodeID from_id, const TNodeID to_id, bool ignoreCovariances=true) const
 Computes the square error of one pose constraints (edge) with respect to the global poses in If ignoreCovariances is false, the squared Mahalanobis distance will be computed instead of the straight square error.
void clear ()
 Empty all edges, nodes and set root to ID 0.
size_t nodeCount () const
 Return number of nodes in the list of global coordinates (may be differente that all nodes appearing in edges)

Public Attributes

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.
TNodeID root
 The ID of the node that is the origin of coordinates, used as reference by all coordinates in .
bool edges_store_inverse_poses
 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 $.

Static Public Attributes

static const
mrpt::utils::TRuntimeClassId 
classCObject

Protected Member Functions

virtual void writeToStream (mrpt::utils::CStream &out, int *getVersion) const =0
 Introduces a pure virtual method responsible for writing to a CStream.
virtual void readFromStream (mrpt::utils::CStream &in, int version)=0
 Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

RTTI stuff

static const
mrpt::utils::TRuntimeClassId 
classCSerializable
class mrpt::utils::CStream

RTTI stuff

typedef CNetworkOfPoses3DCovPtr SmartPtr
static mrpt::utils::CLASSINIT _init_CNetworkOfPoses3DCov
static mrpt::utils::TRuntimeClassId classCNetworkOfPoses3DCov
static const
mrpt::utils::TRuntimeClassId
classinfo
static const
mrpt::utils::TRuntimeClassId
_GetBaseClass ()
virtual const
mrpt::utils::TRuntimeClassId
GetRuntimeClass () const
 Returns information about the class of an object in runtime.
virtual mrpt::utils::CObjectduplicate () const
 Returns a copy of the object, indepently of its class.
static mrpt::utils::CObjectCreateObject ()
static CNetworkOfPoses3DCovPtr Create ()

Member Typedef Documentation

typedef mrpt::graphs::CDirectedGraph<CPOSE,EDGE_ANNOTATIONS> mrpt::graphs::CNetworkOfPoses::BASE [inherited]

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

Definition at line 111 of file CNetworkOfPoses.h.

typedef CPOSE::type_value mrpt::graphs::CNetworkOfPoses::constraint_no_pdf_t [inherited]

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

Definition at line 119 of file CNetworkOfPoses.h.

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

Definition at line 114 of file CNetworkOfPoses.h.

typedef EDGE_ANNOTATIONS mrpt::graphs::CNetworkOfPoses::edge_annotations_t [inherited]

The extra annotations in edges, apart from a constraint_t.

Definition at line 116 of file CNetworkOfPoses.h.

typedef MAPS_IMPLEMENTATION::template map<TNodeID,CPOSE> mrpt::graphs::CNetworkOfPoses::global_poses_pdf_t [inherited]

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

Definition at line 131 of file CNetworkOfPoses.h.

typedef MAPS_IMPLEMENTATION::template map<TNodeID,global_pose_t> mrpt::graphs::CNetworkOfPoses::global_poses_t [inherited]

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

Definition at line 134 of file CNetworkOfPoses.h.

typedef MAPS_IMPLEMENTATION mrpt::graphs::CNetworkOfPoses::maps_implementation_t [inherited]

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

Definition at line 118 of file CNetworkOfPoses.h.

typedef NODE_ANNOTATIONS mrpt::graphs::CNetworkOfPoses::node_annotations_t [inherited]

The extra annotations in nodes, apart from a constraint_no_pdf_t.

Definition at line 115 of file CNetworkOfPoses.h.

typedef CNetworkOfPoses<CPOSE,MAPS_IMPLEMENTATION,NODE_ANNOTATIONS,EDGE_ANNOTATIONS> mrpt::graphs::CNetworkOfPoses::self_t [inherited]

My own type.

Definition at line 112 of file CNetworkOfPoses.h.

A typedef for the associated smart pointer

Definition at line 318 of file CNetworkOfPoses.h.


Member Function Documentation

static const mrpt::utils::TRuntimeClassId* mrpt::graphs::CNetworkOfPoses3DCov::_GetBaseClass ( ) [static, protected]

Reimplemented from mrpt::utils::CSerializable.

void mrpt::graphs::CNetworkOfPoses::clear ( void  ) [inline, inherited]

Empty all edges, nodes and set root to ID 0.

Definition at line 234 of file CNetworkOfPoses.h.

CObject* mrpt::utils::CObject::clone ( ) const [inline, inherited]

Cloning interface for smart pointers.

Reimplemented in mrpt::opengl::CRenderizable, and mrpt::opengl::CRenderizableDisplayList.

Definition at line 154 of file CObject.h.

size_t mrpt::graphs::CNetworkOfPoses::collapseDuplicatedEdges ( ) [inline, inherited]

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 201 of file CNetworkOfPoses.h.

static CNetworkOfPoses3DCovPtr mrpt::graphs::CNetworkOfPoses3DCov::Create ( ) [static]
static mrpt::utils::CObject* mrpt::graphs::CNetworkOfPoses3DCov::CreateObject ( ) [static]
void mrpt::graphs::CNetworkOfPoses::dijkstra_nodes_estimate ( ) [inline, inherited]

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 that "global" coordinates are with respect to the node with the ID specified in root.

Note:
This method takes into account the value of edges_store_inverse_poses
See also:
node, root

Definition at line 195 of file CNetworkOfPoses.h.

virtual mrpt::utils::CObject* mrpt::graphs::CNetworkOfPoses3DCov::duplicate ( ) const [virtual]

Returns a copy of the object, indepently of its class.

Implements mrpt::utils::CObject.

mrpt::utils::CObjectPtr mrpt::utils::CObject::duplicateGetSmartPtr ( ) const [inline, inherited]

Returns a copy of the object, indepently of its class, as a smart pointer (the newly created object will exist as long as any copy of this smart pointer).

Definition at line 151 of file CObject.h.

double mrpt::graphs::CNetworkOfPoses::getEdgeSquareError ( const typename BASE::edges_map_t::const_iterator itEdge,
bool  ignoreCovariances = true 
) const [inline, inherited]

Computes the square error of one pose constraints (edge) with respect to the global poses in 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 220 of file CNetworkOfPoses.h.

double mrpt::graphs::CNetworkOfPoses::getEdgeSquareError ( const TNodeID  from_id,
const TNodeID  to_id,
bool  ignoreCovariances = true 
) const [inline, inherited]

Computes the square error of one pose constraints (edge) with respect to the global poses in 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 226 of file CNetworkOfPoses.h.

References ASSERTMSG_, end(), and mrpt::format().

double mrpt::graphs::CNetworkOfPoses::getGlobalSquareError ( bool  ignoreCovariances = true) const [inline, inherited]

Computes the overall square error from all the pose constraints (edges) with respect to the global poses in 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 208 of file CNetworkOfPoses.h.

References mrpt::graphs::CDirectedGraph::end(), and begin().

virtual const mrpt::utils::TRuntimeClassId* mrpt::graphs::CNetworkOfPoses3DCov::GetRuntimeClass ( ) const [virtual]

Returns information about the class of an object in runtime.

Reimplemented from mrpt::utils::CSerializable.

void mrpt::graphs::CNetworkOfPoses::loadFromTextFile ( const std::string fileName,
bool  collapse_dup_edges = true 
) [inline, inherited]

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:
fileNameThe file to load.
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 180 of file CNetworkOfPoses.h.

size_t mrpt::graphs::CNetworkOfPoses::nodeCount ( ) const [inline, inherited]

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

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

Definition at line 244 of file CNetworkOfPoses.h.

virtual void mrpt::utils::CSerializable::readFromStream ( mrpt::utils::CStream in,
int  version 
) [protected, pure virtual, inherited]

Introduces a pure virtual method responsible for loading from a CStream This can not be used directly be users, instead use "stream >> object;" for reading it from a stream or "stream >> object_ptr;" if the class is unknown apriori.

Parameters:
inThe input binary stream where the object data must read from.
versionThe version of the object stored in the stream: use this version number in your code to know how to read the incoming data.
Exceptions:
std::exceptionOn any error, see CStream::ReadBuffer
See also:
CStream

Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.

void mrpt::graphs::CNetworkOfPoses::saveToTextFile ( const std::string fileName) const [inline, inherited]

Saves to a text file in the format used by TORO & HoG-man (more on the format 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 167 of file CNetworkOfPoses.h.

virtual void mrpt::utils::CSerializable::writeToStream ( mrpt::utils::CStream out,
int *  getVersion 
) const [protected, pure virtual, inherited]

Introduces a pure virtual method responsible for writing to a CStream.

This can not be used directly be users, instead use "stream << object;" for writing it to a stream.

Parameters:
outThe output binary stream where object must be dumped.
getVersionIf NULL, the object must be dumped. If not, only the version of the object dump must be returned in this pointer. This enables the versioning of objects dumping and backward compatibility with previously stored data.
Exceptions:
std::exceptionOn any error, see CStream::WriteBuffer
See also:
CStream

Implemented in mrpt::math::CMatrixD, and mrpt::math::CMatrix.


Friends And Related Function Documentation

friend class mrpt::utils::CStream [friend, inherited]

Member Data Documentation

Definition at line 318 of file CNetworkOfPoses.h.

Definition at line 318 of file CNetworkOfPoses.h.

Definition at line 139 of file CObject.h.

Definition at line 56 of file CSerializable.h.

Definition at line 318 of file CNetworkOfPoses.h.

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 153 of file CNetworkOfPoses.h.

The nodes (vertices) of the graph, with their estimated "global" (with respect to root) position, without an associated covariance.

See also:
dijkstra_nodes_estimate

Definition at line 145 of file CNetworkOfPoses.h.

The ID of the node that is the origin of coordinates, used as reference by all coordinates in .

By default, root is the ID "0".

Definition at line 148 of file CNetworkOfPoses.h.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011