41 #ifndef PCL_GRAPH_HANDLER_H_
42 #define PCL_GRAPH_HANDLER_H_
44 #include <pcl/registration/vertex_estimates.h>
45 #include <pcl/registration/edge_measurements.h>
46 #include <pcl/exceptions.h>
47 #include "boost/graph/graph_traits.hpp"
51 namespace registration
81 template <
typename GraphT>
85 typedef boost::shared_ptr<GraphHandler<GraphT> >
Ptr;
86 typedef boost::shared_ptr<const GraphHandler<GraphT> >
ConstPtr;
90 typedef typename boost::graph_traits<GraphT>::vertex_descriptor
Vertex;
91 typedef typename boost::graph_traits<GraphT>::edge_descriptor
Edge;
97 throw InitFailedException (
"Graph Initialization Failed", __FILE__,
"pcl::registration::GraphHandler::GraphHandler ()", __LINE__);
111 graph_impl_.reset (
new GraphT ());
113 throw InitFailedException (
"Graph Initialization Failed", __FILE__,
"pcl::registration::GraphHandler::clear ()", __LINE__);
135 template <
class Po
intT>
inline Vertex
145 template <
class EstimateT>
inline Vertex
148 return add_vertex (estimate, *graph_impl_);
158 template <
class InformationT>
inline Edge
160 const Eigen::Matrix4f& relative_transformation,
161 const InformationT& information_matrix)
171 template <
class MeasurementT>
inline Edge
174 return add_edge (measurement, *graph_impl_);
183 remove_vertex (v.v_, *graph_impl_);
192 remove_edge(e.e_, *graph_impl_);
216 #endif // PCL_GRAPH_HANDLER_H_
boost::graph_traits< GraphT >::vertex_descriptor Vertex
GraphHandler()
Empty constructor.
void removeVertex(const Vertex &v)
Remove a vertex from the graph.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
boost::shared_ptr< GraphT > GraphPtr
An exception thrown when init can not be performed should be used in all the PCLBase class inheritant...
boost::shared_ptr< const GraphT > GraphConstPtr
Edge addGenericConstraint(const MeasurementT &measurement)
Add a generic constraint created according to the given measurement.
bool init()
This method is called right after the creation of graph_impl_.
boost::shared_ptr< const GraphHandler< GraphT > > ConstPtr
void removeConstraint(const Edge &e)
Remove a constraint from the graph.
boost::graph_traits< GraphT >::edge_descriptor Edge
void clear()
Clear the graph.
GraphHandler class is a wrapper for a general SLAM graph The actual graph class must fulfil the follo...
GraphPtr getGraph()
Get a pointer to the BGL graph.
bool deinit()
This method is called when graph_impl_ is going to be destroyed.
Vertex addPointCloud(const typename pcl::PointCloud< PointT >::ConstPtr &cloud, const Eigen::Matrix4f &pose)
Add a new point cloud to the graph and return the new vertex.
GraphConstPtr getGraph() const
Get a pointer to the BGL graph.
Vertex addGenericVertex(const EstimateT &estimate)
Add a new generic vertex created according to the given estimate.
~GraphHandler()
Destructor.
boost::shared_ptr< GraphHandler< GraphT > > Ptr
Edge addPoseConstraint(const Vertex &v_start, const Vertex &v_end, const Eigen::Matrix4f &relative_transformation, const InformationT &information_matrix)
Add a new constraint between two poses.