Skip to content
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

Rename IncrementalICP IncrementalRegistration #1451

Merged
merged 1 commit into from
Dec 9, 2015
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
4 changes: 2 additions & 2 deletions registration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if(build)
"include/pcl/${SUBSYS_NAME}/ia_ransac.h"
"include/pcl/${SUBSYS_NAME}/icp.h"
"include/pcl/${SUBSYS_NAME}/joint_icp.h"
"include/pcl/${SUBSYS_NAME}/incremental_icp.h"
"include/pcl/${SUBSYS_NAME}/incremental_registration.h"
"include/pcl/${SUBSYS_NAME}/icp_nl.h"
"include/pcl/${SUBSYS_NAME}/lum.h"
"include/pcl/${SUBSYS_NAME}/elch.h"
Expand Down Expand Up @@ -94,7 +94,7 @@ if(build)
"include/pcl/${SUBSYS_NAME}/impl/ia_ransac.hpp"
"include/pcl/${SUBSYS_NAME}/impl/icp.hpp"
"include/pcl/${SUBSYS_NAME}/impl/joint_icp.hpp"
"include/pcl/${SUBSYS_NAME}/impl/incremental_icp.hpp"
"include/pcl/${SUBSYS_NAME}/impl/incremental_registration.hpp"
"include/pcl/${SUBSYS_NAME}/impl/icp_nl.hpp"
"include/pcl/${SUBSYS_NAME}/impl/elch.hpp"
"include/pcl/${SUBSYS_NAME}/impl/lum.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef PCL_REGISTRATION_IMPL_INCREMENTAL_ICP_HPP_
#define PCL_REGISTRATION_IMPL_INCREMENTAL_ICP_HPP_
#ifndef PCL_REGISTRATION_IMPL_INCREMENTAL_REGISTRATION_HPP_
#define PCL_REGISTRATION_IMPL_INCREMENTAL_REGISTRATION_HPP_

template <typename PointT, typename Scalar>
pcl::registration::IncrementalICP<PointT, Scalar>::IncrementalICP () :
pcl::registration::IncrementalRegistration<PointT, Scalar>::IncrementalRegistration () :
delta_transform_ (Matrix4::Identity ()),
abs_transform_ (Matrix4::Identity ())
{}

