41 #ifndef PCL_REGISTRATION_IMPL_PAIRWISE_GRAPH_REGISTRATION_HPP_
42 #define PCL_REGISTRATION_IMPL_PAIRWISE_GRAPH_REGISTRATION_HPP_
48 template <
typename GraphT,
typename Po
intT>
void
49 PairwiseGraphRegistration<GraphT, PointT>::computeRegistration ()
51 if (!registration_method_)
53 PCL_ERROR (
"[pcl::PairwiseGraphRegistration::computeRegistration] No registration method set!\n");
57 typename std::vector<GraphHandlerVertex>::iterator last_vx_it = last_vertices_.begin ();
58 if (last_aligned_vertex_ == boost::graph_traits<GraphT>::null_vertex ())
60 last_aligned_vertex_ = *last_vx_it;
65 registration_method_->setInputTarget (boost::get_cloud<PointT> (last_aligned_vertex_, *(graph_handler_->getGraph ())));
66 for(; last_vx_it < last_vertices_.end (); ++last_vx_it)
68 registration_method_->setInputCloud (boost::get_cloud<PointT> (*last_vx_it, *(graph_handler_->getGraph ())));
70 const Eigen::Matrix4f last_aligned_vertex_pose = boost::get_pose (last_aligned_vertex_, *(graph_handler_->getGraph ()));
73 const Eigen::Matrix4f guess = last_aligned_vertex_pose.transpose () * boost::get_pose (*last_vx_it, *(graph_handler_->getGraph ()));
74 registration_method_->align (fake_cloud, guess);
76 registration_method_->align (fake_cloud);
78 const Eigen::Matrix4f global_ref_final_tr = last_aligned_vertex_pose * registration_method_->getFinalTransformation ();
79 boost::set_estimate<PointT> (*last_vx_it, global_ref_final_tr, *(graph_handler_->getGraph ()));
80 last_aligned_vertex_ = *last_vx_it;
81 registration_method_->setInputTarget (boost::get_cloud<PointT> (last_aligned_vertex_, *(graph_handler_->getGraph ())));
PointCloud represents the base class in PCL for storing collections of 3D points.