43 #include <pcl/registration/vertex_estimates.h>
44 #include <pcl/registration/edge_measurements.h>
45 #include <pcl/exceptions.h>
46 #include "boost/graph/graph_traits.hpp"
50 namespace registration
80 template <
typename GraphT>
84 using Ptr = shared_ptr<GraphHandler<GraphT> >;
85 using ConstPtr = shared_ptr<const GraphHandler<GraphT> >;
89 using Vertex =
typename boost::graph_traits<GraphT>::vertex_descriptor;
90 using Edge =
typename boost::graph_traits<GraphT>::edge_descriptor;
96 throw InitFailedException (
"Graph Initialization Failed", __FILE__,
"pcl::registration::GraphHandler::GraphHandler ()", __LINE__);
110 graph_impl_.reset (
new GraphT ());
112 throw InitFailedException (
"Graph Initialization Failed", __FILE__,
"pcl::registration::GraphHandler::clear ()", __LINE__);
134 template <
class Po
intT>
inline Vertex
144 template <
class EstimateT>
inline Vertex
147 return add_vertex (estimate, *graph_impl_);
157 template <
class InformationT>
inline Edge
159 const Eigen::Matrix4f& relative_transformation,
160 const InformationT& information_matrix)
170 template <
class MeasurementT>
inline Edge
173 return add_edge (measurement, *graph_impl_);
182 remove_vertex (v.v_, *graph_impl_);
191 remove_edge(e.e_, *graph_impl_);
typename boost::graph_traits< GraphT >::vertex_descriptor Vertex
bool deinit()
This method is called when graph_impl_ is going to be destroyed.
typename boost::graph_traits< GraphT >::edge_descriptor Edge
Edge addGenericConstraint(const MeasurementT &measurement)
Add a generic constraint created according to the given measurement.
shared_ptr< const GraphT > GraphConstPtr
void removeConstraint(const Edge &e)
Remove a constraint from the graph.
GraphConstPtr getGraph() const
Get a pointer to the BGL graph.
shared_ptr< const GraphHandler< GraphT > > ConstPtr
GraphHandler class is a wrapper for a general SLAM graph The actual graph class must fulfill the foll...
void clear()
Clear the graph.
An exception thrown when init can not be performed should be used in all the PCLBase class inheritant...
GraphHandler()
Empty constructor.
shared_ptr< const PointCloud< PointT > > ConstPtr
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.
shared_ptr< GraphHandler< GraphT > > Ptr
~GraphHandler()
Destructor.
Vertex addGenericVertex(const EstimateT &estimate)
Add a new generic vertex created according to the given estimate.
shared_ptr< GraphT > GraphPtr
void removeVertex(const Vertex &v)
Remove a vertex from the graph.
bool init()
This method is called right after the creation of graph_impl_.
GraphPtr getGraph()
Get a pointer to the BGL graph.
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.