template <typename PointT, typename Scalar> bool
pcl::registration::IncrementalICP<PointT, Scalar>::registerCloud (const PointCloudConstPtr& cloud, const Matrix4& delta_estimate)
pcl::registration::IncrementalRegistration<PointT, Scalar>::registerCloud (const PointCloudConstPtr& cloud, const Matrix4& delta_estimate)
{
assert (icp_);
assert (registration_);

if (!last_cloud_)
{
Expand All @@ -56,48 +56,48 @@ pcl::registration::IncrementalICP<PointT, Scalar>::registerCloud (const PointClo
return (true);
}

icp_->setInputSource (cloud);
icp_->setInputTarget (last_cloud_);
registration_->setInputSource (cloud);
registration_->setInputTarget (last_cloud_);

{
pcl::PointCloud<PointT> p;
icp_->align (p, delta_estimate);
registration_->align (p, delta_estimate);
}

bool converged = icp_->hasConverged ();
bool converged = registration_->hasConverged ();

if ( converged ){
delta_transform_ = icp_->getFinalTransformation ();
delta_transform_ = registration_->getFinalTransformation ();
abs_transform_ = abs_transform_ * delta_transform_;
last_cloud_ = cloud;
}

return (converged);
}

template <typename PointT, typename Scalar> inline typename pcl::registration::IncrementalICP<PointT, Scalar>::Matrix4
pcl::registration::IncrementalICP<PointT, Scalar>::getDeltaTransform () const
template <typename PointT, typename Scalar> inline typename pcl::registration::IncrementalRegistration<PointT, Scalar>::Matrix4
pcl::registration::IncrementalRegistration<PointT, Scalar>::getDeltaTransform () const
{
return (delta_transform_);
}

template <typename PointT, typename Scalar> inline typename pcl::registration::IncrementalICP<PointT, Scalar>::Matrix4
pcl::registration::IncrementalICP<PointT, Scalar>::getAbsoluteTransform () const
template <typename PointT, typename Scalar> inline typename pcl::registration::IncrementalRegistration<PointT, Scalar>::Matrix4
pcl::registration::IncrementalRegistration<PointT, Scalar>::getAbsoluteTransform () const
{
return (abs_transform_);
}

template <typename PointT, typename Scalar> inline void
pcl::registration::IncrementalICP<PointT, Scalar>::reset ()
pcl::registration::IncrementalRegistration<PointT, Scalar>::reset ()
{
last_cloud_.reset ();
delta_transform_ = abs_transform_ = Matrix4::Identity ();
}

template <typename PointT, typename Scalar> inline void
pcl::registration::IncrementalICP<PointT, Scalar>::setICP (RegistrationPtr icp)
pcl::registration::IncrementalRegistration<PointT, Scalar>::setRegistration (RegistrationPtr registration)
{
icp_ = icp;
registration_ = registration;
}

#endif /*PCL_REGISTRATION_IMPL_INCREMENTAL_ICP_HPP_*/
#endif /*PCL_REGISTRATION_IMPL_INCREMENTAL_REGISTRATION_HPP_*/
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef PCL_REGISTRATION_INCREMENTAL_ICP_H_
#define PCL_REGISTRATION_INCREMENTAL_ICP_H_
#ifndef PCL_REGISTRATION_INCREMENTAL_REGISTRATION_H_
#define PCL_REGISTRATION_INCREMENTAL_REGISTRATION_H_

#include <pcl/point_cloud.h>
#include <pcl/registration/registration.h>
Expand All @@ -53,8 +53,8 @@ namespace pcl {
* icp->setMaxCorrespondenceDistance (0.05);
* icp->setMaximumIterations (50);
*
* IncrementalICP<PointXYZ> iicp;
* iicp.setICP (icp);
* IncrementalRegistration<PointXYZ> iicp;
* iicp.setRegistration (icp);
*
* while (true){
* PointCloud<PointXYZ>::Ptr cloud (new PointCloud<PointXYZ>);
Expand All @@ -71,25 +71,25 @@ namespace pcl {
* \ingroup registration
*/
template <typename PointT, typename Scalar = float>
class IncrementalICP {
class IncrementalRegistration {
public:
typedef typename pcl::PointCloud<PointT>::Ptr PointCloudPtr;
typedef typename pcl::PointCloud<PointT>::ConstPtr PointCloudConstPtr;

typedef typename pcl::Registration<PointT,PointT,Scalar>::Ptr RegistrationPtr;
typedef typename pcl::Registration<PointT,PointT,Scalar>::Matrix4 Matrix4;

IncrementalICP ();
IncrementalRegistration ();

/** \brief Empty destructor */
virtual ~IncrementalICP () {}
virtual ~IncrementalRegistration () {}

/** \brief Register new point cloud incrementally
* \note You have to set a valid registration object with @ref setICP before using this
* \note You have to set a valid registration object with @ref setRegistration before using this
* \note The class doesn't copy cloud. If you afterwards change cloud, that will affect this class.
* \param[in] cloud point cloud to register
* \param[in] delta_estimate estimated transform between last registered cloud and this one
* \return true if ICP converged
* \return true if registration converged
*/
bool
registerCloud (const PointCloudConstPtr& cloud, const Matrix4& delta_estimate = Matrix4::Identity ());
Expand All @@ -102,20 +102,20 @@ namespace pcl {
inline Matrix4
getAbsoluteTransform () const;

/** \brief Reset incremental ICP without resetting icp_ */
/** \brief Reset incremental Registration without resetting registration_ */
inline void
reset ();

/** \brief Set registration instance used to align clouds */
inline void
setICP (RegistrationPtr);
setRegistration (RegistrationPtr);
protected:

/** \brief last registered point cloud */
PointCloudConstPtr last_cloud_;

/** \brief registration instance to align clouds */
RegistrationPtr icp_;
RegistrationPtr registration_;

/** \brief estimated transforms */
Matrix4 delta_transform_;
Expand All @@ -125,6 +125,6 @@ namespace pcl {
}
}

#include <pcl/registration/impl/incremental_icp.hpp>
#include <pcl/registration/impl/incremental_registration.hpp>

#endif /*PCL_REGISTRATION_INCREMENTAL_ICP_H_*/
#endif /*PCL_REGISTRATION_INCREMENTAL_REGISTRATION_H_*/
6 changes: 3 additions & 3 deletions tools/icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include <pcl/point_types.h>
#include <pcl/registration/icp.h>
#include <pcl/registration/icp_nl.h>
#include <pcl/registration/incremental_icp.h>
#include <pcl/registration/incremental_registration.h>

#include <string>
#include <iostream>
Expand Down Expand Up @@ -87,8 +87,8 @@ main (int argc, char **argv)
icp->setMaxCorrespondenceDistance (dist);
icp->setRANSACOutlierRejectionThreshold (rans);

pcl::registration::IncrementalICP<PointType> iicp;
iicp.setICP (icp);
pcl::registration::IncrementalRegistration<PointType> iicp;
iicp.setRegistration (icp);

for (size_t i = 0; i < pcd_indices.size (); i++)
{
Expand Down