43 #include <pcl/registration/edge_measurements.h>
44 #include <pcl/registration/vertex_estimates.h>
45 #include <pcl/exceptions.h>
47 #include "boost/graph/graph_traits.hpp"
50 namespace registration {
84 template <
typename GraphT>
87 using Ptr = shared_ptr<GraphHandler<GraphT>>;
88 using ConstPtr = shared_ptr<const GraphHandler<GraphT>>;
92 using Vertex =
typename boost::graph_traits<GraphT>::vertex_descriptor;
93 using Edge =
typename boost::graph_traits<GraphT>::edge_descriptor;
101 "pcl::registration::GraphHandler::GraphHandler ()",
113 graph_impl_.reset(
new GraphT());
117 "pcl::registration::GraphHandler::clear ()",
140 template <
class Po
intT>
143 const Eigen::Matrix4f& pose)
152 template <
class EstimateT>
156 return add_vertex(estimate, *graph_impl_);
166 template <
class InformationT>
170 const Eigen::Matrix4f& relative_transformation,
171 const InformationT& information_matrix)
174 v_start, v_end, relative_transformation, information_matrix),
182 template <
class MeasurementT>
186 return add_edge(measurement, *graph_impl_);
195 remove_vertex(v.v_, *graph_impl_);
204 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.
shared_ptr< const GraphHandler< GraphT >> ConstPtr
GraphConstPtr getGraph() const
Get a pointer to the BGL graph.
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...
shared_ptr< GraphHandler< GraphT >> Ptr
GraphHandler()
Empty constructor.
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.
~GraphHandler()
Destructor.
shared_ptr< const PointCloud< PointT > > ConstPtr
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.