octomap 1.5.0
|
A ScanGraph is a collection of ScanNodes, connected by ScanEdges. More...
Public Types | |
typedef std::vector< ScanEdge * > ::const_iterator | const_edge_iterator |
typedef std::vector< ScanNode * > ::const_iterator | const_iterator |
typedef std::vector< ScanEdge * > ::iterator | edge_iterator |
typedef std::vector< ScanNode * > ::iterator | iterator |
Public Member Functions | |
ScanEdge * | addEdge (ScanNode *first, ScanNode *second, pose6d constraint) |
Creates an edge between two ScanNodes. | |
ScanEdge * | addEdge (unsigned int first_id, unsigned int second_id) |
ScanNode * | addNode (Pointcloud *scan, pose6d pose) |
Creates a new ScanNode in the graph from a Pointcloud. | |
iterator | begin () |
const_iterator | begin () const |
void | clear () |
Clears all nodes and edges, and will delete the corresponding objects. | |
void | connectPrevious () |
Connect previously added ScanNode to the one before that. | |
void | crop (point3d lowerBound, point3d upperBound) |
Cut graph (all containing Pointclouds) to given BBX in global coords. | |
void | cropEachScan (point3d lowerBound, point3d upperBound) |
Cut Pointclouds to given BBX in local coords. | |
bool | edgeExists (unsigned int first_id, unsigned int second_id) |
edge_iterator | edges_begin () |
const_edge_iterator | edges_begin () const |
edge_iterator | edges_end () |
const_edge_iterator | edges_end () const |
iterator | end () |
const_iterator | end () const |
void | exportDot (std::string filename) |
std::vector< ScanEdge * > | getInEdges (ScanNode *node) |
std::vector< unsigned int > | getNeighborIDs (unsigned int id) |
ScanNode * | getNodeByID (unsigned int id) |
will return NULL if node was not found | |
unsigned int | getNumPoints (unsigned int max_id=-1) const |
std::vector< ScanEdge * > | getOutEdges (ScanNode *node) |
std::istream & | readBinary (std::ifstream &s) |
bool | readBinary (const std::string &filename) |
std::istream & | readEdgesASCII (std::istream &s) |
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. | |
void | readPlainASCII (const std::string &filename) |
ScanGraph () | |
unsigned int | size () const |
void | transformScans () |
Transform every scan according to its pose. | |
bool | writeBinary (const std::string &filename) const |
std::ostream & | writeBinary (std::ostream &s) const |
std::ostream & | writeEdgesASCII (std::ostream &s) const |
std::ostream & | writeNodePosesASCII (std::ostream &s) const |
~ScanGraph () | |
Protected Attributes | |
std::vector< ScanEdge * > | edges |
std::vector< ScanNode * > | nodes |
A ScanGraph is a collection of ScanNodes, connected by ScanEdges.
Each ScanNode contains a 3D scan performed from a pose.
typedef std::vector<ScanEdge*>::const_iterator octomap::ScanGraph::const_edge_iterator |
typedef std::vector<ScanNode*>::const_iterator octomap::ScanGraph::const_iterator |
typedef std::vector<ScanEdge*>::iterator octomap::ScanGraph::edge_iterator |
typedef std::vector<ScanNode*>::iterator octomap::ScanGraph::iterator |
octomap::ScanGraph::ScanGraph | ( | ) | [inline] |
octomap::ScanGraph::~ScanGraph | ( | ) |
References clear().
Creates an edge between two ScanNodes.
ScanGraph will delete the object when it's no longer needed, don't delete it yourself.
References edges, and OCTOMAP_ERROR.
Referenced by addEdge(), and connectPrevious().
ScanEdge * octomap::ScanGraph::addEdge | ( | unsigned int | first_id, |
unsigned int | second_id | ||
) |
References addEdge(), edgeExists(), getNodeByID(), octomath::Pose6D::inv(), OCTOMAP_ERROR, and octomap::ScanNode::pose.
ScanNode * octomap::ScanGraph::addNode | ( | Pointcloud * | scan, |
pose6d | pose | ||
) |
Creates a new ScanNode in the graph from a Pointcloud.
scan | Pointer 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. |
pose | 6D pose of the origin of the Pointcloud |
References nodes, and OCTOMAP_ERROR.
const_iterator octomap::ScanGraph::begin | ( | ) | const [inline] |
References nodes.
iterator octomap::ScanGraph::begin | ( | ) | [inline] |
References nodes.
Referenced by crop(), cropEachScan(), getNumPoints(), main(), readNodePosesASCII(), transformScans(), writeBinary(), and writeNodePosesASCII().
void octomap::ScanGraph::clear | ( | ) |
Clears all nodes and edges, and will delete the corresponding objects.
Referenced by readBinary(), and ~ScanGraph().
void octomap::ScanGraph::connectPrevious | ( | ) |
Connect previously added ScanNode to the one before that.
References addEdge(), nodes, and octomap::ScanNode::pose.
Referenced by readPlainASCII().
Cut graph (all containing Pointclouds) to given BBX in global coords.
References begin(), octomap::Pointcloud::crop(), end(), octomath::Pose6D::inv(), octomap::Pointcloud::transform(), and octomap::Pointcloud::transformAbsolute().
Referenced by cropEachScan().
bool octomap::ScanGraph::edgeExists | ( | unsigned int | first_id, |
unsigned int | second_id | ||
) |
References edges.
Referenced by addEdge(), and getNeighborIDs().
edge_iterator octomap::ScanGraph::edges_begin | ( | ) | [inline] |
References edges.
Referenced by readNodePosesASCII(), writeBinary(), and writeEdgesASCII().
const_edge_iterator octomap::ScanGraph::edges_begin | ( | ) | const [inline] |
References edges.
edge_iterator octomap::ScanGraph::edges_end | ( | ) | [inline] |
References edges.
Referenced by readNodePosesASCII(), writeBinary(), and writeEdgesASCII().
const_edge_iterator octomap::ScanGraph::edges_end | ( | ) | const [inline] |
References edges.
iterator octomap::ScanGraph::end | ( | ) | [inline] |
References nodes.
Referenced by crop(), cropEachScan(), getNumPoints(), main(), readNodePosesASCII(), transformScans(), writeBinary(), and writeNodePosesASCII().
const_iterator octomap::ScanGraph::end | ( | ) | const [inline] |
References nodes.
void octomap::ScanGraph::exportDot | ( | std::string | filename | ) |
References edges.
std::vector< unsigned int > octomap::ScanGraph::getNeighborIDs | ( | unsigned int | id | ) |
References edgeExists(), getNodeByID(), octomap::ScanNode::id, and nodes.
ScanNode * octomap::ScanGraph::getNodeByID | ( | unsigned int | id | ) |
will return NULL if node was not found
References nodes.
Referenced by addEdge(), getNeighborIDs(), octomap::ScanEdge::readASCII(), and octomap::ScanEdge::readBinary().
unsigned int octomap::ScanGraph::getNumPoints | ( | unsigned int | max_id = -1 | ) | const |
std::istream & octomap::ScanGraph::readBinary | ( | std::ifstream & | s | ) |
References clear(), edges, nodes, OCTOMAP_DEBUG, OCTOMAP_ERROR, OCTOMAP_ERROR_STR, OCTOMAP_WARNING_STR, octomap::ScanEdge::readBinary(), and octomap::ScanNode::readBinary().
Referenced by main(), and readBinary().
bool octomap::ScanGraph::readBinary | ( | const std::string & | filename | ) |
References OCTOMAP_ERROR_STR, and readBinary().
std::istream & octomap::ScanGraph::readEdgesASCII | ( | std::istream & | s | ) |
References edges, OCTOMAP_DEBUG, OCTOMAP_ERROR, and octomap::ScanEdge::readASCII().
std::istream & octomap::ScanGraph::readNodePosesASCII | ( | std::istream & | s | ) |
References begin(), edges_begin(), edges_end(), end(), and octomap::ScanNode::pose.
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
input | stream to read from |
References connectPrevious(), nodes, OCTOMAP_DEBUG_STR, OCTOMAP_ERROR_STR, octomap::ScanNode::pose, octomap::Pointcloud::push_back(), octomap::ScanNode::scan, and octomap::Pointcloud::size().
Referenced by main(), and readPlainASCII().
void octomap::ScanGraph::readPlainASCII | ( | const std::string & | filename | ) |
References OCTOMAP_ERROR_STR, and readPlainASCII().
unsigned int octomap::ScanGraph::size | ( | ) | const [inline] |
References nodes.
Referenced by main(), writeBinary(), and writeNodePosesASCII().
void octomap::ScanGraph::transformScans | ( | ) |
bool octomap::ScanGraph::writeBinary | ( | const std::string & | filename | ) | const |
References OCTOMAP_ERROR_STR, and writeBinary().
std::ostream & octomap::ScanGraph::writeBinary | ( | std::ostream & | s | ) | const |
References begin(), edges, edges_begin(), edges_end(), end(), OCTOMAP_DEBUG, and size().
Referenced by main(), and writeBinary().
std::ostream & octomap::ScanGraph::writeEdgesASCII | ( | std::ostream & | s | ) | const |
References edges, edges_begin(), edges_end(), and OCTOMAP_DEBUG_STR.
std::ostream & octomap::ScanGraph::writeNodePosesASCII | ( | std::ostream & | s | ) | const |
References begin(), end(), OCTOMAP_DEBUG, and size().
std::vector<ScanEdge*> octomap::ScanGraph::edges [protected] |
Referenced by addEdge(), clear(), edgeExists(), edges_begin(), edges_end(), exportDot(), getInEdges(), getOutEdges(), readBinary(), readEdgesASCII(), writeBinary(), and writeEdgesASCII().
std::vector<ScanNode*> octomap::ScanGraph::nodes [protected] |
Referenced by addNode(), begin(), clear(), connectPrevious(), end(), getNeighborIDs(), getNodeByID(), readBinary(), readPlainASCII(), and size().