Main MRPT website > C++ reference for MRPT 1.4.0
List of all members | Public Types | Public Member Functions | Protected Attributes
octomap::ScanGraph Class Reference

Detailed Description

A ScanGraph is a collection of ScanNodes, connected by ScanEdges.

Each ScanNode contains a 3D scan performed from a pose.

Definition at line 129 of file ScanGraph.h.

#include <mrpt/otherlibs/octomap/ScanGraph.h>

Public Types

typedef std::vector< ScanNode * >::iterator iterator
 
typedef std::vector< ScanNode * >::const_iterator const_iterator
 
typedef std::vector< ScanEdge * >::iterator edge_iterator
 
typedef std::vector< ScanEdge * >::const_iterator const_edge_iterator
 

Public Member Functions

 ScanGraph ()
 
 ~ScanGraph ()
 
void clear ()
 Clears all nodes and edges, and will delete the corresponding objects. More...
 
ScanNodeaddNode (Pointcloud *scan, pose6d pose)
 Creates a new ScanNode in the graph from a Pointcloud. More...
 
ScanEdgeaddEdge (ScanNode *first, ScanNode *second, pose6d constraint)
 Creates an edge between two ScanNodes. More...
 
ScanEdgeaddEdge (uint64_t first_id, uint64_t second_id)
 
ScanNodegetNodeByID (uint64_t id)
 will return NULL if node was not found More...
 
bool edgeExists (uint64_t first_id, uint64_t second_id)
 
void connectPrevious ()
 Connect previously added ScanNode to the one before that. More...
 
std::vector< uint64_t > getNeighborIDs (uint64_t id)
 
std::vector< ScanEdge * > getOutEdges (ScanNode *node)
 
std::vector< ScanEdge * > getInEdges (ScanNode *node)
 
void exportDot (std::string filename)
 
void transformScans ()
 Transform every scan according to its pose. More...
 
void crop (point3d lowerBound, point3d upperBound)
 Cut graph (all containing Pointclouds) to given BBX in global coords. More...
 
void cropEachScan (point3d lowerBound, point3d upperBound)
 Cut Pointclouds to given BBX in local coords. More...
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
size_t size () const
 
size_t getNumPoints (uint64_t max_id=-1) const
 
edge_iterator edges_begin ()
 
edge_iterator edges_end ()
 
const_edge_iterator edges_begin () const
 
const_edge_iterator edges_end () const
 
std::ostream & writeBinary (std::ostream &s) const
 
std::istream & readBinary (std::ifstream &s)
 
bool writeBinary (const std::string &filename) const
 
bool readBinary (const std::string &filename)
 
std::ostream & writeEdgesASCII (std::ostream &s) const
 
std::istream & readEdgesASCII (std::istream &s)
 
std::ostream & writeNodePosesASCII (std::ostream &s) const
 
std::istream & readNodePosesASCII (std::istream &s)
 
std::istream & readPlainASCII (std::istream &s)
 Reads in a ScanGraph from a "plain" ASCII file of the form NODE x y z R P Y x y z x y z x y z NODE x y z R P Y x y z. More...
 
void readPlainASCII (const std::string &filename)
 

Protected Attributes

std::vector< ScanNode * > nodes
 
std::vector< ScanEdge * > edges
 

Member Typedef Documentation

Definition at line 199 of file ScanGraph.h.

Definition at line 189 of file ScanGraph.h.

Definition at line 198 of file ScanGraph.h.

Definition at line 188 of file ScanGraph.h.

Constructor & Destructor Documentation

octomap::ScanGraph::ScanGraph ( )
inline

Definition at line 133 of file ScanGraph.h.

References octomap::ScanNode::pose, and octomap::ScanNode::scan.

octomap::ScanGraph::~ScanGraph ( )

Member Function Documentation

ScanEdge* octomap::ScanGraph::addEdge ( ScanNode first,
ScanNode second,
pose6d  constraint 
)

Creates an edge between two ScanNodes.

ScanGraph will delete the object when it's no longer needed, don't delete it yourself.

Parameters
firstScanNode
secondScanNode
constraint6D transform between the two nodes
Returns
ScanEdge* octomap::ScanGraph::addEdge ( uint64_t  first_id,
uint64_t  second_id 
)
ScanNode* octomap::ScanGraph::addNode ( Pointcloud scan,
pose6d  pose 
)

