41 #ifndef PCL_REGISTRATION_IMPL_PAIRWISE_GRAPH_REGISTRATION_HPP_
42 #define PCL_REGISTRATION_IMPL_PAIRWISE_GRAPH_REGISTRATION_HPP_
46 template <
typename GraphT,
typename Po
intT>
48 PairwiseGraphRegistration<GraphT, PointT>::computeRegistration()
50 if (!registration_method_) {
51 PCL_ERROR(
"[pcl::PairwiseGraphRegistration::computeRegistration] No registration "
56 typename std::vector<GraphHandlerVertex>::iterator last_vx_it =
57 last_vertices_.begin();
58 if (last_aligned_vertex_ == boost::graph_traits<GraphT>::null_vertex()) {
59 last_aligned_vertex_ = *last_vx_it;
64 registration_method_->setInputTarget(
65 boost::get_cloud<PointT>(last_aligned_vertex_, *(graph_handler_->getGraph())));
66 for (; last_vx_it < last_vertices_.end(); ++last_vx_it) {
67 registration_method_->setInputCloud(
68 boost::get_cloud<PointT>(*last_vx_it, *(graph_handler_->getGraph())));
70 const Eigen::Matrix4f last_aligned_vertex_pose =
71 boost::get_pose(last_aligned_vertex_, *(graph_handler_->getGraph()));
73 const Eigen::Matrix4f guess =
74 last_aligned_vertex_pose.transpose() *
75 boost::get_pose(*last_vx_it, *(graph_handler_->getGraph()));
76 registration_method_->align(fake_cloud, guess);
79 registration_method_->align(fake_cloud);
81 const Eigen::Matrix4f global_ref_final_tr =
82 last_aligned_vertex_pose * registration_method_->getFinalTransformation();
83 boost::set_estimate<PointT>(
84 *last_vx_it, global_ref_final_tr, *(graph_handler_->getGraph()));
85 last_aligned_vertex_ = *last_vx_it;
86 registration_method_->setInputTarget(
87 boost::get_cloud<PointT>(last_aligned_vertex_, *(graph_handler_->getGraph())));
PointCloud represents the base class in PCL for storing collections of 3D points.