Skip to content

Revert 8ed661a, which introduced an undeclared variable and broke compilation #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion registration/include/pcl/registration/impl/ppf_registration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ pcl::PPFHashMapSearch::nearestNeighborSearch (float &f1, float &f2, float &f3, f
}


//////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointSource, typename PointTarget> void
pcl::PPFRegistration<PointSource, PointTarget>::setInputTarget (const PointCloudTargetConstPtr &cloud)
{
Registration<PointSource, PointTarget>::setInputTarget (cloud);

scene_search_tree_ = typename pcl::KdTreeFLANN<PointTarget>::Ptr (new pcl::KdTreeFLANN<PointTarget>);
scene_search_tree_->setInputCloud (target_);
}

//////////////////////////////////////////////////////////////////////////////////////////////
template <typename PointSource, typename PointTarget> void
pcl::PPFRegistration<PointSource, PointTarget>::computeTransformation (PointCloudSource &output, const Eigen::Matrix4f& guess)
Expand Down Expand Up @@ -148,7 +158,7 @@ pcl::PPFRegistration<PointSource, PointTarget>::computeTransformation (PointClou
// For every other point in the scene => now have pair (s_r, s_i) fixed
std::vector<int> indices;
std::vector<float> distances;
tree_->radiusSearch (target_->points[scene_reference_index],
scene_search_tree_->radiusSearch (target_->points[scene_reference_index],
search_method_->getModelDiameter () /2,
indices,
distances);
Expand Down
9 changes: 9 additions & 0 deletions registration/include/pcl/registration/ppf_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,12 @@ namespace pcl
inline PPFHashMapSearch::Ptr
getSearchMethod () { return search_method_; }

/** \brief Provide a pointer to the input target (e.g., the point cloud that we want to align the input source to)
* \param cloud the input point cloud target
*/
void
setInputTarget (const PointCloudTargetConstPtr &cloud);


private:
/** \brief Method that calculates the transformation between the input_ and target_ point clouds, based on the PPF features */
Expand All @@ -251,6 +257,9 @@ namespace pcl
* poses are considered to be in the same cluster (for the clustering phase of the algorithm) */
float clustering_position_diff_threshold_, clustering_rotation_diff_threshold_;

/** \brief use a kd-tree with range searches of range max_dist to skip an O(N) pass through the point cloud */
typename pcl::KdTreeFLANN<PointTarget>::Ptr scene_search_tree_;

/** \brief static method used for the std::sort function to order two PoseWithVotes
* instances by their number of votes*/
static bool
Expand Down