Creates a new ScanNode in the graph from a Pointcloud.

Parameters
scanPointer to a pointcloud to be added to the ScanGraph. ScanGraph will delete the object when it's no longer needed, don't delete it yourself.
pose6D pose of the origin of the Pointcloud
Returns
Pointer to the new node
iterator octomap::ScanGraph::begin ( )
inline

Definition at line 190 of file ScanGraph.h.

const_iterator octomap::ScanGraph::begin ( ) const
inline

Definition at line 192 of file ScanGraph.h.

void octomap::ScanGraph::clear ( )

Clears all nodes and edges, and will delete the corresponding objects.

void octomap::ScanGraph::connectPrevious ( )

Connect previously added ScanNode to the one before that.

void octomap::ScanGraph::crop ( point3d  lowerBound,
point3d  upperBound 
)

Cut graph (all containing Pointclouds) to given BBX in global coords.

void octomap::ScanGraph::cropEachScan ( point3d  lowerBound,
point3d  upperBound 
)

Cut Pointclouds to given BBX in local coords.

bool octomap::ScanGraph::edgeExists ( uint64_t  first_id,
uint64_t  second_id 
)
Returns
true when an edge between first_id and second_id exists
edge_iterator octomap::ScanGraph::edges_begin ( )
inline

Definition at line 200 of file ScanGraph.h.

const_edge_iterator octomap::ScanGraph::edges_begin ( ) const
inline

Definition at line 202 of file ScanGraph.h.

edge_iterator octomap::ScanGraph::edges_end ( )
inline

Definition at line 201 of file ScanGraph.h.

const_edge_iterator octomap::ScanGraph::edges_end ( ) const
inline
iterator octomap::ScanGraph::end ( )
inline

Definition at line 191 of file ScanGraph.h.

const_iterator octomap::ScanGraph::end ( ) const
inline

Definition at line 193 of file ScanGraph.h.

void octomap::ScanGraph::exportDot ( std::string  filename)
std::vector<ScanEdge*> octomap::ScanGraph::getInEdges ( ScanNode node)
std::vector<uint64_t> octomap::ScanGraph::getNeighborIDs ( uint64_t  id)
ScanNode* octomap::ScanGraph::getNodeByID ( uint64_t  id)

will return NULL if node was not found

size_t octomap::ScanGraph::getNumPoints ( uint64_t  max_id = -1) const
std::vector<ScanEdge*> octomap::ScanGraph::getOutEdges ( ScanNode node)
std::istream& octomap::ScanGraph::readBinary ( std::ifstream &  s)
bool octomap::ScanGraph::readBinary ( const std::string &  filename)
std::istream& octomap::ScanGraph::readEdgesASCII ( std::istream &  s)
std::istream& octomap::ScanGraph::readNodePosesASCII ( std::istream &  s)
std::istream& octomap::ScanGraph::readPlainASCII ( std::istream &  s)

Reads in a ScanGraph from a "plain" ASCII file of the form NODE x y z R P Y x y z x y z x y z NODE x y z R P Y x y z.

Lines starting with the NODE keyword contain the 6D pose of a scan node, all 3D point following until the next NODE keyword (or end of file) are inserted into that scan node as pointcloud in its local coordinate frame

Parameters
inputstream to read from
Returns
read stream
void octomap::ScanGraph::readPlainASCII ( const std::string &  filename)
size_t octomap::ScanGraph::size ( ) const
inline

Definition at line 195 of file ScanGraph.h.

void octomap::ScanGraph::transformScans ( )

Transform every scan according to its pose.

std::ostream& octomap::ScanGraph::writeBinary ( std::ostream &  s) const
bool octomap::ScanGraph::writeBinary ( const std::string &  filename) const
std::ostream& octomap::ScanGraph::writeEdgesASCII ( std::ostream &  s) const
std::ostream& octomap::ScanGraph::writeNodePosesASCII ( std::ostream &  s) const

Member Data Documentation

std::vector<ScanEdge*> octomap::ScanGraph::edges
protected

Definition at line 240 of file ScanGraph.h.

std::vector<ScanNode*> octomap::ScanGraph::nodes
protected

Definition at line 239 of file ScanGraph.h.




Page generated by Doxygen 1.8.11 for MRPT 1.4.0 SVN:Unversioned directory at Mon May 30 18:20:32 UTC 2016