Refactors to use pcl-1.7

This commit is contained in:
William Woodall
2013-07-09 18:56:23 -07:00
committed by Paul Bovbel
parent 4e64cb25e7
commit a3840127f8
21 changed files with 147 additions and 76 deletions
@@ -66,9 +66,13 @@ namespace pcl_ros
PointCloud2 &output)
{
boost::mutex::scoped_lock lock (mutex_);
impl_.setInputCloud (input);
pcl::PCLPointCloud2::Ptr pcl_input;
pcl_conversions::toPCL(*(input), *(pcl_input));
impl_.setInputCloud (pcl_input);
impl_.setIndices (indices);
impl_.filter (output);
pcl::PCLPointCloud2 pcl_output;
impl_.filter (pcl_output);
pcl_conversions::moveFromPCL(pcl_output, output);
}
/** \brief Child initialization routine.
@@ -84,7 +88,7 @@ namespace pcl_ros
private:
/** \brief The PCL filter implementation used. */
pcl::ExtractIndices<sensor_msgs::PointCloud2> impl_;
pcl::ExtractIndices<pcl::PCLPointCloud2> impl_;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
@@ -64,9 +64,13 @@ namespace pcl_ros
PointCloud2 &output)
{
boost::mutex::scoped_lock lock (mutex_);
impl_.setInputCloud (input);
pcl::PCLPointCloud2::Ptr pcl_input;
pcl_conversions::toPCL (*(input), *(pcl_input));
impl_.setInputCloud (pcl_input);
impl_.setIndices (indices);
impl_.filter (output);
pcl::PCLPointCloud2 pcl_output;
impl_.filter (pcl_output);
pcl_conversions::moveFromPCL(pcl_output, output);
}
/** \brief Child initialization routine.
@@ -85,7 +89,7 @@ namespace pcl_ros
private:
/** \brief The PCL filter implementation used. */
pcl::PassThrough<sensor_msgs::PointCloud2> impl_;
pcl::PassThrough<pcl::PCLPointCloud2> impl_;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
@@ -68,10 +68,16 @@ namespace pcl_ros
filter (const PointCloud2::ConstPtr &input, const IndicesPtr &indices,
PointCloud2 &output)
{
impl_.setInputCloud (input);
pcl::PCLPointCloud2::Ptr pcl_input;
pcl_conversions::toPCL (*(input), *(pcl_input));
impl_.setInputCloud (pcl_input);
impl_.setIndices (indices);
impl_.setModelCoefficients (model_);
impl_.filter (output);
pcl::ModelCoefficients::Ptr pcl_model;
pcl_conversions::toPCL(*(model_), *(pcl_model));
impl_.setModelCoefficients (pcl_model);
pcl::PCLPointCloud2 pcl_output;
impl_.filter (pcl_output);
pcl_conversions::moveFromPCL(pcl_output, output);
}
private:
@@ -85,7 +91,7 @@ namespace pcl_ros
boost::shared_ptr<message_filters::Synchronizer<sync_policies::ExactTime<PointCloud2, PointIndices, ModelCoefficients> > > sync_input_indices_model_e_;
boost::shared_ptr<message_filters::Synchronizer<sync_policies::ApproximateTime<PointCloud2, PointIndices, ModelCoefficients> > > sync_input_indices_model_a_;
/** \brief The PCL filter implementation used. */
pcl::ProjectInliers<PointCloud2> impl_;
pcl::ProjectInliers<pcl::PCLPointCloud2> impl_;
/** \brief Nodelet initialization routine. */
virtual void
@@ -61,9 +61,13 @@ namespace pcl_ros
filter (const PointCloud2::ConstPtr &input, const IndicesPtr &indices,
PointCloud2 &output)
{
impl_.setInputCloud (input);
pcl::PCLPointCloud2::Ptr pcl_input;
pcl_conversions::toPCL (*(input), *(pcl_input));
impl_.setInputCloud (pcl_input);
impl_.setIndices (indices);
impl_.filter (output);
pcl::PCLPointCloud2 pcl_output;
impl_.filter (pcl_output);
pcl_conversions::moveFromPCL(pcl_output, output);
}
/** \brief Child initialization routine.
@@ -73,7 +77,7 @@ namespace pcl_ros
private:
/** \brief The PCL filter implementation used. */
pcl::RadiusOutlierRemoval<sensor_msgs::PointCloud2> impl_;
pcl::RadiusOutlierRemoval<pcl::PCLPointCloud2> impl_;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
@@ -74,9 +74,13 @@ namespace pcl_ros
PointCloud2 &output)
{
boost::mutex::scoped_lock lock (mutex_);
impl_.setInputCloud (input);
pcl::PCLPointCloud2::Ptr pcl_input;
pcl_conversions::toPCL(*(input), *(pcl_input));
impl_.setInputCloud (pcl_input);
impl_.setIndices (indices);
impl_.filter (output);
pcl::PCLPointCloud2 pcl_output;
impl_.filter (pcl_output);
pcl_conversions::moveFromPCL(pcl_output, output);
}
/** \brief Child initialization routine.
@@ -93,7 +97,7 @@ namespace pcl_ros
private:
/** \brief The PCL filter implementation used. */
pcl::StatisticalOutlierRemoval<sensor_msgs::PointCloud2> impl_;
pcl::StatisticalOutlierRemoval<pcl::PCLPointCloud2> impl_;
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
+1 -1
View File
@@ -57,7 +57,7 @@ namespace pcl_ros
boost::shared_ptr <dynamic_reconfigure::Server<pcl_ros::VoxelGridConfig> > srv_;
/** \brief The PCL filter implementation used. */
pcl::VoxelGrid<sensor_msgs::PointCloud2> impl_;
pcl::VoxelGrid<pcl::PCLPointCloud2> impl_;
/** \brief Call the actual filter.
* \param input the input point cloud dataset
@@ -45,6 +45,8 @@
#include <message_filters/sync_policies/exact_time.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <sensor_msgs/PointCloud2.h>
namespace pcl_ros
{
/** \brief @b PointCloudConcatenateFieldsSynchronizer is a special form of data synchronizer: it listens for a set of
+2 -2
View File
@@ -47,7 +47,7 @@
#include <sensor_msgs/PointCloud2.h>
// PCL includes
#include <pcl_msgs/PointIndices.h>
#include <pcl/ModelCoefficients.h>
#include <pcl_msgs/ModelCoefficients.h>
#include <pcl/point_types.h>
#include <pcl_conversions/pcl_conversions.h>
#include "pcl_ros/point_cloud.h"
@@ -82,7 +82,7 @@ namespace pcl_ros
typedef PointIndices::Ptr PointIndicesPtr;
typedef PointIndices::ConstPtr PointIndicesConstPtr;
typedef pcl::ModelCoefficients ModelCoefficients;
typedef pcl_msgs::ModelCoefficients ModelCoefficients;
typedef ModelCoefficients::Ptr ModelCoefficientsPtr;
typedef ModelCoefficients::ConstPtr ModelCoefficientsConstPtr;
@@ -112,7 +112,7 @@ namespace pcl_ros
/** \brief Null passthrough filter, used for pushing empty elements in the
* synchronizer */
message_filters::PassThrough<PointIndices> nf_pi_;
message_filters::PassThrough<pcl_msgs::PointIndices> nf_pi_;
/** \brief Nodelet initialization routine. */
virtual void onInit ();
@@ -149,7 +149,7 @@ namespace pcl_ros
inline void
input_callback (const PointCloudConstPtr &input)
{
indices_.header = input->header;
indices_.header = fromPCL(input->header);
PointIndicesConstPtr indices;
indices.reset (new PointIndices (indices_));
nf_pi_.add (indices);
@@ -220,7 +220,7 @@ namespace pcl_ros
input_callback (const PointCloudConstPtr &cloud)
{
PointIndices indices;
indices.header.stamp = cloud->header.stamp;
indices.header.stamp = fromPCL(cloud->header).stamp;
nf_.add (boost::make_shared<PointIndices> (indices));
}
@@ -241,7 +241,7 @@ namespace pcl_ros
/** \brief Model callback
* \param model the sample consensus model found
*/
void axis_callback (const pcl::ModelCoefficientsConstPtr &model);
void axis_callback (const pcl_msgs::ModelCoefficientsConstPtr &model);
/** \brief Dynamic reconfigure callback
* \param config the config object
@@ -59,7 +59,7 @@ namespace pcl_ros
class MovingLeastSquares : public PCLNodelet
{
typedef pcl::PointXYZ PointIn;
typedef pcl::Normal NormalOut;
typedef pcl::PointNormal NormalOut;
typedef pcl::PointCloud<PointIn> PointCloudIn;
typedef PointCloudIn::Ptr PointCloudInPtr;