diff --git a/.travis.yml b/.travis.yml index d4f28bf3ada..b1a34d54676 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,15 +3,8 @@ compiler: - gcc before_install: - sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl -y - - sudo add-apt-repository ppa:nmi/vim-snapshots -y - sudo apt-get update -d - - sudo apt-get install cmake libvtk5-qt4-dev libflann-dev libeigen3-dev libopenni-dev libqhull-dev libboost-filesystem1.53-dev libboost-iostreams1.53-dev libboost-thread1.53-dev + - sudo apt-get install cmake libvtk5-qt4-dev libflann-dev libeigen3-dev libopenni-dev libqhull-dev libboost-filesystem-dev libboost-iostreams-dev libboost-thread-dev script: - mkdir build && cd build - - cmake -DPCL_ONLY_CORE_POINT_TYPES=ON .. && make -j2 && make test -notifications: - recipients: - - julius@kammerl.com - email: - on_success: change - on_failure: always + - cmake -DCMAKE_C_FLAGS="-Wall -Wextra -Wabi -Wconversion -O2" -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wabi -Wconversion -O2" -DPCL_ONLY_CORE_POINT_TYPES=ON .. && make -j2 && make test diff --git a/CMakeLists.txt b/CMakeLists.txt index 99ab761e5e9..5a0a7c07a4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -276,8 +276,6 @@ find_package(Qhull) # Cuda include(${PCL_SOURCE_DIR}/cmake/pcl_find_cuda.cmake) -# Find ROS -include(${PCL_SOURCE_DIR}/cmake/pcl_find_ros.cmake) # Find QT4 find_package(Qt4) if (QT4_FOUND) diff --git a/PCLConfig.cmake.in b/PCLConfig.cmake.in index 6c534a15c09..6f3d6e08e96 100644 --- a/PCLConfig.cmake.in +++ b/PCLConfig.cmake.in @@ -267,7 +267,7 @@ macro(find_VTK) endif(PCL_ALL_IN_ONE_INSTALLER) find_package(VTK ${QUIET_}) if (VTK_FOUND AND NOT ANDROID) - set(VTK_LIBRARIES vtkCommon vtkRendering vtkHybrid) + set(VTK_LIBRARIES vtkCommon vtkRendering vtkHybrid vtkCharts) endif(VTK_FOUND AND NOT ANDROID) endmacro(find_VTK) @@ -671,6 +671,8 @@ endif(NOT "${PCL_DEFINITIONS}" STREQUAL "") pcl_remove_duplicate_libraries(PCL_LIBRARIES PCL_DEDUP_LIBRARIES) set(PCL_LIBRARIES ${PCL_DEDUP_LIBRARIES}) +# Add 3rd party libraries, as user code might include our .HPP implementations +list(APPEND PCL_LIBRARIES ${BOOST_LIBRARIES} ${QHULL_LIBRARIES} ${OPENNI_LIBRARIES} ${FLANN_LIBRARIES} ${VTK_LIBRARIES}) find_package_handle_standard_args(PCL DEFAULT_MSG PCL_LIBRARIES PCL_INCLUDE_DIRS) mark_as_advanced(PCL_LIBRARIES PCL_INCLUDE_DIRS PCL_LIBRARY_DIRS) diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/cloud_item.hpp b/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/cloud_item.hpp index 014a72799a8..ee1e995d1a3 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/cloud_item.hpp +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/cloud_item.hpp @@ -67,7 +67,7 @@ pcl::cloud_composer::CloudItem::printNumPoints () const template pcl::cloud_composer::CloudItem* pcl::cloud_composer::CloudItem::createCloudItemFromTemplate (const QString name, typename PointCloud::Ptr cloud_ptr) { - sensor_msgs::PointCloud2::Ptr cloud_blob = boost::make_shared (); + pcl::PCLPointCloud2::Ptr cloud_blob = boost::make_shared (); toROSMsg (*cloud_ptr, *cloud_blob); CloudItem* cloud_item = new CloudItem ( name, cloud_blob, Eigen::Vector4f (), Eigen::Quaternionf (), false); cloud_item->setData (QVariant::fromValue(cloud_ptr), ItemDataRole::CLOUD_TEMPLATED); diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/merge_selection.hpp b/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/merge_selection.hpp index 61144869f55..df5e99b7b86 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/merge_selection.hpp +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/impl/merge_selection.hpp @@ -90,7 +90,7 @@ pcl::cloud_composer::MergeSelection::performTemplatedAction (QList data (ItemDataRole::ORIGIN).value (); //Eigen::Quaternionf source_orientation = input_cloud_item->data (ItemDataRole::ORIENTATION).value (); - //sensor_msgs::PointCloud2::Ptr cloud_blob = boost::make_shared ();; + //pcl::PCLPointCloud2::Ptr cloud_blob = boost::make_shared ();; //toROSMsg (*original_minus_indices, *cloud_blob); //CloudItem* new_cloud_item = new CloudItem (input_cloud_item->text () //, cloud_blob diff --git a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h index 7442d1d480f..df1b627c319 100644 --- a/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h +++ b/apps/cloud_composer/include/pcl/apps/cloud_composer/items/cloud_item.h @@ -43,8 +43,8 @@ #include //Typedefs to make things sane -typedef pcl::visualization::PointCloudGeometryHandler GeometryHandler; -typedef pcl::visualization::PointCloudColorHandler ColorHandler; +typedef pcl::visualization::PointCloudGeometryHandler GeometryHandler; +typedef pcl::visualization::PointCloudColorHandler ColorHandler; namespace pcl { @@ -71,7 +71,7 @@ namespace pcl EIGEN_MAKE_ALIGNED_OPERATOR_NEW CloudItem (const QString name, - const sensor_msgs::PointCloud2::Ptr cloud_ptr, + const pcl::PCLPointCloud2::Ptr cloud_ptr, const Eigen::Vector4f& origin = Eigen::Vector4f (), const Eigen::Quaternionf& orientation = Eigen::Quaternionf (), bool make_templated_cloud = true); @@ -125,7 +125,7 @@ namespace pcl private: //These are just stored for convenience - sensor_msgs::PointCloud2::Ptr cloud_blob_ptr_; + pcl::PCLPointCloud2::Ptr cloud_blob_ptr_; ColorHandler::ConstPtr color_handler_; GeometryHandler::ConstPtr geometry_handler_; @@ -176,7 +176,7 @@ namespace pcl } //Add PointCloud types to QT MetaType System -Q_DECLARE_METATYPE (sensor_msgs::PointCloud2::ConstPtr); +Q_DECLARE_METATYPE (pcl::PCLPointCloud2::ConstPtr); Q_DECLARE_METATYPE (GeometryHandler::ConstPtr); Q_DECLARE_METATYPE (ColorHandler::ConstPtr); Q_DECLARE_METATYPE (Eigen::Vector4f); diff --git a/apps/cloud_composer/src/cloud_composer.cpp b/apps/cloud_composer/src/cloud_composer.cpp index b5c331de2f7..6143f0c460f 100644 --- a/apps/cloud_composer/src/cloud_composer.cpp +++ b/apps/cloud_composer/src/cloud_composer.cpp @@ -21,7 +21,7 @@ pcl::cloud_composer::ComposerMainWindow::ComposerMainWindow (QWidget *parent) this->setCorner (Qt::BottomRightCorner, Qt::RightDockWidgetArea); //Register types in Qt - qRegisterMetaType ("PointCloud2Ptr"); + qRegisterMetaType ("PCLPointCloud2Ptr"); qRegisterMetaType ("GeometryHandlerConstPtr"); qRegisterMetaType ("ColorHandlerConstPtr"); qRegisterMetaType ("EigenVector4f"); diff --git a/apps/cloud_composer/src/items/cloud_item.cpp b/apps/cloud_composer/src/items/cloud_item.cpp index 4796fb7fa3c..58d7b6f49b3 100644 --- a/apps/cloud_composer/src/items/cloud_item.cpp +++ b/apps/cloud_composer/src/items/cloud_item.cpp @@ -8,7 +8,7 @@ #include pcl::cloud_composer::CloudItem::CloudItem (QString name, - sensor_msgs::PointCloud2::Ptr cloud_ptr, + pcl::PCLPointCloud2::Ptr cloud_ptr, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation, bool make_templated_cloud) @@ -25,15 +25,15 @@ pcl::cloud_composer::CloudItem::CloudItem (QString name, // qDebug () << "Cloud size after passthrough : "<width<<"x"<height; cloud_blob_ptr_ = cloud_ptr; - sensor_msgs::PointCloud2::ConstPtr const_cloud_ptr = cloud_ptr; + pcl::PCLPointCloud2::ConstPtr const_cloud_ptr = cloud_ptr; this->setData (QVariant::fromValue (const_cloud_ptr), ItemDataRole::CLOUD_BLOB); this->setData (QVariant::fromValue (origin_), ItemDataRole::ORIGIN); this->setData (QVariant::fromValue (orientation_), ItemDataRole::ORIENTATION); //Create a color and geometry handler for this cloud - color_handler_.reset (new pcl::visualization::PointCloudColorHandlerRGBField (cloud_ptr)); + color_handler_.reset (new pcl::visualization::PointCloudColorHandlerRGBField (cloud_ptr)); this->setData (QVariant::fromValue (color_handler_), ItemDataRole::COLOR_HANDLER); - geometry_handler_.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ (cloud_ptr)); + geometry_handler_.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ (cloud_ptr)); this->setData (QVariant::fromValue (geometry_handler_), ItemDataRole::GEOMETRY_HANDLER); properties_->addCategory ("Core Properties"); @@ -56,7 +56,7 @@ pcl::cloud_composer::CloudItem::CloudItem (QString name, pcl::cloud_composer::CloudItem* pcl::cloud_composer::CloudItem::clone () const { - sensor_msgs::PointCloud2::Ptr cloud_copy (new sensor_msgs::PointCloud2 (*cloud_blob_ptr_)); + pcl::PCLPointCloud2::Ptr cloud_copy (new pcl::PCLPointCloud2 (*cloud_blob_ptr_)); //Vector4f and Quaternionf do deep copies using constructor CloudItem* new_item = new CloudItem (this->text (), cloud_copy, origin_,orientation_); @@ -114,8 +114,8 @@ pcl::cloud_composer::CloudItem::setTemplateCloudFromBlob () if (! template_cloud_set_ ) { int num_fields = cloud_blob_ptr_->fields.size (); - std::vector::iterator end = cloud_blob_ptr_->fields.end (); - std::vector::iterator itr = cloud_blob_ptr_->fields.begin (); + std::vector::iterator end = cloud_blob_ptr_->fields.end (); + std::vector::iterator itr = cloud_blob_ptr_->fields.begin (); QStringList field_names; for ( itr = cloud_blob_ptr_->fields.begin () ; itr != end; ++itr) { @@ -194,8 +194,8 @@ pcl::cloud_composer::CloudItem::checkIfFinite () if (! cloud_blob_ptr_) return false; - sensor_msgs::PointCloud2::Ptr cloud_filtered = boost::make_shared (); - pcl::PassThrough pass_filter; + pcl::PCLPointCloud2::Ptr cloud_filtered = boost::make_shared (); + pcl::PassThrough pass_filter; pass_filter.setInputCloud (cloud_blob_ptr_); pass_filter.setKeepOrganized (false); pass_filter.filter (*cloud_filtered); diff --git a/apps/cloud_composer/src/items/normals_item.cpp b/apps/cloud_composer/src/items/normals_item.cpp index 58dda7678c4..954693a8f5b 100644 --- a/apps/cloud_composer/src/items/normals_item.cpp +++ b/apps/cloud_composer/src/items/normals_item.cpp @@ -42,7 +42,7 @@ pcl::cloud_composer::NormalsItem::paintView (boost::shared_ptrtype () == CLOUD_ITEM) { QVariant cloud_ptr = parent ()->data (ItemDataRole::CLOUD_BLOB); - sensor_msgs::PointCloud2::ConstPtr cloud_blob = cloud_ptr.value (); + pcl::PCLPointCloud2::ConstPtr cloud_blob = cloud_ptr.value (); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); pcl::fromROSMsg (*cloud_blob, *cloud); double scale = properties_->getProperty ("Scale").toDouble (); diff --git a/apps/cloud_composer/src/merge_selection.cpp b/apps/cloud_composer/src/merge_selection.cpp index 4c813ac5247..c27c474d08d 100644 --- a/apps/cloud_composer/src/merge_selection.cpp +++ b/apps/cloud_composer/src/merge_selection.cpp @@ -53,22 +53,22 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po } } - pcl::ExtractIndices filter; - sensor_msgs::PointCloud2::Ptr merged_cloud (new sensor_msgs::PointCloud2); + pcl::ExtractIndices filter; + pcl::PCLPointCloud2::Ptr merged_cloud (new pcl::PCLPointCloud2); foreach (const CloudItem* input_cloud_item, selected_item_index_map_.keys ()) { //If this cloud hasn't been completely selected if (!input_data.contains (input_cloud_item)) { - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_cloud_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_cloud_item->data (ItemDataRole::CLOUD_BLOB).value (); qDebug () << "Extracting "<indices.size() << " points out of "<width; filter.setInputCloud (input_cloud); filter.setIndices (selected_item_index_map_.value (input_cloud_item)); - sensor_msgs::PointCloud2::Ptr original_minus_indices = boost::make_shared (); + pcl::PCLPointCloud2::Ptr original_minus_indices = boost::make_shared (); filter.setNegative (true); filter.filter (*original_minus_indices); filter.setNegative (false); - sensor_msgs::PointCloud2::Ptr selected_points (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr selected_points (new pcl::PCLPointCloud2); filter.filter (*selected_points); qDebug () << "Original minus indices is "<width; @@ -79,7 +79,7 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po , source_origin , source_orientation); output.append (new_cloud_item); - sensor_msgs::PointCloud2::Ptr temp_cloud = boost::make_shared (); + pcl::PCLPointCloud2::Ptr temp_cloud = boost::make_shared (); concatenatePointCloud (*merged_cloud, *selected_points, *temp_cloud); merged_cloud = temp_cloud; } @@ -89,9 +89,9 @@ pcl::cloud_composer::MergeSelection::performAction (ConstItemList input_data, Po //Just concatenate for all fully selected clouds foreach (const CloudComposerItem* input_item, input_data) { - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); - sensor_msgs::PointCloud2::Ptr temp_cloud = boost::make_shared (); + pcl::PCLPointCloud2::Ptr temp_cloud = boost::make_shared (); concatenatePointCloud (*merged_cloud, *input_cloud, *temp_cloud); merged_cloud = temp_cloud; } diff --git a/apps/cloud_composer/src/project_model.cpp b/apps/cloud_composer/src/project_model.cpp index b41d8a238ad..0ea004cd0b0 100644 --- a/apps/cloud_composer/src/project_model.cpp +++ b/apps/cloud_composer/src/project_model.cpp @@ -170,7 +170,7 @@ pcl::cloud_composer::ProjectModel::insertNewCloudFromFile () last_directory_ = file_info.absoluteDir (); } - sensor_msgs::PointCloud2::Ptr cloud_blob (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud_blob (new pcl::PCLPointCloud2); Eigen::Vector4f origin; Eigen::Quaternionf orientation; int version; @@ -377,7 +377,7 @@ pcl::cloud_composer::ProjectModel::saveSelectedCloudToFile () last_directory_ = file_info.absoluteDir (); } - sensor_msgs::PointCloud2::ConstPtr cloud = cloud_to_save->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr cloud = cloud_to_save->data (ItemDataRole::CLOUD_BLOB).value (); Eigen::Vector4f origin = cloud_to_save->data (ItemDataRole::ORIGIN).value (); Eigen::Quaternionf orientation = cloud_to_save->data (ItemDataRole::ORIENTATION).value (); int result = pcl::io::savePCDFile (filename.toStdString (), *cloud, origin, orientation ); diff --git a/apps/cloud_composer/tools/euclidean_clustering.cpp b/apps/cloud_composer/tools/euclidean_clustering.cpp index b2e8ed77db7..9c287277b89 100644 --- a/apps/cloud_composer/tools/euclidean_clustering.cpp +++ b/apps/cloud_composer/tools/euclidean_clustering.cpp @@ -45,7 +45,7 @@ pcl::cloud_composer::EuclideanClusteringTool::performAction (ConstItemList input int min_cluster_size = parameter_model_->getProperty ("Min Cluster Size").toInt(); int max_cluster_size = parameter_model_->getProperty ("Max Cluster Size").toInt(); - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); //Get the cloud in template form pcl::PointCloud::Ptr cloud (new pcl::PointCloud); pcl::fromROSMsg (*input_cloud, *cloud); @@ -72,7 +72,7 @@ pcl::cloud_composer::EuclideanClusteringTool::performAction (ConstItemList input //Put found clusters into new cloud_items! qDebug () << "Found "< filter; + pcl::ExtractIndices filter; for (std::vector::const_iterator it = cluster_indices.begin (); it != cluster_indices.end (); ++it) { filter.setInputCloud (input_cloud); @@ -82,7 +82,7 @@ pcl::cloud_composer::EuclideanClusteringTool::performAction (ConstItemList input extracted_indices->insert (extracted_indices->end (), it->indices.begin (), it->indices.end ()); //This means remove the other points filter.setKeepOrganized (false); - sensor_msgs::PointCloud2::Ptr cloud_filtered (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2); filter.filter (*cloud_filtered); qDebug() << "Cluster has " << cloud_filtered->width << " data points."; @@ -94,7 +94,7 @@ pcl::cloud_composer::EuclideanClusteringTool::performAction (ConstItemList input ++cluster_count; } //We copy input cloud over for special case that no clusters found, since ExtractIndices doesn't work for 0 length vectors - sensor_msgs::PointCloud2::Ptr remainder_cloud (new sensor_msgs::PointCloud2(*input_cloud)); + pcl::PCLPointCloud2::Ptr remainder_cloud (new pcl::PCLPointCloud2(*input_cloud)); if (cluster_indices.size () > 0) { //make a cloud containing all the remaining points diff --git a/apps/cloud_composer/tools/fpfh_estimation.cpp b/apps/cloud_composer/tools/fpfh_estimation.cpp index ab0e1788e16..53e6c6285c5 100644 --- a/apps/cloud_composer/tools/fpfh_estimation.cpp +++ b/apps/cloud_composer/tools/fpfh_estimation.cpp @@ -55,7 +55,7 @@ pcl::cloud_composer::FPFHEstimationTool::performAction (ConstItemList input_data double radius = parameter_model_->getProperty("Radius").toDouble(); - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); //Get the cloud in template form pcl::PointCloud::Ptr cloud (new pcl::PointCloud); pcl::fromROSMsg (*input_cloud, *cloud); diff --git a/apps/cloud_composer/tools/normal_estimation.cpp b/apps/cloud_composer/tools/normal_estimation.cpp index b26a01b299c..6f9cfd83e5e 100644 --- a/apps/cloud_composer/tools/normal_estimation.cpp +++ b/apps/cloud_composer/tools/normal_estimation.cpp @@ -37,12 +37,12 @@ pcl::cloud_composer::NormalEstimationTool::performAction (ConstItemList input_da } input_item = input_data.value (0); - sensor_msgs::PointCloud2::ConstPtr input_cloud; + pcl::PCLPointCloud2::ConstPtr input_cloud; if (input_item->type () == CloudComposerItem::CLOUD_ITEM) { double radius = parameter_model_->getProperty("Radius").toDouble(); qDebug () << "Received Radius = " <data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); qDebug () << "Got cloud size = "<width; //////////////// THE WORK - COMPUTING NORMALS /////////////////// pcl::PointCloud::Ptr cloud (new pcl::PointCloud); diff --git a/apps/cloud_composer/tools/sanitize_cloud.cpp b/apps/cloud_composer/tools/sanitize_cloud.cpp index 73abbd0e6e6..b03c0ef8d3e 100644 --- a/apps/cloud_composer/tools/sanitize_cloud.cpp +++ b/apps/cloud_composer/tools/sanitize_cloud.cpp @@ -34,18 +34,18 @@ pcl::cloud_composer::SanitizeCloudTool::performAction (ConstItemList input_data, if (input_item->type () == CloudComposerItem::CLOUD_ITEM ) { - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); bool keep_organized = parameter_model_->getProperty("Keep Organized").toBool (); //////////////// THE WORK - FILTERING NANS /////////////////// // Create the filtering object - pcl::PassThrough pass_filter; + pcl::PassThrough pass_filter; pass_filter.setInputCloud (input_cloud); pass_filter.setKeepOrganized (keep_organized); //Create output cloud - sensor_msgs::PointCloud2::Ptr cloud_filtered = boost::make_shared (); + pcl::PCLPointCloud2::Ptr cloud_filtered = boost::make_shared (); //Filter! pass_filter.filter (*cloud_filtered); diff --git a/apps/cloud_composer/tools/statistical_outlier_removal.cpp b/apps/cloud_composer/tools/statistical_outlier_removal.cpp index 1cf5440bf92..88939536878 100644 --- a/apps/cloud_composer/tools/statistical_outlier_removal.cpp +++ b/apps/cloud_composer/tools/statistical_outlier_removal.cpp @@ -44,20 +44,20 @@ pcl::cloud_composer::StatisticalOutlierRemovalTool::performAction (ConstItemList if (input_item->type () == CloudComposerItem::CLOUD_ITEM ) { - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); int mean_k = parameter_model_->getProperty("Mean K").toInt (); double std_dev_thresh = parameter_model_->getProperty ("Std Dev Thresh").toDouble (); //////////////// THE WORK - FILTERING OUTLIERS /////////////////// // Create the filtering object - pcl::StatisticalOutlierRemoval sor; + pcl::StatisticalOutlierRemoval sor; sor.setInputCloud (input_cloud); sor.setMeanK (mean_k); sor.setStddevMulThresh (std_dev_thresh); //Create output cloud - sensor_msgs::PointCloud2::Ptr cloud_filtered (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2); //Filter! sor.filter (*cloud_filtered); diff --git a/apps/cloud_composer/tools/voxel_grid_downsample.cpp b/apps/cloud_composer/tools/voxel_grid_downsample.cpp index 03dcacb44d9..08e59207237 100644 --- a/apps/cloud_composer/tools/voxel_grid_downsample.cpp +++ b/apps/cloud_composer/tools/voxel_grid_downsample.cpp @@ -44,17 +44,17 @@ pcl::cloud_composer::VoxelGridDownsampleTool::performAction (ConstItemList input double leaf_y = parameter_model_->getProperty("Leaf Size y").toDouble (); double leaf_z = parameter_model_->getProperty("Leaf Size z").toDouble (); - sensor_msgs::PointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); + pcl::PCLPointCloud2::ConstPtr input_cloud = input_item->data (ItemDataRole::CLOUD_BLOB).value (); //////////////// THE WORK - FILTERING OUTLIERS /////////////////// // Create the filtering object - pcl::VoxelGrid vox_grid; + pcl::VoxelGrid vox_grid; vox_grid.setInputCloud (input_cloud); vox_grid.setLeafSize (float (leaf_x), float (leaf_y), float (leaf_z)); //Create output cloud - sensor_msgs::PointCloud2::Ptr cloud_filtered (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2); //Filter! vox_grid.filter (*cloud_filtered); diff --git a/apps/include/pcl/apps/vfh_nn_classifier.h b/apps/include/pcl/apps/vfh_nn_classifier.h index 4fe2d6a4e30..685e8304b2c 100644 --- a/apps/include/pcl/apps/vfh_nn_classifier.h +++ b/apps/include/pcl/apps/vfh_nn_classifier.h @@ -44,7 +44,7 @@ #include #include #include -#include +#include namespace pcl { @@ -213,7 +213,7 @@ namespace pcl */ bool loadTrainingData (std::string file_name, std::string label) { - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; if (pcl::io::loadPCDFile (file_name.c_str (), cloud_blob) != 0) return false; return addTrainingData (cloud_blob, label); @@ -225,7 +225,7 @@ namespace pcl * \param label the class label for the training example * \return true on success, false on failure (read error or number of entries don't match) */ - bool addTrainingData (const sensor_msgs::PointCloud2 &training_data, std::string &label) + bool addTrainingData (const pcl::PCLPointCloud2 &training_data, std::string &label) { // Create label list containing the single label std::vector labels; @@ -242,7 +242,7 @@ namespace pcl * \param minimum_score the score to be given to matches at maximum distance (>0) -- 0.002 by default * \return pair of label and score for each relevant training class */ - ResultPtr classify (const sensor_msgs::PointCloud2 &testing_data, double radius = 300, double min_score = 0.002) + ResultPtr classify (const pcl::PCLPointCloud2 &testing_data, double radius = 300, double min_score = 0.002) { // compute the VFH feature for this point cloud FeatureCloudPtr vfhs = computeFeature (testing_data); @@ -257,7 +257,7 @@ namespace pcl * \param radius search radius for normal estimation -- 0.03 m by default * \return point cloud containing the extracted feature */ - FeatureCloudPtr computeFeature (const sensor_msgs::PointCloud2 &points, double radius = 0.03) + FeatureCloudPtr computeFeature (const pcl::PCLPointCloud2 &points, double radius = 0.03) { pcl::PointCloud::Ptr cloud (new pcl::PointCloud ()); pcl::fromROSMsg (points, *cloud); diff --git a/apps/point_cloud_editor/src/cloudEditorWidget.cpp b/apps/point_cloud_editor/src/cloudEditorWidget.cpp index 4c7fb927230..d19b3e95e6d 100644 --- a/apps/point_cloud_editor/src/cloudEditorWidget.cpp +++ b/apps/point_cloud_editor/src/cloudEditorWidget.cpp @@ -556,10 +556,10 @@ CloudEditorWidget::initFileLoadMap() bool CloudEditorWidget::isColored (const std::string &fileName) const { - sensor_msgs::PointCloud2 cloud2; + pcl::PCLPointCloud2 cloud2; pcl::PCDReader reader; reader.readHeader(fileName, cloud2); - std::vector< sensor_msgs::PointField > fs = cloud2.fields; + std::vector< pcl::PCLPointField > fs = cloud2.fields; for(unsigned int i = 0; i < fs.size(); ++i) { std::string name(fs[i].name); diff --git a/apps/src/nn_classification_example.cpp b/apps/src/nn_classification_example.cpp index 0e27d26b468..965d13d2d47 100644 --- a/apps/src/nn_classification_example.cpp +++ b/apps/src/nn_classification_example.cpp @@ -44,7 +44,7 @@ main (int, char* argv[]) { // Load input file char* file_name = argv[1]; - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; pcl::io::loadPCDFile (file_name, cloud_blob); // Declare variable to hold result diff --git a/apps/src/openni_boundary_estimation.cpp b/apps/src/openni_boundary_estimation.cpp index 0bd18553145..8e59964a53b 100644 --- a/apps/src/openni_boundary_estimation.cpp +++ b/apps/src/openni_boundary_estimation.cpp @@ -47,7 +47,7 @@ #include #include -typedef pcl::visualization::PointCloudColorHandler ColorHandler; +typedef pcl::visualization::PointCloudColorHandler ColorHandler; typedef ColorHandler::Ptr ColorHandlerPtr; typedef ColorHandler::ConstPtr ColorHandlerConstPtr; @@ -140,9 +140,9 @@ class OpenNIIntegralImageNormalEstimation // } viz.removePointCloud ("normalcloud"); - sensor_msgs::PointCloud2::Ptr cloud2 (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud2 (new pcl::PCLPointCloud2); pcl::toROSMsg (*boundaries_, *cloud2); - ColorHandlerConstPtr color_handler (new pcl::visualization::PointCloudColorHandlerGenericField (cloud2, "boundary_point")); + ColorHandlerConstPtr color_handler (new pcl::visualization::PointCloudColorHandlerGenericField (cloud2, "boundary_point")); viz.addPointCloud (temp_cloud, color_handler, "normalcloud"); viz.resetCameraViewpoint ("normalcloud"); new_cloud_ = false; diff --git a/apps/src/pcd_organized_edge_detection.cpp b/apps/src/pcd_organized_edge_detection.cpp index d1ac0271e93..9e4902af528 100644 --- a/apps/src/pcd_organized_edge_detection.cpp +++ b/apps/src/pcd_organized_edge_detection.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include using namespace pcl; using namespace pcl::io; @@ -73,7 +73,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -88,7 +88,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -133,7 +133,7 @@ keyboard_callback (const pcl::visualization::KeyboardEvent& event, void*) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, float th_dd, int max_search) { CloudPtr cloud (new Cloud); @@ -217,7 +217,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } // Combine point clouds and edge labels - sensor_msgs::PointCloud2 output_edges; + pcl::PCLPointCloud2 output_edges; toROSMsg (labels, output_edges); concatenateFields (*input, output_edges, output); } @@ -254,12 +254,12 @@ main (int argc, char** argv) print_info ("max_search: "); print_value ("%d\n", max_search); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, th_dd, max_search); diff --git a/apps/src/pcd_select_object_plane.cpp b/apps/src/pcd_select_object_plane.cpp index f78811b605c..e9ba13da192 100644 --- a/apps/src/pcd_select_object_plane.cpp +++ b/apps/src/pcd_select_object_plane.cpp @@ -529,13 +529,13 @@ class ObjectSelection if (cloud_->isOrganized ()) { // If the dataset is organized, and has RGB data, create an image viewer - vector fields; + vector fields; int rgba_index = -1; rgba_index = getFieldIndex (*cloud_, "rgba", fields); if (rgba_index >= 0) { - image_viewer_.reset (new visualization::ImageViewer ("RGB Image")); + image_viewer_.reset (new visualization::ImageViewer ("RGB PCLImage")); image_viewer_->registerMouseCallback (&ObjectSelection::mouse_callback, *this); image_viewer_->registerKeyboardCallback(&ObjectSelection::keyboard_callback, *this); @@ -651,7 +651,7 @@ main (int argc, char** argv) PCDReader reader; // Test the header - sensor_msgs::PointCloud2 dummy; + pcl::PCLPointCloud2 dummy; reader.readHeader (argv[p_file_indices[0]], dummy); if (dummy.height != 1 && getFieldIndex (dummy, "rgba") != -1) { diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index daed14bba8d..b0bbda62cb2 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -61,22 +61,20 @@ if(build) include/pcl/TextureMesh.h ) - if(NOT USE_ROS) - set(incs ${incs} - include/pcl/ModelCoefficients.h - include/pcl/PolygonMesh.h - include/pcl/Vertices.h - include/pcl/PointIndices.h - ) - - set(sensor_msg_incs - include/sensor_msgs/PointField.h - include/sensor_msgs/PointCloud2.h - include/sensor_msgs/Image.h - ) - - set(std_msg_incs include/std_msgs/Header.h) - endif(NOT USE_ROS) + set(incs ${incs} + include/pcl/ModelCoefficients.h + include/pcl/PolygonMesh.h + include/pcl/Vertices.h + include/pcl/PointIndices.h + ) + + set(sensor_msg_incs + include/pcl/PCLPointField.h + include/pcl/PCLPointCloud2.h + include/pcl/PCLImage.h + ) + + set(std_msg_incs include/pcl/PCLHeader.h) set(common_incs include/pcl/common/boost.h @@ -168,16 +166,14 @@ if(build) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${kissfft_srcs} ${incs} ${common_incs} ${impl_incs} ${ros_incs} ${tools_incs} ${kissfft_incs} ${common_incs_impl} ${sensor_msg_incs} ${std_msg_incs} ${range_image_incs} ${range_image_incs_impl}) #PCL_ADD_LIBRARY(${LIB_NAME} ${SUBSYS_NAME} ${srcs} ${incs} ${common_incs} ${impl_incs} ${ros_incs} ${tools_incs} ${common_incs_impl} ${sensor_msg_incs} ${std_msg_incs} ${range_image_incs} ${range_image_incs_impl}) - link_ros_libs (${LIB_NAME}) + #link_ros_libs (${LIB_NAME}) PCL_MAKE_PKGCONFIG(${LIB_NAME} ${SUBSYS_NAME} "${SUBSYS_DESC}" "" "" "" "" "") # Install include files PCL_ADD_INCLUDES(${SUBSYS_NAME} "" ${incs}) - if(NOT USE_ROS) - PCL_ADD_INCLUDES(${SUBSYS_NAME} "../sensor_msgs" ${sensor_msg_incs}) - PCL_ADD_INCLUDES(${SUBSYS_NAME} "../std_msgs" ${std_msg_incs}) - endif(NOT USE_ROS) + PCL_ADD_INCLUDES(${SUBSYS_NAME} "../pcl" ${sensor_msg_incs}) + PCL_ADD_INCLUDES(${SUBSYS_NAME} "../pcl" ${std_msg_incs}) PCL_ADD_INCLUDES(${SUBSYS_NAME} common ${common_incs}) PCL_ADD_INCLUDES(${SUBSYS_NAME} common/fft ${kissfft_incs}) PCL_ADD_INCLUDES(${SUBSYS_NAME} common/impl ${common_incs_impl}) diff --git a/common/include/pcl/ModelCoefficients.h b/common/include/pcl/ModelCoefficients.h index f052179ac74..9042c99d71e 100644 --- a/common/include/pcl/ModelCoefficients.h +++ b/common/include/pcl/ModelCoefficients.h @@ -4,8 +4,8 @@ #include #include -// Include the correct Header path here -#include "std_msgs/Header.h" +// Include the correct PCLHeader path here +#include "pcl/PCLHeader.h" namespace pcl { @@ -15,7 +15,7 @@ namespace pcl { } - ::std_msgs::Header header; + ::pcl::PCLHeader header; std::vector values; diff --git a/common/include/std_msgs/Header.h b/common/include/pcl/PCLHeader.h similarity index 54% rename from common/include/std_msgs/Header.h rename to common/include/pcl/PCLHeader.h index cf257b9dfad..21f0565d3f9 100644 --- a/common/include/std_msgs/Header.h +++ b/common/include/pcl/PCLHeader.h @@ -2,7 +2,7 @@ #define PCL_ROSLIB_MESSAGE_HEADER_H #ifdef USE_ROS - #error USE_ROS setup requires PCL to compile against ROS message headers + #error USE_ROS setup requires PCL to compile against ROS message headers, which is now deprecated #endif #include @@ -11,11 +11,11 @@ #include #include -namespace std_msgs +namespace pcl { - struct Header + struct PCLHeader { - Header (): seq (0), stamp (), frame_id () + PCLHeader (): seq (0), stamp (), frame_id () {} pcl::uint32_t seq; @@ -23,14 +23,14 @@ namespace std_msgs std::string frame_id; - typedef boost::shared_ptr
Ptr; - typedef boost::shared_ptr
ConstPtr; - }; // struct Header + typedef boost::shared_ptr Ptr; + typedef boost::shared_ptr ConstPtr; + }; // struct PCLHeader - typedef boost::shared_ptr
HeaderPtr; - typedef boost::shared_ptr
HeaderConstPtr; + typedef boost::shared_ptr HeaderPtr; + typedef boost::shared_ptr HeaderConstPtr; - inline std::ostream& operator << (std::ostream& out, const Header &h) + inline std::ostream& operator << (std::ostream& out, const PCLHeader &h) { out << "seq: " << h.seq; out << " stamp: " << h.stamp; @@ -38,7 +38,7 @@ namespace std_msgs return (out); } -} // namespace std_msgs +} // namespace pcl #endif // PCL_ROSLIB_MESSAGE_HEADER_H diff --git a/common/include/sensor_msgs/Image.h b/common/include/pcl/PCLImage.h similarity index 63% rename from common/include/sensor_msgs/Image.h rename to common/include/pcl/PCLImage.h index 2be4a8c0ab7..dd1bd470dc7 100644 --- a/common/include/sensor_msgs/Image.h +++ b/common/include/pcl/PCLImage.h @@ -5,21 +5,21 @@ #include #ifdef USE_ROS - #error USE_ROS setup requires PCL to compile against ROS message headers + #error USE_ROS setup requires PCL to compile against ROS message headers, which is now deprecated #endif -// Include the correct Header path here -#include "std_msgs/Header.h" +// Include the correct PCLHeader path here +#include "pcl/PCLHeader.h" -namespace sensor_msgs +namespace pcl { - struct Image + struct PCLImage { - Image () : header (), height (0), width (0), encoding (), + PCLImage () : header (), height (0), width (0), encoding (), is_bigendian (0), step (0), data () {} - ::std_msgs::Header header; + ::pcl::PCLHeader header; pcl::uint32_t height; pcl::uint32_t width; @@ -30,14 +30,14 @@ namespace sensor_msgs std::vector data; - typedef boost::shared_ptr< ::sensor_msgs::Image> Ptr; - typedef boost::shared_ptr< ::sensor_msgs::Image const> ConstPtr; - }; // struct Image + typedef boost::shared_ptr< ::pcl::PCLImage> Ptr; + typedef boost::shared_ptr< ::pcl::PCLImage const> ConstPtr; + }; // struct PCLImage - typedef boost::shared_ptr< ::sensor_msgs::Image> ImagePtr; - typedef boost::shared_ptr< ::sensor_msgs::Image const> ImageConstPtr; + typedef boost::shared_ptr< ::pcl::PCLImage> PCLImagePtr; + typedef boost::shared_ptr< ::pcl::PCLImage const> PCLImageConstPtr; - inline std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::Image & v) + inline std::ostream& operator<<(std::ostream& s, const ::pcl::PCLImage & v) { s << "header: " << std::endl; s << v.header; @@ -59,7 +59,7 @@ namespace sensor_msgs } return (s); } -} // namespace sensor_msgs +} // namespace pcl #endif // PCL_MESSAGE_IMAGE_H diff --git a/common/include/sensor_msgs/PointCloud2.h b/common/include/pcl/PCLPointCloud2.h similarity index 69% rename from common/include/sensor_msgs/PointCloud2.h rename to common/include/pcl/PCLPointCloud2.h index 572916665ad..503db13f885 100644 --- a/common/include/sensor_msgs/PointCloud2.h +++ b/common/include/pcl/PCLPointCloud2.h @@ -2,7 +2,7 @@ #define PCL_SENSOR_MSGS_MESSAGE_POINTCLOUD2_H #ifdef USE_ROS - #error USE_ROS setup requires PCL to compile against ROS message headers + #error USE_ROS setup requires PCL to compile against ROS message headers, which is now deprecated #endif #include @@ -10,16 +10,16 @@ #include #include -// Include the correct Header path here -#include "std_msgs/Header.h" -#include "sensor_msgs/PointField.h" +// Include the correct PCLHeader path here +#include "pcl/PCLHeader.h" +#include "pcl/PCLPointField.h" -namespace sensor_msgs +namespace pcl { - struct PointCloud2 + struct PCLPointCloud2 { - PointCloud2 () : header (), height (0), width (0), fields (), + PCLPointCloud2 () : header (), height (0), width (0), fields (), is_bigendian (false), point_step (0), row_step (0), data (), is_dense (false) { @@ -32,12 +32,12 @@ namespace sensor_msgs #endif } - ::std_msgs::Header header; + ::pcl::PCLHeader header; pcl::uint32_t height; pcl::uint32_t width; - std::vector< ::sensor_msgs::PointField> fields; + std::vector< ::pcl::PCLPointField> fields; pcl::uint8_t is_bigendian; pcl::uint32_t point_step; @@ -48,14 +48,14 @@ namespace sensor_msgs pcl::uint8_t is_dense; public: - typedef boost::shared_ptr< ::sensor_msgs::PointCloud2> Ptr; - typedef boost::shared_ptr< ::sensor_msgs::PointCloud2 const> ConstPtr; - }; // struct PointCloud2 + typedef boost::shared_ptr< ::pcl::PCLPointCloud2> Ptr; + typedef boost::shared_ptr< ::pcl::PCLPointCloud2 const> ConstPtr; + }; // struct PCLPointCloud2 - typedef boost::shared_ptr< ::sensor_msgs::PointCloud2> PointCloud2Ptr; - typedef boost::shared_ptr< ::sensor_msgs::PointCloud2 const> PointCloud2ConstPtr; + typedef boost::shared_ptr< ::pcl::PCLPointCloud2> PCLPointCloud2Ptr; + typedef boost::shared_ptr< ::pcl::PCLPointCloud2 const> PCLPointCloud2ConstPtr; - inline std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::PointCloud2 &v) + inline std::ostream& operator<<(std::ostream& s, const ::pcl::PCLPointCloud2 &v) { s << "header: " << std::endl; s << v.header; @@ -88,7 +88,7 @@ namespace sensor_msgs return (s); } -} // namespace sensor_msgs +} // namespace pcl #endif // PCL_SENSOR_MSGS_MESSAGE_POINTCLOUD2_H diff --git a/common/include/sensor_msgs/PointField.h b/common/include/pcl/PCLPointField.h similarity index 65% rename from common/include/sensor_msgs/PointField.h rename to common/include/pcl/PCLPointField.h index 489aee9f7db..bd8f4a000af 100644 --- a/common/include/sensor_msgs/PointField.h +++ b/common/include/pcl/PCLPointField.h @@ -2,7 +2,7 @@ #define PCL_SENSOR_MSGS_MESSAGE_POINTFIELD_H #ifdef USE_ROS - #error USE_ROS setup requires PCL to compile against ROS message headers + #error USE_ROS setup requires PCL to compile against ROS message headers, which is now deprecated #endif #include @@ -11,11 +11,11 @@ #include #include -namespace sensor_msgs +namespace pcl { - struct PointField + struct PCLPointField { - PointField () : name (), offset (0), datatype (0), count (0) + PCLPointField () : name (), offset (0), datatype (0), count (0) {} std::string name; @@ -34,14 +34,14 @@ namespace sensor_msgs FLOAT64 = 8 }; public: - typedef boost::shared_ptr< ::sensor_msgs::PointField> Ptr; - typedef boost::shared_ptr< ::sensor_msgs::PointField const> ConstPtr; - }; // struct PointField + typedef boost::shared_ptr< ::pcl::PCLPointField> Ptr; + typedef boost::shared_ptr< ::pcl::PCLPointField const> ConstPtr; + }; // struct PCLPointField - typedef boost::shared_ptr< ::sensor_msgs::PointField> PointFieldPtr; - typedef boost::shared_ptr< ::sensor_msgs::PointField const> PointFieldConstPtr; + typedef boost::shared_ptr< ::pcl::PCLPointField> PCLPointFieldPtr; + typedef boost::shared_ptr< ::pcl::PCLPointField const> PCLPointFieldConstPtr; - inline std::ostream& operator<<(std::ostream& s, const ::sensor_msgs::PointField & v) + inline std::ostream& operator<<(std::ostream& s, const ::pcl::PCLPointField & v) { s << "name: "; s << " " << v.name << std::endl; @@ -53,7 +53,7 @@ namespace sensor_msgs s << " " << v.count << std::endl; return (s); } -} // namespace sensor_msgs +} // namespace pcl #endif // PCL_SENSOR_MSGS_MESSAGE_POINTFIELD_H diff --git a/common/include/pcl/PointIndices.h b/common/include/pcl/PointIndices.h index 4c90a5da83d..f3231c886a1 100644 --- a/common/include/pcl/PointIndices.h +++ b/common/include/pcl/PointIndices.h @@ -4,8 +4,8 @@ #include #include -// Include the correct Header path here -#include "std_msgs/Header.h" +// Include the correct PCLHeader path here +#include "pcl/PCLHeader.h" namespace pcl { @@ -14,7 +14,7 @@ namespace pcl PointIndices () : header (), indices () {} - ::std_msgs::Header header; + ::pcl::PCLHeader header; std::vector indices; diff --git a/common/include/pcl/PolygonMesh.h b/common/include/pcl/PolygonMesh.h index 363edcd0b1e..a3254cf84a9 100644 --- a/common/include/pcl/PolygonMesh.h +++ b/common/include/pcl/PolygonMesh.h @@ -5,9 +5,9 @@ #include #include -// Include the correct Header path here -#include "std_msgs/Header.h" -#include "sensor_msgs/PointCloud2.h" +// Include the correct PCLHeader path here +#include "pcl/PCLHeader.h" +#include "pcl/PCLPointCloud2.h" #include namespace pcl @@ -17,9 +17,9 @@ namespace pcl PolygonMesh () : header (), cloud (), polygons () {} - ::std_msgs::Header header; + ::pcl::PCLHeader header; - ::sensor_msgs::PointCloud2 cloud; + ::pcl::PCLPointCloud2 cloud; std::vector< ::pcl::Vertices> polygons; diff --git a/common/include/pcl/TextureMesh.h b/common/include/pcl/TextureMesh.h index 1b9e252c129..4a7f673bc05 100644 --- a/common/include/pcl/TextureMesh.h +++ b/common/include/pcl/TextureMesh.h @@ -41,7 +41,7 @@ #include #include -#include +#include #include namespace pcl @@ -93,8 +93,8 @@ namespace pcl TextureMesh () : cloud (), tex_polygons (), tex_coordinates (), tex_materials () {} - sensor_msgs::PointCloud2 cloud; - std_msgs::Header header; + pcl::PCLPointCloud2 cloud; + pcl::PCLHeader header; std::vector > tex_polygons; // polygon which is mapped with specific texture defined in TexMaterial diff --git a/common/include/pcl/common/common.h b/common/include/pcl/common/common.h index fb437b3fe4c..f8fb6824438 100644 --- a/common/include/pcl/common/common.h +++ b/common/include/pcl/common/common.h @@ -169,7 +169,7 @@ namespace pcl * \ingroup common */ PCL_EXPORTS void - getMinMax (const sensor_msgs::PointCloud2 &cloud, int idx, const std::string &field_name, + getMinMax (const pcl::PCLPointCloud2 &cloud, int idx, const std::string &field_name, float &min_p, float &max_p); /** \brief Compute both the mean and the standard deviation of an array of values diff --git a/common/include/pcl/common/impl/io.hpp b/common/include/pcl/common/impl/io.hpp index 4504c1cfc33..3d40c718d10 100644 --- a/common/include/pcl/common/impl/io.hpp +++ b/common/include/pcl/common/impl/io.hpp @@ -48,7 +48,7 @@ template int pcl::getFieldIndex (const pcl::PointCloud &, const std::string &field_name, - std::vector &fields) + std::vector &fields) { fields.clear (); // Get the fields list @@ -62,7 +62,7 @@ pcl::getFieldIndex (const pcl::PointCloud &, ////////////////////////////////////////////////////////////////////////////////////////////// template int pcl::getFieldIndex (const std::string &field_name, - std::vector &fields) + std::vector &fields) { fields.clear (); // Get the fields list @@ -75,7 +75,7 @@ pcl::getFieldIndex (const std::string &field_name, ////////////////////////////////////////////////////////////////////////////////////////////// template void -pcl::getFields (const pcl::PointCloud &, std::vector &fields) +pcl::getFields (const pcl::PointCloud &, std::vector &fields) { fields.clear (); // Get the fields list @@ -84,7 +84,7 @@ pcl::getFields (const pcl::PointCloud &, std::vector void -pcl::getFields (std::vector &fields) +pcl::getFields (std::vector &fields) { fields.clear (); // Get the fields list @@ -96,7 +96,7 @@ template std::string pcl::getFieldsList (const pcl::PointCloud &) { // Get the fields list - std::vector fields; + std::vector fields; pcl::for_each_type::type>(pcl::detail::FieldAdder(fields)); std::string result; for (size_t i = 0; i < fields.size () - 1; ++i) @@ -130,7 +130,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, return; } - std::vector fields_in, fields_out; + std::vector fields_in, fields_out; pcl::for_each_type (pcl::detail::FieldAdder (fields_in)); pcl::for_each_type (pcl::detail::FieldAdder (fields_out)); @@ -259,7 +259,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, return; } - std::vector fields_in, fields_out; + std::vector fields_in, fields_out; pcl::for_each_type (pcl::detail::FieldAdder (fields_in)); pcl::for_each_type (pcl::detail::FieldAdder (fields_out)); @@ -334,7 +334,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, return; } - std::vector fields_in, fields_out; + std::vector fields_in, fields_out; pcl::for_each_type (pcl::detail::FieldAdder (fields_in)); pcl::for_each_type (pcl::detail::FieldAdder (fields_out)); @@ -436,7 +436,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, return; } - std::vector fields_in, fields_out; + std::vector fields_in, fields_out; pcl::for_each_type (pcl::detail::FieldAdder (fields_in)); pcl::for_each_type (pcl::detail::FieldAdder (fields_out)); @@ -570,7 +570,7 @@ pcl::copyPointCloud (const pcl::PointCloud &cloud_in, return; } - std::vector fields_in, fields_out; + std::vector fields_in, fields_out; pcl::for_each_type (pcl::detail::FieldAdder (fields_in)); pcl::for_each_type (pcl::detail::FieldAdder (fields_out)); diff --git a/common/include/pcl/common/io.h b/common/include/pcl/common/io.h index bb1d644b060..ce4a185516f 100644 --- a/common/include/pcl/common/io.h +++ b/common/include/pcl/common/io.h @@ -55,7 +55,7 @@ namespace pcl * \ingroup common */ inline int - getFieldIndex (const sensor_msgs::PointCloud2 &cloud, const std::string &field_name) + getFieldIndex (const pcl::PCLPointCloud2 &cloud, const std::string &field_name) { // Get the index we need for (size_t d = 0; d < cloud.fields.size (); ++d) @@ -67,36 +67,36 @@ namespace pcl /** \brief Get the index of a specified field (i.e., dimension/channel) * \param[in] cloud the the point cloud message * \param[in] field_name the string defining the field name - * \param[out] fields a vector to the original \a PointField vector that the raw PointCloud message contains + * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains * \ingroup common */ template inline int getFieldIndex (const pcl::PointCloud &cloud, const std::string &field_name, - std::vector &fields); + std::vector &fields); /** \brief Get the index of a specified field (i.e., dimension/channel) * \param[in] field_name the string defining the field name - * \param[out] fields a vector to the original \a PointField vector that the raw PointCloud message contains + * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains * \ingroup common */ template inline int getFieldIndex (const std::string &field_name, - std::vector &fields); + std::vector &fields); /** \brief Get the list of available fields (i.e., dimension/channel) * \param[in] cloud the point cloud message - * \param[out] fields a vector to the original \a PointField vector that the raw PointCloud message contains + * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains * \ingroup common */ template inline void - getFields (const pcl::PointCloud &cloud, std::vector &fields); + getFields (const pcl::PointCloud &cloud, std::vector &fields); /** \brief Get the list of available fields (i.e., dimension/channel) - * \param[out] fields a vector to the original \a PointField vector that the raw PointCloud message contains + * \param[out] fields a vector to the original \a PCLPointField vector that the raw PointCloud message contains * \ingroup common */ template inline void - getFields (std::vector &fields); + getFields (std::vector &fields); /** \brief Get the list of all fields available in a given cloud * \param[in] cloud the the point cloud message @@ -110,7 +110,7 @@ namespace pcl * \ingroup common */ inline std::string - getFieldsList (const sensor_msgs::PointCloud2 &cloud) + getFieldsList (const pcl::PCLPointCloud2 &cloud) { std::string result; for (size_t i = 0; i < cloud.fields.size () - 1; ++i) @@ -120,7 +120,7 @@ namespace pcl } /** \brief Obtains the size of a specific field data type in bytes - * \param[in] datatype the field data type (see PointField.h) + * \param[in] datatype the field data type (see PCLPointField.h) * \ingroup common */ inline int @@ -128,20 +128,20 @@ namespace pcl { switch (datatype) { - case sensor_msgs::PointField::INT8: - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::INT8: + case pcl::PCLPointField::UINT8: return (1); - case sensor_msgs::PointField::INT16: - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::INT16: + case pcl::PCLPointField::UINT16: return (2); - case sensor_msgs::PointField::INT32: - case sensor_msgs::PointField::UINT32: - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::INT32: + case pcl::PCLPointField::UINT32: + case pcl::PCLPointField::FLOAT32: return (4); - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: return (8); default: @@ -154,10 +154,10 @@ namespace pcl * \param[out] field_sizes the resultant field sizes in bytes */ PCL_EXPORTS void - getFieldsSizes (const std::vector &fields, + getFieldsSizes (const std::vector &fields, std::vector &field_sizes); - /** \brief Obtains the type of the PointField from a specific size and type + /** \brief Obtains the type of the PCLPointField from a specific size and type * \param[in] size the size in bytes of the data field * \param[in] type a char describing the type of the field ('F' = float, 'I' = signed, 'U' = unsigned) * \ingroup common @@ -170,34 +170,34 @@ namespace pcl { case 1: if (type == 'I') - return (sensor_msgs::PointField::INT8); + return (pcl::PCLPointField::INT8); if (type == 'U') - return (sensor_msgs::PointField::UINT8); + return (pcl::PCLPointField::UINT8); case 2: if (type == 'I') - return (sensor_msgs::PointField::INT16); + return (pcl::PCLPointField::INT16); if (type == 'U') - return (sensor_msgs::PointField::UINT16); + return (pcl::PCLPointField::UINT16); case 4: if (type == 'I') - return (sensor_msgs::PointField::INT32); + return (pcl::PCLPointField::INT32); if (type == 'U') - return (sensor_msgs::PointField::UINT32); + return (pcl::PCLPointField::UINT32); if (type == 'F') - return (sensor_msgs::PointField::FLOAT32); + return (pcl::PCLPointField::FLOAT32); case 8: - return (sensor_msgs::PointField::FLOAT64); + return (pcl::PCLPointField::FLOAT64); default: return (-1); } } - /** \brief Obtains the type of the PointField from a specific PointField as a char - * \param[in] type the PointField field type + /** \brief Obtains the type of the PCLPointField from a specific PCLPointField as a char + * \param[in] type the PCLPointField field type * \ingroup common */ inline char @@ -205,25 +205,25 @@ namespace pcl { switch (type) { - case sensor_msgs::PointField::INT8: - case sensor_msgs::PointField::INT16: - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT8: + case pcl::PCLPointField::INT16: + case pcl::PCLPointField::INT32: return ('I'); - case sensor_msgs::PointField::UINT8: - case sensor_msgs::PointField::UINT16: - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT8: + case pcl::PCLPointField::UINT16: + case pcl::PCLPointField::UINT32: return ('U'); - case sensor_msgs::PointField::FLOAT32: - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT32: + case pcl::PCLPointField::FLOAT64: return ('F'); default: return ('?'); } } - /** \brief Concatenate two sensor_msgs::PointCloud2. + /** \brief Concatenate two pcl::PCLPointCloud2. * \param[in] cloud1 the first input point cloud dataset * \param[in] cloud2 the second input point cloud dataset * \param[out] cloud_out the resultant output point cloud dataset @@ -231,9 +231,9 @@ namespace pcl * \ingroup common */ PCL_EXPORTS bool - concatenatePointCloud (const sensor_msgs::PointCloud2 &cloud1, - const sensor_msgs::PointCloud2 &cloud2, - sensor_msgs::PointCloud2 &cloud_out); + concatenatePointCloud (const pcl::PCLPointCloud2 &cloud1, + const pcl::PCLPointCloud2 &cloud2, + pcl::PCLPointCloud2 &cloud_out); /** \brief Extract the indices of a given point cloud as a new point cloud * \param[in] cloud_in the input point cloud dataset @@ -243,9 +243,9 @@ namespace pcl * \ingroup common */ PCL_EXPORTS void - copyPointCloud (const sensor_msgs::PointCloud2 &cloud_in, + copyPointCloud (const pcl::PCLPointCloud2 &cloud_in, const std::vector &indices, - sensor_msgs::PointCloud2 &cloud_out); + pcl::PCLPointCloud2 &cloud_out); /** \brief Extract the indices of a given point cloud as a new point cloud * \param[in] cloud_in the input point cloud dataset @@ -255,9 +255,9 @@ namespace pcl * \ingroup common */ PCL_EXPORTS void - copyPointCloud (const sensor_msgs::PointCloud2 &cloud_in, + copyPointCloud (const pcl::PCLPointCloud2 &cloud_in, const std::vector > &indices, - sensor_msgs::PointCloud2 &cloud_out); + pcl::PCLPointCloud2 &cloud_out); /** \brief Copy fields and point cloud data from \a cloud_in to \a cloud_out * \param[in] cloud_in the input point cloud dataset @@ -265,8 +265,8 @@ namespace pcl * \ingroup common */ PCL_EXPORTS void - copyPointCloud (const sensor_msgs::PointCloud2 &cloud_in, - sensor_msgs::PointCloud2 &cloud_out); + copyPointCloud (const pcl::PCLPointCloud2 &cloud_in, + pcl::PCLPointCloud2 &cloud_out); /** \brief Check if two given point types are the same or not. */ template inline bool @@ -408,26 +408,26 @@ namespace pcl * \ingroup common */ PCL_EXPORTS bool - concatenateFields (const sensor_msgs::PointCloud2 &cloud1_in, - const sensor_msgs::PointCloud2 &cloud2_in, - sensor_msgs::PointCloud2 &cloud_out); + concatenateFields (const pcl::PCLPointCloud2 &cloud1_in, + const pcl::PCLPointCloud2 &cloud2_in, + pcl::PCLPointCloud2 &cloud_out); - /** \brief Copy the XYZ dimensions of a sensor_msgs::PointCloud2 into Eigen format + /** \brief Copy the XYZ dimensions of a pcl::PCLPointCloud2 into Eigen format * \param[in] in the point cloud message * \param[out] out the resultant Eigen MatrixXf format containing XYZ0 / point * \ingroup common */ PCL_EXPORTS bool - getPointCloudAsEigen (const sensor_msgs::PointCloud2 &in, Eigen::MatrixXf &out); + getPointCloudAsEigen (const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out); - /** \brief Copy the XYZ dimensions from an Eigen MatrixXf into a sensor_msgs::PointCloud2 message + /** \brief Copy the XYZ dimensions from an Eigen MatrixXf into a pcl::PCLPointCloud2 message * \param[in] in the Eigen MatrixXf format containing XYZ0 / point * \param[out] out the resultant point cloud message - * \note the method assumes that the PointCloud2 message already has the fields set up properly ! + * \note the method assumes that the PCLPointCloud2 message already has the fields set up properly ! * \ingroup common */ PCL_EXPORTS bool - getEigenAsPointCloud (Eigen::MatrixXf &in, sensor_msgs::PointCloud2 &out); + getEigenAsPointCloud (Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out); namespace io { diff --git a/common/include/pcl/exceptions.h b/common/include/pcl/exceptions.h index dddaa278306..57c8ba65ffc 100644 --- a/common/include/pcl/exceptions.h +++ b/common/include/pcl/exceptions.h @@ -132,7 +132,7 @@ namespace pcl } ; /** \class InvalidConversionException - * \brief An exception that is thrown when a PointCloud2 message cannot be converted into a PCL type + * \brief An exception that is thrown when a PCLPointCloud2 message cannot be converted into a PCL type */ class InvalidConversionException : public PCLException { diff --git a/common/include/pcl/pcl_base.h b/common/include/pcl/pcl_base.h index 7c24f06508d..aabc529b844 100644 --- a/common/include/pcl/pcl_base.h +++ b/common/include/pcl/pcl_base.h @@ -52,7 +52,7 @@ // Point Cloud message includes. Needed everywhere. #include #include -#include +#include namespace pcl { @@ -177,12 +177,12 @@ namespace pcl ///////////////////////////////////////////////////////////////////////////////////////// template <> - class PCL_EXPORTS PCLBase + class PCL_EXPORTS PCLBase { public: - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef boost::shared_ptr PointCloud2Ptr; - typedef boost::shared_ptr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef boost::shared_ptr PCLPointCloud2Ptr; + typedef boost::shared_ptr PCLPointCloud2ConstPtr; typedef boost::shared_ptr PointIndicesPtr; typedef boost::shared_ptr PointIndicesConstPtr; @@ -201,10 +201,10 @@ namespace pcl * \param cloud the const boost shared pointer to a PointCloud message */ void - setInputCloud (const PointCloud2ConstPtr &cloud); + setInputCloud (const PCLPointCloud2ConstPtr &cloud); /** \brief Get a pointer to the input point cloud dataset. */ - inline PointCloud2ConstPtr const + inline PCLPointCloud2ConstPtr const getInputCloud () { return (input_); } /** \brief Provide a pointer to the vector of indices that represents the input data. @@ -225,7 +225,7 @@ namespace pcl protected: /** \brief The input point cloud dataset. */ - PointCloud2ConstPtr input_; + PCLPointCloud2ConstPtr input_; /** \brief A pointer to the vector of point indices to use. */ IndicesPtr indices_; diff --git a/common/include/pcl/point_cloud.h b/common/include/pcl/point_cloud.h index 5235246ed2f..12ab7d3dc72 100644 --- a/common/include/pcl/point_cloud.h +++ b/common/include/pcl/point_cloud.h @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include @@ -404,7 +404,7 @@ namespace pcl } /** \brief The point cloud header. It contains information about the acquisition time. */ - std_msgs::Header header; + pcl::PCLHeader header; /** \brief The point data. */ std::vector > points; diff --git a/common/include/pcl/point_traits.h b/common/include/pcl/point_traits.h index 0ab5b5ca6e0..f10d9374f0b 100644 --- a/common/include/pcl/point_traits.h +++ b/common/include/pcl/point_traits.h @@ -45,7 +45,7 @@ #include "pcl/pcl_macros.h" -#include +#include #include #include #include @@ -65,25 +65,25 @@ namespace pcl { // Metafunction to return enum value representing a type template struct asEnum {}; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::INT8; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::UINT8; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::INT16; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::UINT16; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::INT32; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::UINT32; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::FLOAT32; }; - template<> struct asEnum { static const uint8_t value = sensor_msgs::PointField::FLOAT64; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::INT8; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::UINT8; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::INT16; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::UINT16; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::INT32; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::UINT32; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::FLOAT32; }; + template<> struct asEnum { static const uint8_t value = pcl::PCLPointField::FLOAT64; }; // Metafunction to return type of enum value template struct asType {}; - template<> struct asType { typedef int8_t type; }; - template<> struct asType { typedef uint8_t type; }; - template<> struct asType { typedef int16_t type; }; - template<> struct asType { typedef uint16_t type; }; - template<> struct asType { typedef int32_t type; }; - template<> struct asType { typedef uint32_t type; }; - template<> struct asType { typedef float type; }; - template<> struct asType { typedef double type; }; + template<> struct asType { typedef int8_t type; }; + template<> struct asType { typedef uint8_t type; }; + template<> struct asType { typedef int16_t type; }; + template<> struct asType { typedef uint16_t type; }; + template<> struct asType { typedef int32_t type; }; + template<> struct asType { typedef uint32_t type; }; + template<> struct asType { typedef float type; }; + template<> struct asType { typedef double type; }; // Metafunction to decompose a type (possibly of array of any number of dimensions) into // its scalar type and total number of elements. @@ -171,12 +171,12 @@ namespace pcl #endif } //namespace traits - // Return true if the PointField matches the expected name and data type. + // Return true if the PCLPointField matches the expected name and data type. // Written as a struct to allow partially specializing on Tag. template struct FieldMatches { - bool operator() (const sensor_msgs::PointField& field) + bool operator() (const pcl::PCLPointField& field) { return (field.name == traits::name::value && field.datatype == traits::datatype::value && diff --git a/common/include/pcl/point_types.h b/common/include/pcl/point_types.h index 2ea9600666d..8824865cf76 100644 --- a/common/include/pcl/point_types.h +++ b/common/include/pcl/point_types.h @@ -614,11 +614,11 @@ namespace pcl template struct FieldMatches { - bool operator() (const sensor_msgs::PointField& field) + bool operator() (const pcl::PCLPointField& field) { if (field.name == "rgb") { - return (field.datatype == sensor_msgs::PointField::FLOAT32 && + return (field.datatype == pcl::PCLPointField::FLOAT32 && field.count == 1); } else @@ -632,11 +632,11 @@ namespace pcl template struct FieldMatches { - bool operator() (const sensor_msgs::PointField& field) + bool operator() (const pcl::PCLPointField& field) { if (field.name == "rgba") { - return (field.datatype == sensor_msgs::PointField::UINT32 && + return (field.datatype == pcl::PCLPointField::UINT32 && field.count == 1); } else diff --git a/common/include/pcl/range_image/range_image.h b/common/include/pcl/range_image/range_image.h index bf18b5af59f..765921b4283 100644 --- a/common/include/pcl/range_image/range_image.h +++ b/common/include/pcl/range_image/range_image.h @@ -113,11 +113,11 @@ namespace pcl getAverageViewPoint (const PointCloudTypeWithViewpoints& point_cloud); /** \brief Check if the provided data includes far ranges and add them to far_ranges - * \param point_cloud_data a PointCloud2 message containing the input cloud + * \param point_cloud_data a PCLPointCloud2 message containing the input cloud * \param far_ranges the resulting cloud containing those points with far ranges */ PCL_EXPORTS static void - extractFarRanges (const sensor_msgs::PointCloud2& point_cloud_data, PointCloud& far_ranges); + extractFarRanges (const pcl::PCLPointCloud2& point_cloud_data, PointCloud& far_ranges); // =====METHODS===== /** \brief Get a boost shared pointer of a copy of this */ diff --git a/common/include/pcl/ros/conversions.h b/common/include/pcl/ros/conversions.h index 414a38a7d05..af056a0a728 100644 --- a/common/include/pcl/ros/conversions.h +++ b/common/include/pcl/ros/conversions.h @@ -44,9 +44,9 @@ #pragma GCC system_header #endif -#include -#include -#include +#include +#include +#include #include #include #include @@ -62,11 +62,11 @@ namespace pcl template struct FieldAdder { - FieldAdder (std::vector& fields) : fields_ (fields) {}; + FieldAdder (std::vector& fields) : fields_ (fields) {}; template void operator() () { - sensor_msgs::PointField f; + pcl::PCLPointField f; f.name = traits::name::value; f.offset = traits::offset::value; f.datatype = traits::datatype::value; @@ -74,14 +74,14 @@ namespace pcl fields_.push_back (f); } - std::vector& fields_; + std::vector& fields_; }; // For converting message to template point cloud. template struct FieldMapper { - FieldMapper (const std::vector& fields, + FieldMapper (const std::vector& fields, std::vector& map) : fields_ (fields), map_ (map) { @@ -90,7 +90,7 @@ namespace pcl template void operator () () { - BOOST_FOREACH (const sensor_msgs::PointField& field, fields_) + BOOST_FOREACH (const pcl::PCLPointField& field, fields_) { if (FieldMatches()(field)) { @@ -107,7 +107,7 @@ namespace pcl //throw pcl::InvalidConversionException (ss.str ()); } - const std::vector& fields_; + const std::vector& fields_; std::vector& map_; }; @@ -120,7 +120,7 @@ namespace pcl } //namespace detail template void - createMapping (const std::vector& msg_fields, MsgFieldMap& field_map) + createMapping (const std::vector& msg_fields, MsgFieldMap& field_map) { // Create initial 1-1 mapping between serialized data segments and struct fields detail::FieldMapper mapper (msg_fields, field_map); @@ -150,12 +150,12 @@ namespace pcl } } - /** \brief Convert a PointCloud2 binary data blob into a pcl::PointCloud object using a field_map. - * \param[in] msg the PointCloud2 binary blob + /** \brief Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud object using a field_map. + * \param[in] msg the PCLPointCloud2 binary blob * \param[out] cloud the resultant pcl::PointCloud * \param[in] field_map a MsgFieldMap object * - * \note Use fromROSMsg (PointCloud2, PointCloud) directly or create you + * \note Use fromROSMsg (PCLPointCloud2, PointCloud) directly or create you * own MsgFieldMap using: * * \code @@ -164,7 +164,7 @@ namespace pcl * \endcode */ template void - fromROSMsg (const sensor_msgs::PointCloud2& msg, pcl::PointCloud& cloud, + fromROSMsg (const pcl::PCLPointCloud2& msg, pcl::PointCloud& cloud, const MsgFieldMap& field_map) { // Copy info fields @@ -217,24 +217,24 @@ namespace pcl } } - /** \brief Convert a PointCloud2 binary data blob into a pcl::PointCloud object. - * \param[in] msg the PointCloud2 binary blob + /** \brief Convert a PCLPointCloud2 binary data blob into a pcl::PointCloud object. + * \param[in] msg the PCLPointCloud2 binary blob * \param[out] cloud the resultant pcl::PointCloud */ template void - fromROSMsg (const sensor_msgs::PointCloud2& msg, pcl::PointCloud& cloud) + fromROSMsg (const pcl::PCLPointCloud2& msg, pcl::PointCloud& cloud) { MsgFieldMap field_map; createMapping (msg.fields, field_map); fromROSMsg (msg, cloud, field_map); } - /** \brief Convert a pcl::PointCloud object to a PointCloud2 binary data blob. + /** \brief Convert a pcl::PointCloud object to a PCLPointCloud2 binary data blob. * \param[in] cloud the input pcl::PointCloud - * \param[out] msg the resultant PointCloud2 binary blob + * \param[out] msg the resultant PCLPointCloud2 binary blob */ template void - toROSMsg (const pcl::PointCloud& cloud, sensor_msgs::PointCloud2& msg) + toROSMsg (const pcl::PointCloud& cloud, pcl::PCLPointCloud2& msg) { // Ease the user's burden on specifying width/height for unorganized datasets if (cloud.width == 0 && cloud.height == 0) @@ -265,14 +265,14 @@ namespace pcl /// @todo msg.is_bigendian = ?; } - /** \brief Copy the RGB fields of a PointCloud into sensor_msgs::Image format + /** \brief Copy the RGB fields of a PointCloud into pcl::PCLImage format * \param[in] cloud the point cloud message - * \param[out] msg the resultant sensor_msgs::Image + * \param[out] msg the resultant pcl::PCLImage * CloudT cloud type, CloudT should be akin to pcl::PointCloud * \note will throw std::runtime_error if there is a problem */ template void - toROSMsg (const CloudT& cloud, sensor_msgs::Image& msg) + toROSMsg (const CloudT& cloud, pcl::PCLImage& msg) { // Ease the user's burden on specifying width/height for unorganized datasets if (cloud.width == 0 && cloud.height == 0) @@ -299,13 +299,13 @@ namespace pcl } } - /** \brief Copy the RGB fields of a PointCloud2 msg into sensor_msgs::Image format + /** \brief Copy the RGB fields of a PCLPointCloud2 msg into pcl::PCLImage format * \param cloud the point cloud message - * \param msg the resultant sensor_msgs::Image + * \param msg the resultant pcl::PCLImage * will throw std::runtime_error if there is a problem */ inline void - toROSMsg (const sensor_msgs::PointCloud2& cloud, sensor_msgs::Image& msg) + toROSMsg (const pcl::PCLPointCloud2& cloud, pcl::PCLImage& msg) { int rgb_index = -1; // Get the index we need @@ -328,7 +328,7 @@ namespace pcl int rgb_offset = cloud.fields[rgb_index].offset; int point_step = cloud.point_step; - // sensor_msgs::image_encodings::BGR8; + // pcl::image_encodings::BGR8; msg.encoding = "bgr8"; msg.step = static_cast(msg.width * sizeof (uint8_t) * 3); msg.data.resize (msg.step * msg.height); diff --git a/common/src/common.cpp b/common/src/common.cpp index 0aa4e0634b1..92a6cf664ac 100644 --- a/common/src/common.cpp +++ b/common/src/common.cpp @@ -41,7 +41,7 @@ ////////////////////////////////////////////////////////////////////////////////////////////// void -pcl::getMinMax (const sensor_msgs::PointCloud2 &cloud, int, +pcl::getMinMax (const pcl::PCLPointCloud2 &cloud, int, const std::string &field_name, float &min_p, float &max_p) { min_p = FLT_MAX; diff --git a/common/src/io.cpp b/common/src/io.cpp index 51a210b4a2e..dec664cc84a 100644 --- a/common/src/io.cpp +++ b/common/src/io.cpp @@ -43,7 +43,7 @@ ////////////////////////////////////////////////////////////////////////// void -getFieldsSizes (const std::vector &fields, +getFieldsSizes (const std::vector &fields, std::vector &fields_sizes) { int valid = 0; @@ -60,16 +60,16 @@ getFieldsSizes (const std::vector &fields, fields_sizes.resize (valid); } -bool fieldComp (const sensor_msgs::PointField* i, const sensor_msgs::PointField* j) +bool fieldComp (const pcl::PCLPointField* i, const pcl::PCLPointField* j) { return i->offset < j->offset; } ////////////////////////////////////////////////////////////////////////// bool -pcl::concatenateFields (const sensor_msgs::PointCloud2 &cloud1, - const sensor_msgs::PointCloud2 &cloud2, - sensor_msgs::PointCloud2 &cloud_out) +pcl::concatenateFields (const pcl::PCLPointCloud2 &cloud1, + const pcl::PCLPointCloud2 &cloud2, + pcl::PCLPointCloud2 &cloud_out) { // If the cloud's sizes differ (points wise), then exit with error if (cloud1.width != cloud2.width || cloud1.height != cloud2.height) @@ -99,13 +99,13 @@ pcl::concatenateFields (const sensor_msgs::PointCloud2 &cloud1, //for the non-matching fields in cloud1, we need to store the offset //from the beginning of the point - std::vector cloud1_unique_fields; + std::vector cloud1_unique_fields; std::vector field_sizes; //We need to make sure that the fields for cloud 1 are sorted //by offset so that we can compute sizes correctly. There is no //guarantee that the fields are in the correct order when they come in - std::vector cloud1_fields_sorted; + std::vector cloud1_fields_sorted; for (size_t i = 0; i < cloud1.fields.size (); ++i) cloud1_fields_sorted.push_back (&(cloud1.fields[i])); @@ -171,7 +171,7 @@ pcl::concatenateFields (const sensor_msgs::PointCloud2 &cloud1, for (size_t d = 0; d < cloud1_unique_fields.size (); ++d) { - const sensor_msgs::PointField& f = *cloud1_unique_fields[d]; + const pcl::PCLPointField& f = *cloud1_unique_fields[d]; cloud_out.fields[cloud2.fields.size () + d].name = f.name; cloud_out.fields[cloud2.fields.size () + d].datatype = f.datatype; cloud_out.fields[cloud2.fields.size () + d].count = f.count; @@ -191,7 +191,7 @@ pcl::concatenateFields (const sensor_msgs::PointCloud2 &cloud1, // since some fields are not unique for (size_t i = 0; i < cloud1_unique_fields.size (); ++i) { - const sensor_msgs::PointField& f = *cloud1_unique_fields[i]; + const pcl::PCLPointField& f = *cloud1_unique_fields[i]; int local_data_size = f.count * pcl::getFieldSize (f.datatype); int padding_size = field_sizes[i] - local_data_size; @@ -216,9 +216,9 @@ pcl::concatenateFields (const sensor_msgs::PointCloud2 &cloud1, ////////////////////////////////////////////////////////////////////////// bool -pcl::concatenatePointCloud (const sensor_msgs::PointCloud2 &cloud1, - const sensor_msgs::PointCloud2 &cloud2, - sensor_msgs::PointCloud2 &cloud_out) +pcl::concatenatePointCloud (const pcl::PCLPointCloud2 &cloud1, + const pcl::PCLPointCloud2 &cloud2, + pcl::PCLPointCloud2 &cloud_out) { //if one input cloud has no points, but the other input does, just return the cloud with points if (cloud1.width*cloud1.height == 0 && cloud2.width*cloud2.height > 0) @@ -262,7 +262,7 @@ pcl::concatenatePointCloud (const sensor_msgs::PointCloud2 &cloud1, if (strip) { // Get the field sizes for the second cloud - std::vector fields2; + std::vector fields2; std::vector fields2_sizes; for (size_t j = 0; j < cloud2.fields.size (); ++j) { @@ -325,7 +325,7 @@ pcl::concatenatePointCloud (const sensor_msgs::PointCloud2 &cloud1, ////////////////////////////////////////////////////////////////////////// bool -pcl::getPointCloudAsEigen (const sensor_msgs::PointCloud2 &in, Eigen::MatrixXf &out) +pcl::getPointCloudAsEigen (const pcl::PCLPointCloud2 &in, Eigen::MatrixXf &out) { // Get X-Y-Z indices int x_idx = getFieldIndex (in, "x"); @@ -338,9 +338,9 @@ pcl::getPointCloudAsEigen (const sensor_msgs::PointCloud2 &in, Eigen::MatrixXf & return (false); } - if (in.fields[x_idx].datatype != sensor_msgs::PointField::FLOAT32 || - in.fields[y_idx].datatype != sensor_msgs::PointField::FLOAT32 || - in.fields[z_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (in.fields[x_idx].datatype != pcl::PCLPointField::FLOAT32 || + in.fields[y_idx].datatype != pcl::PCLPointField::FLOAT32 || + in.fields[z_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("X-Y-Z coordinates not floats. Currently only floats are supported.\n"); return (false); @@ -367,7 +367,7 @@ pcl::getPointCloudAsEigen (const sensor_msgs::PointCloud2 &in, Eigen::MatrixXf & ////////////////////////////////////////////////////////////////////////// bool -pcl::getEigenAsPointCloud (Eigen::MatrixXf &in, sensor_msgs::PointCloud2 &out) +pcl::getEigenAsPointCloud (Eigen::MatrixXf &in, pcl::PCLPointCloud2 &out) { // Get X-Y-Z indices int x_idx = getFieldIndex (out, "x"); @@ -380,9 +380,9 @@ pcl::getEigenAsPointCloud (Eigen::MatrixXf &in, sensor_msgs::PointCloud2 &out) return (false); } - if (out.fields[x_idx].datatype != sensor_msgs::PointField::FLOAT32 || - out.fields[y_idx].datatype != sensor_msgs::PointField::FLOAT32 || - out.fields[z_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (out.fields[x_idx].datatype != pcl::PCLPointField::FLOAT32 || + out.fields[y_idx].datatype != pcl::PCLPointField::FLOAT32 || + out.fields[z_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("X-Y-Z coordinates not floats. Currently only floats are supported.\n"); return (false); @@ -415,9 +415,9 @@ pcl::getEigenAsPointCloud (Eigen::MatrixXf &in, sensor_msgs::PointCloud2 &out) ////////////////////////////////////////////////////////////////////////// void pcl::copyPointCloud ( - const sensor_msgs::PointCloud2 &cloud_in, + const pcl::PCLPointCloud2 &cloud_in, const std::vector &indices, - sensor_msgs::PointCloud2 &cloud_out) + pcl::PCLPointCloud2 &cloud_out) { cloud_out.header = cloud_in.header; cloud_out.height = 1; @@ -438,9 +438,9 @@ pcl::copyPointCloud ( ////////////////////////////////////////////////////////////////////////// void pcl::copyPointCloud ( - const sensor_msgs::PointCloud2 &cloud_in, + const pcl::PCLPointCloud2 &cloud_in, const std::vector > &indices, - sensor_msgs::PointCloud2 &cloud_out) + pcl::PCLPointCloud2 &cloud_out) { cloud_out.header = cloud_in.header; cloud_out.height = 1; @@ -460,8 +460,8 @@ pcl::copyPointCloud ( //////////////////////////////////////////////////////////////////////////////// void -pcl::copyPointCloud (const sensor_msgs::PointCloud2 &cloud_in, - sensor_msgs::PointCloud2 &cloud_out) +pcl::copyPointCloud (const pcl::PCLPointCloud2 &cloud_in, + pcl::PCLPointCloud2 &cloud_out) { cloud_out.header = cloud_in.header; cloud_out.height = cloud_in.height; diff --git a/common/src/pcl_base.cpp b/common/src/pcl_base.cpp index 226665da19f..963faa03f6b 100644 --- a/common/src/pcl_base.cpp +++ b/common/src/pcl_base.cpp @@ -39,7 +39,7 @@ #include /////////////////////////////////////////////////////////////////////////////////////////// -pcl::PCLBase::PCLBase () +pcl::PCLBase::PCLBase () : input_ () , indices_ () , use_indices_ (false) @@ -56,7 +56,7 @@ pcl::PCLBase::PCLBase () /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::PCLBase::setInputCloud (const PointCloud2ConstPtr &cloud) +pcl::PCLBase::setInputCloud (const PCLPointCloud2ConstPtr &cloud) { input_ = cloud; @@ -77,29 +77,29 @@ pcl::PCLBase::setInputCloud (const PointCloud2ConstPtr int fsize; switch (input_->fields[d].datatype) { - case sensor_msgs::PointField::INT8: - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::INT8: + case pcl::PCLPointField::UINT8: { fsize = 1; break; } - case sensor_msgs::PointField::INT16: - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::INT16: + case pcl::PCLPointField::UINT16: { fsize = 2; break; } - case sensor_msgs::PointField::INT32: - case sensor_msgs::PointField::UINT32: - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::INT32: + case pcl::PCLPointField::UINT32: + case pcl::PCLPointField::FLOAT32: { fsize = 4; break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { fsize = 8; break; @@ -118,14 +118,14 @@ pcl::PCLBase::setInputCloud (const PointCloud2ConstPtr /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::PCLBase::deinitCompute () +pcl::PCLBase::deinitCompute () { return (true); } /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::PCLBase::initCompute () +pcl::PCLBase::initCompute () { // Check if input was set if (!input_) @@ -159,7 +159,7 @@ pcl::PCLBase::initCompute () /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::PCLBase::setIndices (const IndicesPtr &indices) +pcl::PCLBase::setIndices (const IndicesPtr &indices) { indices_ = indices; fake_indices_ = false; @@ -168,7 +168,7 @@ pcl::PCLBase::setIndices (const IndicesPtr &indices) /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::PCLBase::setIndices (const PointIndicesConstPtr &indices) +pcl::PCLBase::setIndices (const PointIndicesConstPtr &indices) { indices_.reset (new std::vector (indices->indices)); fake_indices_ = false; diff --git a/common/src/range_image.cpp b/common/src/range_image.cpp index 7f696b4a212..28a939407f5 100644 --- a/common/src/range_image.cpp +++ b/common/src/range_image.cpp @@ -812,7 +812,7 @@ RangeImage::getRangeImageWithSmoothedSurface (int radius, RangeImage& smoothed_r ///////////////////////////////////////////////////////////////////////// void -RangeImage::extractFarRanges (const sensor_msgs::PointCloud2& point_cloud_data, +RangeImage::extractFarRanges (const pcl::PCLPointCloud2& point_cloud_data, PointCloud& far_ranges) { int x_idx = -1, y_idx = -1, z_idx = -1, diff --git a/cuda/apps/src/kinect_cloud.cpp b/cuda/apps/src/kinect_cloud.cpp index 3c728946522..c16f814383a 100644 --- a/cuda/apps/src/kinect_cloud.cpp +++ b/cuda/apps/src/kinect_cloud.cpp @@ -36,7 +36,7 @@ */ #include -#include +#include #include #include #include @@ -49,7 +49,7 @@ #include using namespace message_filters; -using namespace sensor_msgs; +using namespace pcl; using namespace pcl_cuda; DisparityToCloud d2c; @@ -58,9 +58,9 @@ ros::Publisher pub; struct EventHelper { void - callback (const sensor_msgs::Image::ConstPtr &depth, - const sensor_msgs::Image::ConstPtr &rgb, - const sensor_msgs::CameraInfo::ConstPtr &info) + callback (const pcl::PCLImage::ConstPtr &depth, + const pcl::PCLImage::ConstPtr &rgb, + const pcl::CameraInfo::ConstPtr &info) { //typedef pcl_cuda::SampleConsensusModel::Indices Indices; @@ -92,12 +92,12 @@ main (int argc, char **argv) ros::NodeHandle nh; // Prepare output - pub = nh.advertise("output", 1); + pub = nh.advertise("output", 1); // Subscribe to topics - Synchronizer > sync_rgb (30); - Synchronizer > sync (30); - Subscriber sub_depth, sub_rgb; + Synchronizer > sync_rgb (30); + Synchronizer > sync (30); + Subscriber sub_depth, sub_rgb; Subscriber sub_info; sub_depth.subscribe (nh, "/camera/depth/image", 30); sub_rgb.subscribe (nh, "/camera/rgb/image_color", 30); @@ -116,8 +116,8 @@ main (int argc, char **argv) else { sync.connectInput (sub_depth, sub_info); - //sync.registerCallback (bind (&pcl_cuda::DisparityToCloud::callback, k, _1, ImageConstPtr (), _2)); - sync.registerCallback (boost::bind (&EventHelper::callback, &h, _1, ImageConstPtr (), _2)); + //sync.registerCallback (bind (&pcl_cuda::DisparityToCloud::callback, k, _1, PCLImageConstPtr (), _2)); + sync.registerCallback (boost::bind (&EventHelper::callback, &h, _1, PCLImageConstPtr (), _2)); } // Do this indefinitely diff --git a/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h b/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h index dc4455dc943..57b9b72f3a1 100644 --- a/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h +++ b/cuda/io/include/pcl/cuda/io/disparity_to_cloud.h @@ -42,8 +42,8 @@ #include #include #include -//#include -//#include +//#include +//#include #include @@ -94,16 +94,16 @@ namespace cuda public: // // compute using ROS images, Device output // void -// compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::Image::ConstPtr &rgb_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +// compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::PCLImage::ConstPtr &rgb_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output); // // // compute using ROS images, Host output // void -// compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::Image::ConstPtr &rgb_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +// compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::PCLImage::ConstPtr &rgb_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output); // compute using OpenNI images, Device output @@ -131,13 +131,13 @@ namespace cuda // ... // void -// compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +// compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output); // // void -// compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +// compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output); void diff --git a/cuda/io/src/disparity_to_cloud.cu b/cuda/io/src/disparity_to_cloud.cu index 9b074c1104c..f1bb9a0121d 100644 --- a/cuda/io/src/disparity_to_cloud.cu +++ b/cuda/io/src/disparity_to_cloud.cu @@ -94,9 +94,9 @@ ComputeXYZRGB::operator () (const Tuple &t) ////////////////////////////////////////////////////////////////////////// //void -//DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::Image::ConstPtr &rgb_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +//DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::PCLImage::ConstPtr &rgb_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) @@ -149,9 +149,9 @@ ComputeXYZRGB::operator () (const Tuple &t) // //////////////////////////////////////////////////////////////////////////// //void -//DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::Image::ConstPtr &rgb_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +//DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::PCLImage::ConstPtr &rgb_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) @@ -448,20 +448,20 @@ DisparityToCloud::compute (const boost::shared_ptr& ////////////////////////////////////////////////////////////////////////// //void -//DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +//DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) // output.reset (new PointCloudAOS); // -// compute (depth_image, sensor_msgs::Image::ConstPtr(), info, output); +// compute (depth_image, pcl::PCLImage::ConstPtr(), info, output); //} // //////////////////////////////////////////////////////////////////////////// //void -//DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, -// const sensor_msgs::CameraInfo::ConstPtr &info, +//DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, +// const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) diff --git a/cuda/io/src/kinect_smoothing.cu b/cuda/io/src/kinect_smoothing.cu index 882bf2abb6a..5a9065f5e32 100644 --- a/cuda/io/src/kinect_smoothing.cu +++ b/cuda/io/src/kinect_smoothing.cu @@ -85,9 +85,9 @@ namespace pcl ////////////////////////////////////////////////////////////////////////// //void - //DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, - // const sensor_msgs::Image::ConstPtr &rgb_image, - // const sensor_msgs::CameraInfo::ConstPtr &info, + //DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, + // const pcl::PCLImage::ConstPtr &rgb_image, + // const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) @@ -140,9 +140,9 @@ namespace pcl // //////////////////////////////////////////////////////////////////////////// //void - //DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, - // const sensor_msgs::Image::ConstPtr &rgb_image, - // const sensor_msgs::CameraInfo::ConstPtr &info, + //DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, + // const pcl::PCLImage::ConstPtr &rgb_image, + // const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) @@ -299,20 +299,20 @@ namespace pcl ////////////////////////////////////////////////////////////////////////// //void - //DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, - // const sensor_msgs::CameraInfo::ConstPtr &info, + //DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, + // const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) // output.reset (new PointCloudAOS); // - // compute (depth_image, sensor_msgs::Image::ConstPtr(), info, output); + // compute (depth_image, pcl::PCLImage::ConstPtr(), info, output); //} // //////////////////////////////////////////////////////////////////////////// //void - //DisparityToCloud::compute (const sensor_msgs::Image::ConstPtr &depth_image, - // const sensor_msgs::CameraInfo::ConstPtr &info, + //DisparityToCloud::compute (const pcl::PCLImage::ConstPtr &depth_image, + // const pcl::CameraInfo::ConstPtr &info, // PointCloudAOS::Ptr &output) //{ // if (!output) diff --git a/doc/advanced/content/pcl2.rst b/doc/advanced/content/pcl2.rst index 2bb9d6a7b12..ae5faba35f8 100644 --- a/doc/advanced/content/pcl2.rst +++ b/doc/advanced/content/pcl2.rst @@ -18,11 +18,11 @@ The :pcl:`PointCloud ` class represents the base class in PCL for holding **nD** (n dimensional) data. The 1.x API includes the following data members: - * :pcl:`Header ` (coming from ROS) + * :pcl:`PCLHeader ` (coming from ROS) - * **uint32_t** :pcl:`seq ` - a sequence number - * **uint64_t** :pcl:`stamp ` - a timestamp associated with the time when the data was acquired - * **std::string** :pcl:`frame_id ` - a TF frame ID + * **uint32_t** :pcl:`seq ` - a sequence number + * **uint64_t** :pcl:`stamp ` - a timestamp associated with the time when the data was acquired + * **std::string** :pcl:`frame_id ` - a TF frame ID * **std::vector** :pcl:`points ` - a std C++ vector of T data. T can be a structure of any of the types defined in `point_types.h`. @@ -37,7 +37,7 @@ The 1.x API includes the following data members: Proposals for the 2.x API: * drop templating on point types, thus making :pcl:`PointCloud ` template free - * drop the :pcl:`Header ` structure, or consolidate all the above information (width, height, is_dense, sensor_origin, sensor_orientation) into a single struct + * drop the :pcl:`PCLHeader ` structure, or consolidate all the above information (width, height, is_dense, sensor_origin, sensor_orientation) into a single struct * make sure we can access a slice of the data as a *2D image*, thus allowing fast 2D displaying, [u, v] operations, etc * make sure we can access a slice of the data as a subpoint cloud: only certain points are chosen from the main point cloud * implement channels (of a single type!) as data holders, e.g.: diff --git a/doc/tutorials/content/kdtree_search.rst b/doc/tutorials/content/kdtree_search.rst index e6abec078f2..ef387dde7c4 100644 --- a/doc/tutorials/content/kdtree_search.rst +++ b/doc/tutorials/content/kdtree_search.rst @@ -3,12 +3,12 @@ How to use a KdTree to search ----------------------------- -In this tutorial we will go over how to use a KdTree for finding the K nearest neighbors of a specific point or location, and then we will also go over how to find all neighbors within some radius specfied by the user (in this case random). +In this tutorial we will go over how to use a KdTree for finding the K nearest neighbors of a specific point or location, and then we will also go over how to find all neighbors within some radius specified by the user (in this case random). Theoretical primer ------------------ -A k-d tree, or k-dimensional tree, is a data structure used in computer science for organizing some number of points in a space with k dimensions. It is a binary search tree with other constrainsts imposed on it. K-d trees are very useful for range and nearest beighbor searches. For our purposed we will generally only be dealing with pointClouds in three dimensions, so all of our k-d trees will be 3-d k-d trees. Each level of a k-d tree splits all children on a specific dimension. At the root of the tree all children will be split based on the first dimension (ie. if the first dimension coordinate is less than the root it will be in the left-sub tree and if it is greater than the root it will obviously bee in the right sub-tree). Each level down in the tree divides on the next dimension, returning to the first dimension once all other have been exhausted. They most efficient way to build a k-d tree is to use a partition method like the one Quick Sort uses to place the median point at the root and everything with a smaller one dimensional value to the left and larger to the right. You then repeat this procedure on both the left and right sub-trees until the last trees that you are to partition are only composed of one element. +A k-d tree, or k-dimensional tree, is a data structure used in computer science for organizing some number of points in a space with k dimensions. It is a binary search tree with other constraints imposed on it. K-d trees are very useful for range and nearest neighbor searches. For our purposes we will generally only be dealing with point clouds in three dimensions, so all of our k-d trees will be three-dimensional. Each level of a k-d tree splits all children along a specific dimension, using a hyperplane that is perpendicular to the corresponding axis. At the root of the tree all children will be split based on the first dimension (i.e. if the first dimension coordinate is less than the root it will be in the left-sub tree and if it is greater than the root it will obviously be in the right sub-tree). Each level down in the tree divides on the next dimension, returning to the first dimension once all others have been exhausted. They most efficient way to build a k-d tree is to use a partition method like the one Quick Sort uses to place the median point at the root and everything with a smaller one dimensional value to the left and larger to the right. You then repeat this procedure on both the left and right sub-trees until the last trees that you are to partition are only composed of one element. From [Wikipedia]_: @@ -146,3 +146,4 @@ Once you have run it you should see something similar to this:: 356.962 247.285 514.959 (squared distance: 50423.7) 282.065 509.488 516.216 (squared distance: 50730.4) +.. [Wikipedia] http://en.wikipedia.org/wiki/K-d_tree diff --git a/doc/tutorials/content/reading_pcd.rst b/doc/tutorials/content/reading_pcd.rst index 62d0ae2bc64..de478d9959d 100644 --- a/doc/tutorials/content/reading_pcd.rst +++ b/doc/tutorials/content/reading_pcd.rst @@ -33,15 +33,15 @@ creates a PointCloud boost shared pointer and initializes it. loads the PointCloud data from disk (we assume that test_pcd.pcd has already been created from the previous tutorial) into the binary blob. -Alternatively, you can read a PointCloud2 blob (available only in PCL 1.x). Due +Alternatively, you can read a PCLPointCloud2 blob (available only in PCL 1.x). Due to the dynamic nature of point clouds, we prefer to read them as binary blobs, and then convert to the actual representation that we want to use. .. code-block:: cpp - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; pcl::io::loadPCDFile ("test_pcd.pcd", cloud_blob); - pcl::fromROSMsg (cloud_blob, *cloud); //* convert from sensor_msgs/PointCloud2 to pcl::PointCloud + pcl::fromROSMsg (cloud_blob, *cloud); //* convert from pcl/PCLPointCloud2 to pcl::PointCloud reads and converts the binary blob into the templated PointCloud format, here using pcl::PointXYZ as the underlying point type. diff --git a/doc/tutorials/content/sources/don_segmentation/don_segmentation.cpp b/doc/tutorials/content/sources/don_segmentation/don_segmentation.cpp index eb3a0702869..afe41800065 100644 --- a/doc/tutorials/content/sources/don_segmentation/don_segmentation.cpp +++ b/doc/tutorials/content/sources/don_segmentation/don_segmentation.cpp @@ -51,7 +51,7 @@ main (int argc, char *argv[]) istringstream (argv[5]) >> segradius; // threshold for radius segmentation // Load cloud in blob format - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::io::loadPCDFile (infile.c_str (), blob); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); pcl::fromROSMsg (blob, *cloud); diff --git a/doc/tutorials/content/sources/extract_indices/extract_indices.cpp b/doc/tutorials/content/sources/extract_indices/extract_indices.cpp index fa43ab6baad..4a0a7ab1761 100644 --- a/doc/tutorials/content/sources/extract_indices/extract_indices.cpp +++ b/doc/tutorials/content/sources/extract_indices/extract_indices.cpp @@ -11,7 +11,7 @@ int main (int argc, char** argv) { - sensor_msgs::PointCloud2::Ptr cloud_blob (new sensor_msgs::PointCloud2), cloud_filtered_blob (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud_blob (new pcl::PCLPointCloud2), cloud_filtered_blob (new pcl::PCLPointCloud2); pcl::PointCloud::Ptr cloud_filtered (new pcl::PointCloud), cloud_p (new pcl::PointCloud), cloud_f (new pcl::PointCloud); // Fill in the cloud data @@ -21,7 +21,7 @@ main (int argc, char** argv) std::cerr << "PointCloud before filtering: " << cloud_blob->width * cloud_blob->height << " data points." << std::endl; // Create the filtering object: downsample the dataset using a leaf size of 1cm - pcl::VoxelGrid sor; + pcl::VoxelGrid sor; sor.setInputCloud (cloud_blob); sor.setLeafSize (0.01f, 0.01f, 0.01f); sor.filter (*cloud_filtered_blob); diff --git a/doc/tutorials/content/sources/greedy_projection/greedy_projection.cpp b/doc/tutorials/content/sources/greedy_projection/greedy_projection.cpp index 4bf82a2def3..8369a27f151 100644 --- a/doc/tutorials/content/sources/greedy_projection/greedy_projection.cpp +++ b/doc/tutorials/content/sources/greedy_projection/greedy_projection.cpp @@ -9,7 +9,7 @@ main (int argc, char** argv) { // Load input file into a PointCloud with an appropriate type pcl::PointCloud::Ptr cloud (new pcl::PointCloud); - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; pcl::io::loadPCDFile ("bun0.pcd", cloud_blob); pcl::fromROSMsg (cloud_blob, *cloud); //* the data should be available in cloud diff --git a/doc/tutorials/content/sources/registration_api/example1.cpp b/doc/tutorials/content/sources/registration_api/example1.cpp index ce5026c2e8a..d33874b8aa2 100644 --- a/doc/tutorials/content/sources/registration_api/example1.cpp +++ b/doc/tutorials/content/sources/registration_api/example1.cpp @@ -21,7 +21,7 @@ #include using namespace std; -using namespace sensor_msgs; +using namespace pcl; using namespace pcl; using namespace pcl::io; using namespace pcl::console; diff --git a/doc/tutorials/content/sources/registration_api/example2.cpp b/doc/tutorials/content/sources/registration_api/example2.cpp index 6467f1a57cc..83932ce3cc9 100644 --- a/doc/tutorials/content/sources/registration_api/example2.cpp +++ b/doc/tutorials/content/sources/registration_api/example2.cpp @@ -13,7 +13,7 @@ #include using namespace std; -using namespace sensor_msgs; +using namespace pcl; using namespace pcl; using namespace pcl::io; using namespace pcl::console; @@ -97,7 +97,7 @@ estimateFPFH (const PointCloud::Ptr &src, // For debugging purposes only: uncomment the lines below and use pcd_viewer to view the results, i.e.: // pcd_viewer fpfhs_src.pcd - PointCloud2 s, t, out; + PCLPointCloud2 s, t, out; toROSMsg (*keypoints_src, s); toROSMsg (fpfhs_src, t); concatenateFields (s, t, out); savePCDFile ("fpfhs_src.pcd", out); toROSMsg (*keypoints_tgt, s); toROSMsg (fpfhs_tgt, t); concatenateFields (s, t, out); diff --git a/doc/tutorials/content/sources/vfh_recognition/build_tree.cpp b/doc/tutorials/content/sources/vfh_recognition/build_tree.cpp index 26652660f77..5078a4fdc32 100644 --- a/doc/tutorials/content/sources/vfh_recognition/build_tree.cpp +++ b/doc/tutorials/content/sources/vfh_recognition/build_tree.cpp @@ -21,7 +21,7 @@ loadHist (const boost::filesystem::path &path, vfh_model &vfh) // Load the file as a PCD try { - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; int version; Eigen::Vector4f origin; Eigen::Quaternionf orientation; @@ -45,7 +45,7 @@ loadHist (const boost::filesystem::path &path, vfh_model &vfh) pcl::io::loadPCDFile (path.string (), point); vfh.second.resize (308); - std::vector fields; + std::vector fields; pcl::getFieldIndex (point, "vfh", fields); for (size_t i = 0; i < fields[vfh_idx].count; ++i) diff --git a/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp b/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp index 8aecaa2aa3a..dd75a6a2f89 100644 --- a/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp +++ b/doc/tutorials/content/sources/vfh_recognition/nearest_neighbors.cpp @@ -24,7 +24,7 @@ loadHist (const boost::filesystem::path &path, vfh_model &vfh) // Load the file as a PCD try { - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; int version; Eigen::Vector4f origin; Eigen::Quaternionf orientation; @@ -48,7 +48,7 @@ loadHist (const boost::filesystem::path &path, vfh_model &vfh) pcl::io::loadPCDFile (path.string (), point); vfh.second.resize (308); - std::vector fields; + std::vector fields; getFieldIndex (point, "vfh", fields); for (size_t i = 0; i < fields[vfh_idx].count; ++i) @@ -216,7 +216,7 @@ main (int argc, char** argv) m++; } - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; pcl::console::print_highlight (stderr, "Loading "); pcl::console::print_value (stderr, "%s ", cloud_name.c_str ()); if (pcl::io::loadPCDFile (cloud_name, cloud) == -1) break; diff --git a/doc/tutorials/content/sources/voxel_grid/voxel_grid.cpp b/doc/tutorials/content/sources/voxel_grid/voxel_grid.cpp index d55137b748f..abd31d0806d 100644 --- a/doc/tutorials/content/sources/voxel_grid/voxel_grid.cpp +++ b/doc/tutorials/content/sources/voxel_grid/voxel_grid.cpp @@ -6,8 +6,8 @@ int main (int argc, char** argv) { - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2 ()); - sensor_msgs::PointCloud2::Ptr cloud_filtered (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud_filtered (new pcl::PCLPointCloud2 ()); // Fill in the cloud data pcl::PCDReader reader; @@ -18,7 +18,7 @@ main (int argc, char** argv) << " data points (" << pcl::getFieldsList (*cloud) << ")."; // Create the filtering object - pcl::VoxelGrid sor; + pcl::VoxelGrid sor; sor.setInputCloud (cloud); sor.setLeafSize (0.01f, 0.01f, 0.01f); sor.filter (*cloud_filtered); diff --git a/doc/tutorials/content/writing_new_classes.rst b/doc/tutorials/content/writing_new_classes.rst index ee4a2f3c7da..207e04a552e 100644 --- a/doc/tutorials/content/writing_new_classes.rst +++ b/doc/tutorials/content/writing_new_classes.rst @@ -181,7 +181,7 @@ Assuming that we want the new algorithm to be part of the PCL Filtering library, We also need a name for our new class. Let's call it `BilateralFilter`. -.. [*] The PCL Filtering API specifies that two definitions and implementations must be available for every algorithm: one operating on PointCloud and another one operating on PointCloud2. For the purpose of this tutorial, we will concentrate only on the former. +.. [*] The PCL Filtering API specifies that two definitions and implementations must be available for every algorithm: one operating on PointCloud and another one operating on PCLPointCloud2. For the purpose of this tutorial, we will concentrate only on the former. bilateral.h =========== diff --git a/examples/features/example_difference_of_normals.cpp b/examples/features/example_difference_of_normals.cpp index da27444d439..d55f921db7c 100644 --- a/examples/features/example_difference_of_normals.cpp +++ b/examples/features/example_difference_of_normals.cpp @@ -61,7 +61,7 @@ int main (int argc, char *argv[]) string outfile = argv[2]; // Load cloud in blob format - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::io::loadPCDFile (infile.c_str(), blob); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); diff --git a/examples/outofcore/example_outofcore.cpp b/examples/outofcore/example_outofcore.cpp index f155dbee3b1..bf83e0d003b 100644 --- a/examples/outofcore/example_outofcore.cpp +++ b/examples/outofcore/example_outofcore.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include @@ -66,7 +66,7 @@ int main (int, char** argv) OctreeDisk* octree; octree = new OctreeDisk (depth, min, max, file_location, "ECEF"); - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ()); pcl::io::loadPCDFile (argv[1], *cloud); octree->addPointCloud (cloud, false); diff --git a/examples/outofcore/example_outofcore_with_lod.cpp b/examples/outofcore/example_outofcore_with_lod.cpp index 1aa4a6f1e77..f197237bfee 100644 --- a/examples/outofcore/example_outofcore_with_lod.cpp +++ b/examples/outofcore/example_outofcore_with_lod.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include using namespace pcl::outofcore; @@ -66,7 +66,7 @@ int main (int, char** argv) octree = new OctreeDisk (depth, min, max, file_location, "ECEF"); - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ()); pcl::io::loadPCDFile (argv[1], *cloud); diff --git a/examples/surface/example_nurbs_fitting_closed_curve.cpp b/examples/surface/example_nurbs_fitting_closed_curve.cpp index 3603f053a31..0dc72b6e838 100644 --- a/examples/surface/example_nurbs_fitting_closed_curve.cpp +++ b/examples/surface/example_nurbs_fitting_closed_curve.cpp @@ -75,7 +75,7 @@ main (int argc, char *argv[]) // #################### LOAD FILE ######################### printf (" loading %s\n", pcd_file.c_str ()); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); - sensor_msgs::PointCloud2 cloud2; + pcl::PCLPointCloud2 cloud2; if (pcl::io::loadPCDFile (pcd_file, cloud2) == -1) throw std::runtime_error (" PCD file not found."); diff --git a/examples/surface/example_nurbs_fitting_closed_curve3d.cpp b/examples/surface/example_nurbs_fitting_closed_curve3d.cpp index be52ed78640..b09cb45faa8 100644 --- a/examples/surface/example_nurbs_fitting_closed_curve3d.cpp +++ b/examples/surface/example_nurbs_fitting_closed_curve3d.cpp @@ -73,7 +73,7 @@ main (int argc, char *argv[]) // #################### LOAD FILE ######################### printf (" loading %s\n", pcd_file.c_str ()); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); - sensor_msgs::PointCloud2 cloud2; + pcl::PCLPointCloud2 cloud2; if (pcl::io::loadPCDFile (pcd_file, cloud2) == -1) throw std::runtime_error (" PCD file not found."); diff --git a/examples/surface/example_nurbs_fitting_curve2d.cpp b/examples/surface/example_nurbs_fitting_curve2d.cpp index ff87be0ba19..a67a47e9c6c 100644 --- a/examples/surface/example_nurbs_fitting_curve2d.cpp +++ b/examples/surface/example_nurbs_fitting_curve2d.cpp @@ -73,7 +73,7 @@ main (int argc, char *argv[]) // #################### LOAD FILE ######################### printf (" loading %s\n", pcd_file.c_str ()); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); - sensor_msgs::PointCloud2 cloud2; + pcl::PCLPointCloud2 cloud2; if (pcl::io::loadPCDFile (pcd_file, cloud2) == -1) throw std::runtime_error (" PCD file not found."); diff --git a/examples/surface/example_nurbs_fitting_surface.cpp b/examples/surface/example_nurbs_fitting_surface.cpp index 8f8d2adf287..97eb6f82ed1 100644 --- a/examples/surface/example_nurbs_fitting_surface.cpp +++ b/examples/surface/example_nurbs_fitting_surface.cpp @@ -84,7 +84,7 @@ main (int argc, char *argv[]) // load point cloud printf (" loading %s\n", pcd_file.c_str ()); pcl::PointCloud::Ptr cloud (new pcl::PointCloud); - sensor_msgs::PointCloud2 cloud2; + pcl::PCLPointCloud2 cloud2; pcl::on_nurbs::NurbsDataSurface data; if (pcl::io::loadPCDFile (pcd_file, cloud2) == -1) diff --git a/filters/include/pcl/filters/crop_box.h b/filters/include/pcl/filters/crop_box.h index 81fe9f82e47..e632c639523 100644 --- a/filters/include/pcl/filters/crop_box.h +++ b/filters/include/pcl/filters/crop_box.h @@ -208,21 +208,21 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS CropBox : public FilterIndices + class PCL_EXPORTS CropBox : public FilterIndices { - using Filter::filter_name_; - using Filter::getClassName; + using Filter::filter_name_; + using Filter::getClassName; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; public: /** \brief Constructor. * \param[in] extract_removed_indices Set to true if you want to be able to extract the indices of points being removed (default = false). */ CropBox (bool extract_removed_indices = false) : - FilterIndices::FilterIndices (extract_removed_indices), + FilterIndices::FilterIndices (extract_removed_indices), min_pt_(Eigen::Vector4f (-1, -1, -1, 1)), max_pt_(Eigen::Vector4f (1, 1, 1, 1)), translation_ (Eigen::Vector3f::Zero ()), @@ -321,7 +321,7 @@ namespace pcl * \param output the resultant point cloud */ void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); /** \brief Sample of point indices * \param indices the resultant point cloud indices diff --git a/filters/include/pcl/filters/extract_indices.h b/filters/include/pcl/filters/extract_indices.h index 0ab90560cc2..dbadbcd1c47 100644 --- a/filters/include/pcl/filters/extract_indices.h +++ b/filters/include/pcl/filters/extract_indices.h @@ -158,12 +158,12 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS ExtractIndices : public FilterIndices + class PCL_EXPORTS ExtractIndices : public FilterIndices { public: - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; /** \brief Empty constructor. */ ExtractIndices () @@ -173,20 +173,20 @@ namespace pcl } protected: - using PCLBase::input_; - using PCLBase::indices_; - using PCLBase::use_indices_; - using Filter::filter_name_; - using Filter::getClassName; - using FilterIndices::negative_; - using FilterIndices::keep_organized_; - using FilterIndices::user_filter_value_; + using PCLBase::input_; + using PCLBase::indices_; + using PCLBase::use_indices_; + using Filter::filter_name_; + using Filter::getClassName; + using FilterIndices::negative_; + using FilterIndices::keep_organized_; + using FilterIndices::user_filter_value_; /** \brief Extract point indices into a separate PointCloud * \param[out] output the resultant point cloud */ void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); /** \brief Extract point indices * \param indices the resultant indices diff --git a/filters/include/pcl/filters/filter.h b/filters/include/pcl/filters/filter.h index f92bc9ba39e..f2a7e5165b9 100644 --- a/filters/include/pcl/filters/filter.h +++ b/filters/include/pcl/filters/filter.h @@ -185,15 +185,15 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS Filter : public PCLBase + class PCL_EXPORTS Filter : public PCLBase { public: - typedef boost::shared_ptr< Filter > Ptr; - typedef boost::shared_ptr< const Filter > ConstPtr; + typedef boost::shared_ptr< Filter > Ptr; + typedef boost::shared_ptr< const Filter > ConstPtr; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; /** \brief Empty constructor. * \param[in] extract_removed_indices set to true if the filtered data indices should be saved in a @@ -229,7 +229,7 @@ namespace pcl * \param[out] output the resultant filtered point cloud dataset */ void - filter (PointCloud2 &output); + filter (PCLPointCloud2 &output); protected: @@ -249,7 +249,7 @@ namespace pcl * \param[out] output the resultant filtered point cloud */ virtual void - applyFilter (PointCloud2 &output) = 0; + applyFilter (PCLPointCloud2 &output) = 0; /** \brief Get a string representation of the name of this class. */ inline const std::string& diff --git a/filters/include/pcl/filters/filter_indices.h b/filters/include/pcl/filters/filter_indices.h index d7ff7ea4570..a3cee661105 100644 --- a/filters/include/pcl/filters/filter_indices.h +++ b/filters/include/pcl/filters/filter_indices.h @@ -190,10 +190,10 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS FilterIndices : public Filter + class PCL_EXPORTS FilterIndices : public Filter { public: - typedef sensor_msgs::PointCloud2 PointCloud2; + typedef pcl::PCLPointCloud2 PCLPointCloud2; /** \brief Constructor. * \param[in] extract_removed_indices Set to true if you want to extract the indices of points being removed (default = false). @@ -213,9 +213,9 @@ namespace pcl } virtual void - filter (PointCloud2 &output) + filter (PCLPointCloud2 &output) { - pcl::Filter::filter (output); + pcl::Filter::filter (output); } /** \brief Calls the filtering method and returns the filtered point cloud indices. diff --git a/filters/include/pcl/filters/impl/approximate_voxel_grid.hpp b/filters/include/pcl/filters/impl/approximate_voxel_grid.hpp index 9be9f5667f0..7bff0a7dddb 100644 --- a/filters/include/pcl/filters/impl/approximate_voxel_grid.hpp +++ b/filters/include/pcl/filters/impl/approximate_voxel_grid.hpp @@ -69,7 +69,7 @@ pcl::ApproximateVoxelGrid::applyFilter (PointCloud &output) centroid_size = boost::mpl::size::value; // ---[ RGB special case - std::vector fields; + std::vector fields; int rgba_index = -1; rgba_index = pcl::getFieldIndex (*input_, "rgb", fields); if (rgba_index == -1) diff --git a/filters/include/pcl/filters/impl/conditional_removal.hpp b/filters/include/pcl/filters/impl/conditional_removal.hpp index fe2aa22192d..e108389adcd 100644 --- a/filters/include/pcl/filters/impl/conditional_removal.hpp +++ b/filters/include/pcl/filters/impl/conditional_removal.hpp @@ -54,7 +54,7 @@ pcl::FieldComparison::FieldComparison ( op_ = op; // Get all fields - std::vector point_fields; + std::vector point_fields; // Use a dummy cloud to get the field types in a clever way PointCloud dummyCloud; pcl::getFields (dummyCloud, point_fields); @@ -141,7 +141,7 @@ pcl::PackedRGBComparison::PackedRGBComparison ( component_name_ (component_name), component_offset_ (), compare_val_ (compare_val) { // get all the fields - std::vector point_fields; + std::vector point_fields; // Use a dummy cloud to get the field types in a clever way PointCloud dummyCloud; pcl::getFields (dummyCloud, point_fields); @@ -162,9 +162,9 @@ pcl::PackedRGBComparison::PackedRGBComparison ( // Verify the datatype uint8_t datatype = point_fields[d].datatype; - if (datatype != sensor_msgs::PointField::FLOAT32 && - datatype != sensor_msgs::PointField::UINT32 && - datatype != sensor_msgs::PointField::INT32) + if (datatype != pcl::PCLPointField::FLOAT32 && + datatype != pcl::PCLPointField::UINT32 && + datatype != pcl::PCLPointField::INT32) { PCL_WARN ("[pcl::PackedRGBComparison::PackedRGBComparison] has unusable type!\n"); capable_ = false; @@ -233,7 +233,7 @@ pcl::PackedHSIComparison::PackedHSIComparison ( component_name_ (component_name), component_id_ (), compare_val_ (compare_val), rgb_offset_ () { // Get all the fields - std::vector point_fields; + std::vector point_fields; // Use a dummy cloud to get the field types in a clever way PointCloud dummyCloud; pcl::getFields (dummyCloud, point_fields); @@ -252,9 +252,9 @@ pcl::PackedHSIComparison::PackedHSIComparison ( // Verify the datatype uint8_t datatype = point_fields[d].datatype; - if (datatype != sensor_msgs::PointField::FLOAT32 && - datatype != sensor_msgs::PointField::UINT32 && - datatype != sensor_msgs::PointField::INT32) + if (datatype != pcl::PCLPointField::FLOAT32 && + datatype != pcl::PCLPointField::UINT32 && + datatype != pcl::PCLPointField::INT32) { PCL_WARN ("[pcl::PackedHSIComparison::PackedHSIComparison] has unusable type!\n"); capable_ = false; @@ -382,7 +382,7 @@ pcl::TfQuadraticXYZComparison::TfQuadraticXYZComparison () : comp_matr_ (), comp_vect_ (), comp_scalar_ (0.0) { // get all the fields - std::vector point_fields; + std::vector point_fields; // Use a dummy cloud to get the field types in a clever way PointCloud dummyCloud; pcl::getFields (dummyCloud, point_fields); @@ -447,7 +447,7 @@ pcl::TfQuadraticXYZComparison::TfQuadraticXYZComparison (const pcl::Comp comp_matr_ (), comp_vect_ (), comp_scalar_ (comparison_scalar) { // get all the fields - std::vector point_fields; + std::vector point_fields; // Use a dummy cloud to get the field types in a clever way PointCloud dummyCloud; pcl::getFields (dummyCloud, point_fields); @@ -545,49 +545,49 @@ pcl::PointDataAtOffset::compare (const PointT& p, const double& val) switch (datatype_) { - case sensor_msgs::PointField::INT8 : + case pcl::PCLPointField::INT8 : { int8_t pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (int8_t)); return (pt_val > static_cast(val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::UINT8 : + case pcl::PCLPointField::UINT8 : { uint8_t pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (uint8_t)); return (pt_val > static_cast(val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::INT16 : + case pcl::PCLPointField::INT16 : { int16_t pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (int16_t)); return (pt_val > static_cast(val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::UINT16 : + case pcl::PCLPointField::UINT16 : { uint16_t pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (uint16_t)); return (pt_val > static_cast (val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::INT32 : + case pcl::PCLPointField::INT32 : { int32_t pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (int32_t)); return (pt_val > static_cast (val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::UINT32 : + case pcl::PCLPointField::UINT32 : { uint32_t pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (uint32_t)); return (pt_val > static_cast (val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::FLOAT32 : + case pcl::PCLPointField::FLOAT32 : { float pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (float)); return (pt_val > static_cast (val)) - (pt_val < static_cast (val)); } - case sensor_msgs::PointField::FLOAT64 : + case pcl::PCLPointField::FLOAT64 : { double pt_val; memcpy (&pt_val, pt_data + this->offset_, sizeof (double)); diff --git a/filters/include/pcl/filters/impl/extract_indices.hpp b/filters/include/pcl/filters/impl/extract_indices.hpp index 642feb04967..2bfd4ec2486 100644 --- a/filters/include/pcl/filters/impl/extract_indices.hpp +++ b/filters/include/pcl/filters/impl/extract_indices.hpp @@ -54,7 +54,7 @@ pcl::ExtractIndices::filterDirectly (PointCloudPtr &cloud) applyFilterIndices (indices); extract_removed_indices_ = temp; - std::vector fields; + std::vector fields; pcl::for_each_type (pcl::detail::FieldAdder (fields)); for (int rii = 0; rii < static_cast (removed_indices_->size ()); ++rii) // rii = removed indices iterator { @@ -79,7 +79,7 @@ pcl::ExtractIndices::applyFilter (PointCloud &output) extract_removed_indices_ = temp; output = *input_; - std::vector fields; + std::vector fields; pcl::for_each_type (pcl::detail::FieldAdder (fields)); for (int rii = 0; rii < static_cast (removed_indices_->size ()); ++rii) // rii = removed indices iterator { diff --git a/filters/include/pcl/filters/impl/passthrough.hpp b/filters/include/pcl/filters/impl/passthrough.hpp index e7fb61f6775..df8a5b52fa3 100644 --- a/filters/include/pcl/filters/impl/passthrough.hpp +++ b/filters/include/pcl/filters/impl/passthrough.hpp @@ -99,7 +99,7 @@ pcl::PassThrough::applyFilterIndices (std::vector &indices) else { // Attempt to get the field name's index - std::vector fields; + std::vector fields; int distance_idx = pcl::getFieldIndex (*input_, filter_field_name_, fields); if (distance_idx == -1) { diff --git a/filters/include/pcl/filters/impl/random_sample.hpp b/filters/include/pcl/filters/impl/random_sample.hpp index 9867e126158..0aea70fcfea 100644 --- a/filters/include/pcl/filters/impl/random_sample.hpp +++ b/filters/include/pcl/filters/impl/random_sample.hpp @@ -56,7 +56,7 @@ pcl::RandomSample::applyFilter (PointCloud &output) extract_removed_indices_ = temp; copyPointCloud (*input_, output); // Get X, Y, Z fields - std::vector fields; + std::vector fields; pcl::getFields (*input_, fields); std::vector offsets; for (size_t i = 0; i < fields.size (); ++i) diff --git a/filters/include/pcl/filters/impl/voxel_grid.hpp b/filters/include/pcl/filters/impl/voxel_grid.hpp index bc75f657bf7..1b2cd041a97 100644 --- a/filters/include/pcl/filters/impl/voxel_grid.hpp +++ b/filters/include/pcl/filters/impl/voxel_grid.hpp @@ -53,7 +53,7 @@ pcl::getMinMax3D (const typename pcl::PointCloud::ConstPtr &cloud, max_p.setConstant (-FLT_MAX); // Get the fields list and the distance field index - std::vector fields; + std::vector fields; int distance_idx = pcl::getFieldIndex (*cloud, distance_field_name, fields); float distance_value; @@ -132,7 +132,7 @@ pcl::getMinMax3D (const typename pcl::PointCloud::ConstPtr &cloud, max_p.setConstant (-FLT_MAX); // Get the fields list and the distance field index - std::vector fields; + std::vector fields; int distance_idx = pcl::getFieldIndex (*cloud, distance_field_name, fields); float distance_value; @@ -264,7 +264,7 @@ pcl::VoxelGrid::applyFilter (PointCloud &output) centroid_size = boost::mpl::size::value; // ---[ RGB special case - std::vector fields; + std::vector fields; int rgba_index = -1; rgba_index = pcl::getFieldIndex (*input_, "rgb", fields); if (rgba_index == -1) @@ -282,7 +282,7 @@ pcl::VoxelGrid::applyFilter (PointCloud &output) if (!filter_field_name_.empty ()) { // Get the distance field index - std::vector fields; + std::vector fields; int distance_idx = pcl::getFieldIndex (*input_, filter_field_name_, fields); if (distance_idx == -1) PCL_WARN ("[pcl::%s::applyFilter] Invalid filter field name. Index is %d.\n", getClassName ().c_str (), distance_idx); diff --git a/filters/include/pcl/filters/impl/voxel_grid_covariance.hpp b/filters/include/pcl/filters/impl/voxel_grid_covariance.hpp index e704aca4562..b82ba2b8a24 100644 --- a/filters/include/pcl/filters/impl/voxel_grid_covariance.hpp +++ b/filters/include/pcl/filters/impl/voxel_grid_covariance.hpp @@ -107,7 +107,7 @@ pcl::VoxelGridCovariance::applyFilter (PointCloud &output) centroid_size = boost::mpl::size::value; // ---[ RGB special case - std::vector fields; + std::vector fields; int rgba_index = -1; rgba_index = pcl::getFieldIndex (*input_, "rgb", fields); if (rgba_index == -1) @@ -122,7 +122,7 @@ pcl::VoxelGridCovariance::applyFilter (PointCloud &output) if (!filter_field_name_.empty ()) { // Get the distance field index - std::vector fields; + std::vector fields; int distance_idx = pcl::getFieldIndex (*input_, filter_field_name_, fields); if (distance_idx == -1) PCL_WARN ("[pcl::%s::applyFilter] Invalid filter field name. Index is %d.\n", getClassName ().c_str (), distance_idx); diff --git a/filters/include/pcl/filters/passthrough.h b/filters/include/pcl/filters/passthrough.h index a48c0f895db..077a9f9c3b3 100644 --- a/filters/include/pcl/filters/passthrough.h +++ b/filters/include/pcl/filters/passthrough.h @@ -226,19 +226,19 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS PassThrough : public Filter + class PCL_EXPORTS PassThrough : public Filter { - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; - using Filter::removed_indices_; - using Filter::extract_removed_indices_; + using Filter::removed_indices_; + using Filter::extract_removed_indices_; public: /** \brief Constructor. */ PassThrough (bool extract_removed_indices = false) : - Filter::Filter (extract_removed_indices), keep_organized_ (false), + Filter::Filter (extract_removed_indices), keep_organized_ (false), user_filter_value_ (std::numeric_limits::quiet_NaN ()), filter_field_name_ (""), filter_limit_min_ (-FLT_MAX), filter_limit_max_ (FLT_MAX), filter_limit_negative_ (false) @@ -347,7 +347,7 @@ namespace pcl protected: void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); private: /** \brief Keep the structure of the data organized, by setting the diff --git a/filters/include/pcl/filters/project_inliers.h b/filters/include/pcl/filters/project_inliers.h index a57ef9a5d8f..bed7b96b586 100644 --- a/filters/include/pcl/filters/project_inliers.h +++ b/filters/include/pcl/filters/project_inliers.h @@ -176,14 +176,14 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS ProjectInliers : public Filter + class PCL_EXPORTS ProjectInliers : public Filter { - using Filter::filter_name_; - using Filter::getClassName; + using Filter::filter_name_; + using Filter::getClassName; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; typedef SampleConsensusModel::Ptr SampleConsensusModelPtr; @@ -274,7 +274,7 @@ namespace pcl ModelCoefficientsConstPtr model_; void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); private: /** \brief The model that needs to be segmented. */ diff --git a/filters/include/pcl/filters/radius_outlier_removal.h b/filters/include/pcl/filters/radius_outlier_removal.h index 825bd96f176..f9b6aaf3273 100644 --- a/filters/include/pcl/filters/radius_outlier_removal.h +++ b/filters/include/pcl/filters/radius_outlier_removal.h @@ -190,25 +190,25 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS RadiusOutlierRemoval : public Filter + class PCL_EXPORTS RadiusOutlierRemoval : public Filter { - using Filter::filter_name_; - using Filter::getClassName; + using Filter::filter_name_; + using Filter::getClassName; - using Filter::removed_indices_; - using Filter::extract_removed_indices_; + using Filter::removed_indices_; + using Filter::extract_removed_indices_; typedef pcl::search::Search KdTree; typedef pcl::search::Search::Ptr KdTreePtr; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; public: /** \brief Empty constructor. */ RadiusOutlierRemoval (bool extract_removed_indices = false) : - Filter::Filter (extract_removed_indices), + Filter::Filter (extract_removed_indices), search_radius_ (0.0), min_pts_radius_ (1), tree_ () { filter_name_ = "RadiusOutlierRemoval"; @@ -262,7 +262,7 @@ namespace pcl KdTreePtr tree_; void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); }; } diff --git a/filters/include/pcl/filters/random_sample.h b/filters/include/pcl/filters/random_sample.h index 34ab878ed1d..e2b0fb61f26 100644 --- a/filters/include/pcl/filters/random_sample.h +++ b/filters/include/pcl/filters/random_sample.h @@ -152,19 +152,19 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS RandomSample : public FilterIndices + class PCL_EXPORTS RandomSample : public FilterIndices { - using FilterIndices::filter_name_; - using FilterIndices::getClassName; + using FilterIndices::filter_name_; + using FilterIndices::getClassName; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; public: - typedef boost::shared_ptr > Ptr; - typedef boost::shared_ptr > ConstPtr; + typedef boost::shared_ptr > Ptr; + typedef boost::shared_ptr > ConstPtr; /** \brief Empty constructor. */ RandomSample () : sample_ (UINT_MAX), seed_ (static_cast (time (NULL))) @@ -217,7 +217,7 @@ namespace pcl * \param output the resultant point cloud */ void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); /** \brief Sample of point indices * \param indices the resultant point cloud indices diff --git a/filters/include/pcl/filters/statistical_outlier_removal.h b/filters/include/pcl/filters/statistical_outlier_removal.h index 23b44b3c176..08e0e36b864 100644 --- a/filters/include/pcl/filters/statistical_outlier_removal.h +++ b/filters/include/pcl/filters/statistical_outlier_removal.h @@ -199,25 +199,25 @@ namespace pcl * \ingroup filters */ template<> - class PCL_EXPORTS StatisticalOutlierRemoval : public Filter + class PCL_EXPORTS StatisticalOutlierRemoval : public Filter { - using Filter::filter_name_; - using Filter::getClassName; + using Filter::filter_name_; + using Filter::getClassName; - using Filter::removed_indices_; - using Filter::extract_removed_indices_; + using Filter::removed_indices_; + using Filter::extract_removed_indices_; typedef pcl::search::Search KdTree; typedef pcl::search::Search::Ptr KdTreePtr; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; public: /** \brief Empty constructor. */ StatisticalOutlierRemoval (bool extract_removed_indices = false) : - Filter::Filter (extract_removed_indices), mean_k_ (2), + Filter::Filter (extract_removed_indices), mean_k_ (2), std_mul_ (0.0), tree_ (), negative_ (false) { filter_name_ = "StatisticalOutlierRemoval"; @@ -293,7 +293,7 @@ namespace pcl bool negative_; void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); }; } diff --git a/filters/include/pcl/filters/voxel_grid.h b/filters/include/pcl/filters/voxel_grid.h index 1ffbf773df8..0151dc3b51c 100644 --- a/filters/include/pcl/filters/voxel_grid.h +++ b/filters/include/pcl/filters/voxel_grid.h @@ -47,7 +47,7 @@ namespace pcl { /** \brief Obtain the maximum and minimum points in 3D from a given point cloud. - * \param[in] cloud the pointer to a sensor_msgs::PointCloud2 dataset + * \param[in] cloud the pointer to a pcl::PCLPointCloud2 dataset * \param[in] x_idx the index of the X channel * \param[in] y_idx the index of the Y channel * \param[in] z_idx the index of the Z channel @@ -55,12 +55,12 @@ namespace pcl * \param[out] max_pt the maximum data point */ PCL_EXPORTS void - getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, + getMinMax3D (const pcl::PCLPointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt); /** \brief Obtain the maximum and minimum points in 3D from a given point cloud. * \note Performs internal data filtering as well. - * \param[in] cloud the pointer to a sensor_msgs::PointCloud2 dataset + * \param[in] cloud the pointer to a pcl::PCLPointCloud2 dataset * \param[in] x_idx the index of the X channel * \param[in] y_idx the index of the Y channel * \param[in] z_idx the index of the Z channel @@ -73,7 +73,7 @@ namespace pcl * considered, \b true otherwise. */ PCL_EXPORTS void - getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, + getMinMax3D (const pcl::PCLPointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, const std::string &distance_field_name, float min_distance, float max_distance, Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt, bool limit_negative = false); @@ -493,14 +493,14 @@ namespace pcl * \ingroup filters */ template <> - class PCL_EXPORTS VoxelGrid : public Filter + class PCL_EXPORTS VoxelGrid : public Filter { - using Filter::filter_name_; - using Filter::getClassName; + using Filter::filter_name_; + using Filter::getClassName; - typedef sensor_msgs::PointCloud2 PointCloud2; - typedef PointCloud2::Ptr PointCloud2Ptr; - typedef PointCloud2::ConstPtr PointCloud2ConstPtr; + typedef pcl::PCLPointCloud2 PCLPointCloud2; + typedef PCLPointCloud2::Ptr PCLPointCloud2Ptr; + typedef PCLPointCloud2::ConstPtr PCLPointCloud2ConstPtr; public: /** \brief Empty constructor. */ @@ -815,7 +815,7 @@ namespace pcl * \param[out] output the resultant point cloud */ void - applyFilter (PointCloud2 &output); + applyFilter (PCLPointCloud2 &output); }; } diff --git a/filters/src/crop_box.cpp b/filters/src/crop_box.cpp index a7352e8fa24..91ce97ec9ca 100644 --- a/filters/src/crop_box.cpp +++ b/filters/src/crop_box.cpp @@ -40,7 +40,7 @@ /////////////////////////////////////////////////////////////////////////////// void -pcl::CropBox::applyFilter (PointCloud2 &output) +pcl::CropBox::applyFilter (PCLPointCloud2 &output) { // Resize output cloud to sample size output.data.resize (input_->data.size ()); @@ -134,7 +134,7 @@ pcl::CropBox::applyFilter (PointCloud2 &output) /////////////////////////////////////////////////////////////////////////////// void -pcl::CropBox::applyFilter (std::vector &indices) +pcl::CropBox::applyFilter (std::vector &indices) { indices.resize (input_->width * input_->height); removed_indices_->resize (input_->width * input_->height); diff --git a/filters/src/extract_indices.cpp b/filters/src/extract_indices.cpp index dd3dc89e8b4..4074f0184a5 100644 --- a/filters/src/extract_indices.cpp +++ b/filters/src/extract_indices.cpp @@ -42,9 +42,9 @@ /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::ExtractIndices::applyFilter (PointCloud2 &output) +pcl::ExtractIndices::applyFilter (PCLPointCloud2 &output) { - // TODO: the PointCloud2 implementation is not yet using the keep_organized_ system -FF + // TODO: the PCLPointCloud2 implementation is not yet using the keep_organized_ system -FF if (indices_->empty () || (input_->width * input_->height == 0)) { output.width = output.height = 0; @@ -109,7 +109,7 @@ pcl::ExtractIndices::applyFilter (PointCloud2 &output) //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void -pcl::ExtractIndices::applyFilter (std::vector &indices) +pcl::ExtractIndices::applyFilter (std::vector &indices) { if (negative_) { diff --git a/filters/src/filter.cpp b/filters/src/filter.cpp index 4803b690fd3..231fef86bd3 100644 --- a/filters/src/filter.cpp +++ b/filters/src/filter.cpp @@ -39,7 +39,7 @@ */ #include -#include +#include /////////////////////////////////////////////////////////////////////////////////////////// /** \brief Base method for feature estimation for all points given in using @@ -47,7 +47,7 @@ * \param output the resultant filtered point cloud dataset */ void -pcl::Filter::filter (PointCloud2 &output) +pcl::Filter::filter (PCLPointCloud2 &output) { if (!initCompute ()) return; diff --git a/filters/src/filter_indices.cpp b/filters/src/filter_indices.cpp index b32b7f9b109..7dc9d3339eb 100644 --- a/filters/src/filter_indices.cpp +++ b/filters/src/filter_indices.cpp @@ -37,7 +37,7 @@ */ #include -#include +#include /** \brief Base method for feature estimation for all points given in * using the surface in setSearchSurface () @@ -45,7 +45,7 @@ * \param output the resultant filtered point cloud dataset */ void -pcl::FilterIndices::filter (std::vector &indices) +pcl::FilterIndices::filter (std::vector &indices) { if (!initCompute ()) return; diff --git a/filters/src/passthrough.cpp b/filters/src/passthrough.cpp index 635ccee19e9..2ea63b7b2eb 100644 --- a/filters/src/passthrough.cpp +++ b/filters/src/passthrough.cpp @@ -42,7 +42,7 @@ ////////////////////////////////////////////////////////////////////////// void -pcl::PassThrough::applyFilter (PointCloud2 &output) +pcl::PassThrough::applyFilter (PCLPointCloud2 &output) { if (!input_) { @@ -117,7 +117,7 @@ pcl::PassThrough::applyFilter (PointCloud2 &output) } // @todo fixme - if (input_->fields[distance_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (input_->fields[distance_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("[pcl::%s::downsample] Distance filtering requested, but distances are not float/double in the dataset! Only FLOAT32/FLOAT64 distances are supported right now.\n", getClassName ().c_str ()); output.width = output.height = 0; diff --git a/filters/src/project_inliers.cpp b/filters/src/project_inliers.cpp index cc30cf26207..add728e5ad7 100644 --- a/filters/src/project_inliers.cpp +++ b/filters/src/project_inliers.cpp @@ -42,7 +42,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::ProjectInliers::applyFilter (PointCloud2 &output) +pcl::ProjectInliers::applyFilter (PCLPointCloud2 &output) { if (indices_->empty ()) { @@ -156,7 +156,7 @@ pcl::ProjectInliers::applyFilter (PointCloud2 &output) /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::ProjectInliers::initSACModel (int model_type) +pcl::ProjectInliers::initSACModel (int model_type) { // Convert the input data PointCloud cloud; diff --git a/filters/src/radius_outlier_removal.cpp b/filters/src/radius_outlier_removal.cpp index 8c415899cd3..7cfe5bc6d9a 100644 --- a/filters/src/radius_outlier_removal.cpp +++ b/filters/src/radius_outlier_removal.cpp @@ -43,7 +43,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::RadiusOutlierRemoval::applyFilter (PointCloud2 &output) +pcl::RadiusOutlierRemoval::applyFilter (PCLPointCloud2 &output) { output.is_dense = true; // If fields x/y/z are not present, we cannot filter diff --git a/filters/src/random_sample.cpp b/filters/src/random_sample.cpp index 901080e18a2..1557dc4ef19 100644 --- a/filters/src/random_sample.cpp +++ b/filters/src/random_sample.cpp @@ -42,7 +42,7 @@ /////////////////////////////////////////////////////////////////////////////// void -pcl::RandomSample::applyFilter (PointCloud2 &output) +pcl::RandomSample::applyFilter (PCLPointCloud2 &output) { unsigned N = input_->width * input_->height; // If sample size is 0 or if the sample size is greater then input cloud size @@ -98,7 +98,7 @@ pcl::RandomSample::applyFilter (PointCloud2 &output) /////////////////////////////////////////////////////////////////////////////// void -pcl::RandomSample::applyFilter (std::vector &indices) +pcl::RandomSample::applyFilter (std::vector &indices) { unsigned N = input_->width * input_->height; // If sample size is 0 or if the sample size is greater then input cloud size diff --git a/filters/src/statistical_outlier_removal.cpp b/filters/src/statistical_outlier_removal.cpp index e46fa78a511..4063d9923a4 100644 --- a/filters/src/statistical_outlier_removal.cpp +++ b/filters/src/statistical_outlier_removal.cpp @@ -43,7 +43,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::StatisticalOutlierRemoval::applyFilter (PointCloud2 &output) +pcl::StatisticalOutlierRemoval::applyFilter (PCLPointCloud2 &output) { output.is_dense = true; // If fields x/y/z are not present, we cannot filter diff --git a/filters/src/voxel_grid.cpp b/filters/src/voxel_grid.cpp index dbf137785be..9c0608ef303 100644 --- a/filters/src/voxel_grid.cpp +++ b/filters/src/voxel_grid.cpp @@ -46,13 +46,13 @@ typedef Eigen::Array Array4size_t; /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, +pcl::getMinMax3D (const pcl::PCLPointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt) { // @todo fix this - if (cloud->fields[x_idx].datatype != sensor_msgs::PointField::FLOAT32 || - cloud->fields[y_idx].datatype != sensor_msgs::PointField::FLOAT32 || - cloud->fields[z_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (cloud->fields[x_idx].datatype != pcl::PCLPointField::FLOAT32 || + cloud->fields[y_idx].datatype != pcl::PCLPointField::FLOAT32 || + cloud->fields[z_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("[pcl::getMinMax3D] XYZ dimensions are not float type!\n"); return; @@ -91,14 +91,14 @@ pcl::getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, +pcl::getMinMax3D (const pcl::PCLPointCloud2ConstPtr &cloud, int x_idx, int y_idx, int z_idx, const std::string &distance_field_name, float min_distance, float max_distance, Eigen::Vector4f &min_pt, Eigen::Vector4f &max_pt, bool limit_negative) { // @todo fix this - if (cloud->fields[x_idx].datatype != sensor_msgs::PointField::FLOAT32 || - cloud->fields[y_idx].datatype != sensor_msgs::PointField::FLOAT32 || - cloud->fields[z_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (cloud->fields[x_idx].datatype != pcl::PCLPointField::FLOAT32 || + cloud->fields[y_idx].datatype != pcl::PCLPointField::FLOAT32 || + cloud->fields[z_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("[pcl::getMinMax3D] XYZ dimensions are not float type!\n"); return; @@ -112,7 +112,7 @@ pcl::getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int int distance_idx = pcl::getFieldIndex (*cloud, distance_field_name); // @todo fix this - if (cloud->fields[distance_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (cloud->fields[distance_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("[pcl::getMinMax3D] Filtering dimensions is not float type!\n"); return; @@ -174,7 +174,7 @@ pcl::getMinMax3D (const sensor_msgs::PointCloud2ConstPtr &cloud, int x_idx, int /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::VoxelGrid::applyFilter (PointCloud2 &output) +pcl::VoxelGrid::applyFilter (PCLPointCloud2 &output) { // If fields x/y/z are not present, we cannot downsample if (x_idx_ == -1 || y_idx_ == -1 || z_idx_ == -1) @@ -282,7 +282,7 @@ pcl::VoxelGrid::applyFilter (PointCloud2 &output) int distance_idx = pcl::getFieldIndex (*input_, filter_field_name_); // @todo fixme - if (input_->fields[distance_idx].datatype != sensor_msgs::PointField::FLOAT32) + if (input_->fields[distance_idx].datatype != pcl::PCLPointField::FLOAT32) { PCL_ERROR ("[pcl::%s::applyFilter] Distance filtering requested, but distances are not float/double in the dataset! Only FLOAT32/FLOAT64 distances are supported right now.\n", getClassName ().c_str ()); output.width = output.height = 0; diff --git a/filters/src/voxel_grid_label.cpp b/filters/src/voxel_grid_label.cpp index e7335abc480..1fb34d367b1 100644 --- a/filters/src/voxel_grid_label.cpp +++ b/filters/src/voxel_grid_label.cpp @@ -97,7 +97,7 @@ pcl::VoxelGridLabel::applyFilter (PointCloud &output) centroid_size = boost::mpl::size::value; // ---[ RGB special case - std::vector fields; + std::vector fields; int rgba_index = -1; rgba_index = pcl::getFieldIndex (*input_, "rgb", fields); if (rgba_index == -1) @@ -119,7 +119,7 @@ pcl::VoxelGridLabel::applyFilter (PointCloud &output) if (!filter_field_name_.empty ()) { // Get the distance field index - std::vector fields; + std::vector fields; int distance_idx = pcl::getFieldIndex (*input_, filter_field_name_, fields); if (distance_idx == -1) PCL_WARN ("[pcl::%s::applyFilter] Invalid filter field name. Index is %d.\n", getClassName ().c_str (), distance_idx); diff --git a/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/impl/world_model.hpp b/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/impl/world_model.hpp index fd69f7ede49..2745ad319b0 100644 --- a/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/impl/world_model.hpp +++ b/gpu/kinfu_large_scale/include/pcl/gpu/kinfu_large_scale/impl/world_model.hpp @@ -251,7 +251,7 @@ template inline void pcl::kinfuLS::WorldModel::setIndicesAsNans (PointCloudPtr cloud, IndicesConstPtr indices) { - std::vector fields; + std::vector fields; pcl::for_each_type (pcl::detail::FieldAdder (fields)); float my_nan = std::numeric_limits::quiet_NaN (); diff --git a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp index e61eaae39c4..0636c69a8d6 100644 --- a/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp +++ b/gpu/kinfu_large_scale/tools/kinfuLS_app.cpp @@ -986,7 +986,7 @@ struct KinFuLSApp boost::function func2 = boost::bind (&KinFuLSApp::source_cb1, this, _1); boost::function::ConstPtr&) > func3 = boost::bind (&KinFuLSApp::source_cb3, this, _1); - bool need_colors = integrate_colors_ || registration_; + bool need_colors = integrate_colors_ || registration_ || enable_texture_extraction_; if ( pcd_source_ && !capture_.providesCallback::ConstPtr&)>() ) { std::cout << "grabber doesn't provide pcl::PointCloud callback !\n"; diff --git a/gpu/kinfu_large_scale/tools/standalone_texture_mapping.cpp b/gpu/kinfu_large_scale/tools/standalone_texture_mapping.cpp index b9507b697d4..a7be2ab171e 100644 --- a/gpu/kinfu_large_scale/tools/standalone_texture_mapping.cpp +++ b/gpu/kinfu_large_scale/tools/standalone_texture_mapping.cpp @@ -115,7 +115,7 @@ saveOBJFile (const std::string &file_name, count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; // adding vertex - if ((tex_mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((tex_mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( tex_mesh.cloud.fields[d].name == "x" || tex_mesh.cloud.fields[d].name == "y" || tex_mesh.cloud.fields[d].name == "z")) @@ -156,7 +156,7 @@ saveOBJFile (const std::string &file_name, count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; // adding vertex - if ((tex_mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((tex_mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( tex_mesh.cloud.fields[d].name == "normal_x" || tex_mesh.cloud.fields[d].name == "normal_y" || tex_mesh.cloud.fields[d].name == "normal_z")) diff --git a/io/include/pcl/compression/impl/octree_pointcloud_compression.hpp b/io/include/pcl/compression/impl/octree_pointcloud_compression.hpp index c3e75bf6b6c..5e0b5ec3020 100644 --- a/io/include/pcl/compression/impl/octree_pointcloud_compression.hpp +++ b/io/include/pcl/compression/impl/octree_pointcloud_compression.hpp @@ -75,7 +75,7 @@ namespace pcl // color field analysis cloud_with_color_ = false; - std::vector fields; + std::vector fields; int rgba_index = -1; rgba_index = pcl::getFieldIndex (*this->input_, "rgb", fields); if (rgba_index == -1) @@ -190,7 +190,7 @@ namespace pcl // color field analysis cloud_with_color_ = false; - std::vector fields; + std::vector fields; int rgba_index = -1; rgba_index = pcl::getFieldIndex (*output_, "rgb", fields); if (rgba_index == -1) diff --git a/io/include/pcl/io/ascii_io.h b/io/include/pcl/io/ascii_io.h index ae4920e9e06..45c7717b7b9 100644 --- a/io/include/pcl/io/ascii_io.h +++ b/io/include/pcl/io/ascii_io.h @@ -39,7 +39,7 @@ #define PCL_IO_ASCII_IO_H_ #include -#include +#include #include @@ -79,12 +79,12 @@ namespace pcl * to the next byte after the header (e.g., 513). */ virtual int - readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &file_version, int &data_type, unsigned int &data_idx, const int offset = 0) ; - /** \brief Read a point cloud data from a FILE file and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a FILE file and store it into a pcl/PCLPointCloud2. * \param[in] file_name the name of the file containing the actual PointCloud data * \param[out] cloud the resultant PointCloud message read from disk * \param[out] origin the sensor acquisition origin (only for > FILE_V7 - null if not present) @@ -97,7 +97,7 @@ namespace pcl * to the next byte after the header (e.g., 513). */ virtual int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &file_version, const int offset = 0); @@ -105,7 +105,7 @@ namespace pcl * \param[in] fields is a list of point fields, in order, in the input ascii file */ void - setInputFields (const std::vector& fields); + setInputFields (const std::vector& fields); /** \brief Set the ascii file point fields using a point type. @@ -132,7 +132,7 @@ namespace pcl protected: std::string sep_chars_; std::string extension_; - std::vector fields_; + std::vector fields_; std::string name_; @@ -143,7 +143,7 @@ namespace pcl * returns the size of the parsed point field in bytes */ int - parse (const std::string& token, const sensor_msgs::PointField& field, uint8_t* data_target); + parse (const std::string& token, const pcl::PCLPointField& field, uint8_t* data_target); /** \brief Returns the size in bytes of a point field type. * \param[in] type point field type @@ -164,7 +164,7 @@ pcl::ASCIIReader::setInputFields (const PointT p) // Remove empty fields and adjust offset int offset =0; - for (std::vector::iterator field_iter = fields_.begin (); + for (std::vector::iterator field_iter = fields_.begin (); field_iter != fields_.end (); field_iter++) { if (field_iter->name == "_") diff --git a/io/include/pcl/io/file_io.h b/io/include/pcl/io/file_io.h index 5df3b069da7..e90e428fd46 100644 --- a/io/include/pcl/io/file_io.h +++ b/io/include/pcl/io/file_io.h @@ -81,11 +81,11 @@ namespace pcl * to the next byte after the header (e.g., 513). */ virtual int - readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &file_version, int &data_type, unsigned int &data_idx, const int offset = 0) = 0; - /** \brief Read a point cloud data from a FILE file and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a FILE file and store it into a pcl/PCLPointCloud2. * \param[in] file_name the name of the file containing the actual PointCloud data * \param[out] cloud the resultant PointCloud message read from disk * \param[out] origin the sensor acquisition origin (only for > FILE_V7 - null if not present) @@ -98,14 +98,14 @@ namespace pcl * to the next byte after the header (e.g., 513). */ virtual int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &file_version, const int offset = 0) = 0; - /** \brief Read a point cloud data from a FILE file (FILE_V6 only!) and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a FILE file (FILE_V6 only!) and store it into a pcl/PCLPointCloud2. * * \note This function is provided for backwards compatibility only and - * it can only read FILE_V6 files correctly, as sensor_msgs::PointCloud2 + * it can only read FILE_V6 files correctly, as pcl::PCLPointCloud2 * does not contain a sensor origin/orientation. Reading any file * > FILE_V6 will generate a warning. * @@ -119,7 +119,7 @@ namespace pcl * to the next byte after the header (e.g., 513). */ int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, const int offset = 0) + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset = 0) { Eigen::Vector4f origin; Eigen::Quaternionf orientation; @@ -139,7 +139,7 @@ namespace pcl template inline int read (const std::string &file_name, pcl::PointCloud &cloud, const int offset =0) { - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; int file_version; int res = read (file_name, blob, cloud.sensor_origin_, cloud.sensor_orientation_, file_version, offset); @@ -175,7 +175,7 @@ namespace pcl * FILE format, false (default) for ASCII */ virtual int - write (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const bool binary = false) = 0; @@ -189,7 +189,7 @@ namespace pcl * \param[in] orientation the sensor acquisition orientation */ inline int - write (const std::string &file_name, const sensor_msgs::PointCloud2::ConstPtr &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2::ConstPtr &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const bool binary = false) @@ -211,7 +211,7 @@ namespace pcl Eigen::Vector4f origin = cloud.sensor_origin_; Eigen::Quaternionf orientation = cloud.sensor_orientation_; - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::toROSMsg (cloud, blob); // Save the data @@ -231,7 +231,7 @@ namespace pcl * \param[out] stream the ostringstream to copy into */ template inline void - copyValueString (const sensor_msgs::PointCloud2 &cloud, + copyValueString (const pcl::PCLPointCloud2 &cloud, const unsigned int point_index, const int point_size, const unsigned int field_idx, @@ -246,7 +246,7 @@ namespace pcl stream << boost::numeric_cast(value); } template <> inline void - copyValueString (const sensor_msgs::PointCloud2 &cloud, + copyValueString (const pcl::PCLPointCloud2 &cloud, const unsigned int point_index, const int point_size, const unsigned int field_idx, @@ -262,7 +262,7 @@ namespace pcl stream << boost::numeric_cast(value); } template <> inline void - copyValueString (const sensor_msgs::PointCloud2 &cloud, + copyValueString (const pcl::PCLPointCloud2 &cloud, const unsigned int point_index, const int point_size, const unsigned int field_idx, @@ -289,7 +289,7 @@ namespace pcl * \return true if the value is finite, false otherwise */ template inline bool - isValueFinite (const sensor_msgs::PointCloud2 &cloud, + isValueFinite (const pcl::PCLPointCloud2 &cloud, const unsigned int point_index, const int point_size, const unsigned int field_idx, @@ -314,7 +314,7 @@ namespace pcl * \param[in] fields_count the current fields count */ template inline void - copyStringValue (const std::string &st, sensor_msgs::PointCloud2 &cloud, + copyStringValue (const std::string &st, pcl::PCLPointCloud2 &cloud, unsigned int point_index, unsigned int field_idx, unsigned int fields_count) { Type value; @@ -337,7 +337,7 @@ namespace pcl } template <> inline void - copyStringValue (const std::string &st, sensor_msgs::PointCloud2 &cloud, + copyStringValue (const std::string &st, pcl::PCLPointCloud2 &cloud, unsigned int point_index, unsigned int field_idx, unsigned int fields_count) { int8_t value; @@ -363,7 +363,7 @@ namespace pcl } template <> inline void - copyStringValue (const std::string &st, sensor_msgs::PointCloud2 &cloud, + copyStringValue (const std::string &st, pcl::PCLPointCloud2 &cloud, unsigned int point_index, unsigned int field_idx, unsigned int fields_count) { uint8_t value; diff --git a/io/include/pcl/io/image_grabber.h b/io/include/pcl/io/image_grabber.h index 9f32cc39656..34273e576af 100644 --- a/io/include/pcl/io/image_grabber.h +++ b/io/include/pcl/io/image_grabber.h @@ -196,12 +196,12 @@ namespace pcl /** \brief Gets the cloud in ROS form at location idx */ bool - getCloudAt (size_t idx, sensor_msgs::PointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const; + getCloudAt (size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const; private: virtual void - publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const = 0; + publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const = 0; // to separate and hide the implementation from interface: PIMPL @@ -241,7 +241,7 @@ namespace pcl protected: virtual void - publish (const sensor_msgs::PointCloud2& blob, + publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const; boost::signals2::signal >&)>* signal_; @@ -283,7 +283,7 @@ namespace pcl template const boost::shared_ptr< const pcl::PointCloud > ImageGrabber::operator[] (size_t idx) const { - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; Eigen::Vector4f origin; Eigen::Quaternionf orientation; getCloudAt (idx, blob, origin, orientation); @@ -303,7 +303,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////////////////////////////////////// template void - ImageGrabber::publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const + ImageGrabber::publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const { typename pcl::PointCloud::Ptr cloud (new pcl::PointCloud ()); pcl::fromROSMsg (blob, *cloud); diff --git a/io/include/pcl/io/impl/pcd_io.hpp b/io/include/pcl/io/impl/pcd_io.hpp index b144c058850..b6623fbfb00 100644 --- a/io/include/pcl/io/impl/pcd_io.hpp +++ b/io/include/pcl/io/impl/pcd_io.hpp @@ -80,7 +80,7 @@ pcl::PCDWriter::generateHeader (const pcl::PointCloud &cloud, const int "\nVERSION 0.7" "\nFIELDS"; - std::vector fields; + std::vector fields; pcl::getFields (cloud, fields); std::stringstream field_names, field_types, field_sizes, field_counts; @@ -156,7 +156,7 @@ pcl::PCDWriter::writeBinary (const std::string &file_name, boost::interprocess::file_lock file_lock; setLockingPermissions (file_name, file_lock); - std::vector fields; + std::vector fields; std::vector fields_sizes; size_t fsize = 0; size_t data_size = 0; @@ -295,7 +295,7 @@ pcl::PCDWriter::writeBinaryCompressed (const std::string &file_name, boost::interprocess::file_lock file_lock; setLockingPermissions (file_name, file_lock); - std::vector fields; + std::vector fields; size_t fsize = 0; size_t data_size = 0; size_t nri = 0; @@ -488,7 +488,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< fs.precision (precision); fs.imbue (std::locale::classic ()); - std::vector fields; + std::vector fields; pcl::getFields (cloud, fields); // Write the header information @@ -514,7 +514,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< { switch (fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { int8_t value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (int8_t), sizeof (int8_t)); @@ -524,7 +524,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { uint8_t value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (uint8_t), sizeof (uint8_t)); @@ -534,7 +534,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { int16_t value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (int16_t), sizeof (int16_t)); @@ -544,7 +544,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { uint16_t value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (uint16_t), sizeof (uint16_t)); @@ -554,7 +554,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { int32_t value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (int32_t), sizeof (int32_t)); @@ -564,7 +564,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { uint32_t value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (uint32_t), sizeof (uint32_t)); @@ -574,7 +574,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { float value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (float), sizeof (float)); @@ -584,7 +584,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PointCloud< stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { double value; memcpy (&value, reinterpret_cast (&cloud.points[i]) + fields[d].offset + c * sizeof (double), sizeof (double)); @@ -651,7 +651,7 @@ pcl::PCDWriter::writeBinary (const std::string &file_name, boost::interprocess::file_lock file_lock; setLockingPermissions (file_name, file_lock); - std::vector fields; + std::vector fields; std::vector fields_sizes; size_t fsize = 0; size_t data_size = 0; @@ -788,7 +788,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, fs.precision (precision); fs.imbue (std::locale::classic ()); - std::vector fields; + std::vector fields; pcl::getFields (cloud, fields); // Write the header information @@ -815,7 +815,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, { switch (fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { int8_t value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (int8_t), sizeof (int8_t)); @@ -825,7 +825,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { uint8_t value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (uint8_t), sizeof (uint8_t)); @@ -835,7 +835,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { int16_t value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (int16_t), sizeof (int16_t)); @@ -845,7 +845,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { uint16_t value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (uint16_t), sizeof (uint16_t)); @@ -855,7 +855,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { int32_t value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (int32_t), sizeof (int32_t)); @@ -865,7 +865,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { uint32_t value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (uint32_t), sizeof (uint32_t)); @@ -875,7 +875,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { float value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (float), sizeof (float)); @@ -885,7 +885,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, stream << boost::numeric_cast(value); break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { double value; memcpy (&value, reinterpret_cast (&cloud.points[indices[i]]) + fields[d].offset + c * sizeof (double), sizeof (double)); diff --git a/io/include/pcl/io/impl/vtk_lib_io.hpp b/io/include/pcl/io/impl/vtk_lib_io.hpp index 63f563da1d9..fcd52f956b7 100644 --- a/io/include/pcl/io/impl/vtk_lib_io.hpp +++ b/io/include/pcl/io/impl/vtk_lib_io.hpp @@ -72,7 +72,7 @@ pcl::io::vtkPolyDataToPointCloud (vtkPolyData* const polydata, pcl::PointCloud

fields; + std::vector fields; pcl::for_each_type::type>(pcl::detail::FieldAdder(fields)); // Check if XYZ is present @@ -161,7 +161,7 @@ pcl::io::vtkStructuredGridToPointCloud (vtkStructuredGrid* const structured_grid cloud.points.resize (cloud.width * cloud.height); // Get a list of all the fields available - std::vector fields; + std::vector fields; pcl::for_each_type::type>(pcl::detail::FieldAdder(fields)); // Check if XYZ is present @@ -280,7 +280,7 @@ template void pcl::io::pointCloudTovtkPolyData (const pcl::PointCloud& cloud, vtkPolyData* const pdata) { // Get a list of all the fields available - std::vector fields; + std::vector fields; pcl::for_each_type::type>(pcl::detail::FieldAdder(fields)); // Coordinates (always must have coordinates) @@ -392,7 +392,7 @@ template void pcl::io::pointCloudTovtkStructuredGrid (const pcl::PointCloud& cloud, vtkStructuredGrid* const structured_grid) { // Get a list of all the fields available - std::vector fields; + std::vector fields; pcl::for_each_type::type>(pcl::detail::FieldAdder(fields)); int dimensions[3] = {cloud.width, cloud.height, 1}; diff --git a/io/include/pcl/io/pcd_grabber.h b/io/include/pcl/io/pcd_grabber.h index 95debdd8380..418c21f47be 100644 --- a/io/include/pcl/io/pcd_grabber.h +++ b/io/include/pcl/io/pcd_grabber.h @@ -134,7 +134,7 @@ namespace pcl /** \brief Get cloud (in ROS form) at a particular location */ bool getCloudAt (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const; @@ -144,7 +144,7 @@ namespace pcl private: virtual void - publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const = 0; + publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const = 0; // to separate and hide the implementation from interface: PIMPL struct PCDGrabberImpl; @@ -172,7 +172,7 @@ namespace pcl protected: virtual void - publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const; + publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const; boost::signals2::signal >&)>* signal_; @@ -213,7 +213,7 @@ namespace pcl template const boost::shared_ptr< const pcl::PointCloud > PCDGrabber::operator[] (size_t idx) const { - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; Eigen::Vector4f origin; Eigen::Quaternionf orientation; getCloudAt (idx, blob, origin, orientation); @@ -233,7 +233,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////////////////////////////////////// template void - PCDGrabber::publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const + PCDGrabber::publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const { typename pcl::PointCloud::Ptr cloud (new pcl::PointCloud ()); pcl::fromROSMsg (blob, *cloud); @@ -263,7 +263,7 @@ namespace pcl depth_image_signal_->operator()(depth_image); // ---[ RGB special case - std::vector fields; + std::vector fields; int rgba_index = pcl::getFieldIndex (*cloud, "rgb", fields); if (rgba_index == -1) rgba_index = pcl::getFieldIndex (*cloud, "rgba", fields); diff --git a/io/include/pcl/io/pcd_io.h b/io/include/pcl/io/pcd_io.h index fc8239aa362..64b546eae7f 100644 --- a/io/include/pcl/io/pcd_io.h +++ b/io/include/pcl/io/pcd_io.h @@ -112,7 +112,7 @@ namespace pcl * * == 0 on success */ int - readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &pcd_version, int &data_type, unsigned int &data_idx, const int offset = 0); @@ -140,9 +140,9 @@ namespace pcl * * == 0 on success */ int - readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, const int offset = 0); + readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset = 0); - /** \brief Read a point cloud data from a PCD file and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a PCD file and store it into a pcl/PCLPointCloud2. * \param[in] file_name the name of the file containing the actual PointCloud data * \param[out] cloud the resultant PointCloud message read from disk * \param[out] origin the sensor acquisition origin (only for > PCD_V7 - null if not present) @@ -160,13 +160,13 @@ namespace pcl * * == 0 on success */ int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &pcd_version, const int offset = 0); - /** \brief Read a point cloud data from a PCD (PCD_V6) and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a PCD (PCD_V6) and store it into a pcl/PCLPointCloud2. * * \note This function is provided for backwards compatibility only and - * it can only read PCD_V6 files correctly, as sensor_msgs::PointCloud2 + * it can only read PCD_V6 files correctly, as pcl::PCLPointCloud2 * does not contain a sensor origin/orientation. Reading any file * > PCD_V6 will generate a warning. * @@ -184,7 +184,7 @@ namespace pcl * * == 0 on success */ int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, const int offset = 0); + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset = 0); /** \brief Read a point cloud data from any PCD file, and convert it to the given template format. * \param[in] file_name the name of the file containing the actual PointCloud data @@ -203,7 +203,7 @@ namespace pcl template int read (const std::string &file_name, pcl::PointCloud &cloud, const int offset = 0) { - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; int pcd_version; int res = read (file_name, blob, cloud.sensor_origin_, cloud.sensor_orientation_, pcd_version, offset); @@ -247,7 +247,7 @@ namespace pcl * \param[in] orientation the sensor acquisition orientation */ std::string - generateHeaderBinary (const sensor_msgs::PointCloud2 &cloud, + generateHeaderBinary (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation); @@ -257,7 +257,7 @@ namespace pcl * \param[in] orientation the sensor acquisition orientation */ std::string - generateHeaderBinaryCompressed (const sensor_msgs::PointCloud2 &cloud, + generateHeaderBinaryCompressed (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation); @@ -267,7 +267,7 @@ namespace pcl * \param[in] orientation the sensor acquisition orientation */ std::string - generateHeaderASCII (const sensor_msgs::PointCloud2 &cloud, + generateHeaderASCII (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation); @@ -297,7 +297,7 @@ namespace pcl * As an intermediary solution, precision 8 is used, which guarantees lossless storage for RGB. */ int - writeASCII (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + writeASCII (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const int precision = 8); @@ -309,7 +309,7 @@ namespace pcl * \param[in] orientation the sensor acquisition orientation */ int - writeBinary (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + writeBinary (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity ()); @@ -320,7 +320,7 @@ namespace pcl * \param[in] orientation the sensor acquisition orientation */ int - writeBinaryCompressed (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + writeBinaryCompressed (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity ()); @@ -342,7 +342,7 @@ namespace pcl * As an intermediary solution, precision 8 is used, which guarantees lossless storage for RGB. */ inline int - write (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const bool binary = false) @@ -369,7 +369,7 @@ namespace pcl * future versions of PCL. */ inline int - write (const std::string &file_name, const sensor_msgs::PointCloud2::ConstPtr &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2::ConstPtr &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const bool binary = false) @@ -502,14 +502,14 @@ namespace pcl /** \brief Load a PCD v.6 file into a templated PointCloud type. * * Any PCD files > v.6 will generate a warning as a - * sensor_msgs/PointCloud2 message cannot hold the sensor origin. + * pcl/PCLPointCloud2 message cannot hold the sensor origin. * * \param[in] file_name the name of the file to load * \param[out] cloud the resultant templated point cloud * \ingroup io */ inline int - loadPCDFile (const std::string &file_name, sensor_msgs::PointCloud2 &cloud) + loadPCDFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud) { pcl::PCDReader p; return (p.read (file_name, cloud)); @@ -524,7 +524,7 @@ namespace pcl * \ingroup io */ inline int - loadPCDFile (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + loadPCDFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) { pcl::PCDReader p; @@ -560,7 +560,7 @@ namespace pcl * \ingroup io */ inline int - savePCDFile (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + savePCDFile (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const bool binary_mode = false) diff --git a/io/include/pcl/io/ply_io.h b/io/include/pcl/io/ply_io.h index 52a01012fae..2168001f1b5 100644 --- a/io/include/pcl/io/ply_io.h +++ b/io/include/pcl/io/ply_io.h @@ -150,11 +150,11 @@ namespace pcl * to the next byte after the header (e.g., 513). */ int - readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &ply_version, int &data_type, unsigned int &data_idx, const int offset = 0); - /** \brief Read a point cloud data from a PLY file and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a PLY file and store it into a pcl/PCLPointCloud2. * \param[in] file_name the name of the file containing the actual PointCloud data * \param[out] cloud the resultant PointCloud message read from disk * \param[in] origin the sensor data acquisition origin (translation) @@ -167,13 +167,13 @@ namespace pcl * to the next byte after the header (e.g., 513). */ int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int& ply_version, const int offset = 0); - /** \brief Read a point cloud data from a PLY file (PLY_V6 only!) and store it into a sensor_msgs/PointCloud2. + /** \brief Read a point cloud data from a PLY file (PLY_V6 only!) and store it into a pcl/PCLPointCloud2. * * \note This function is provided for backwards compatibility only and - * it can only read PLY_V6 files correctly, as sensor_msgs::PointCloud2 + * it can only read PLY_V6 files correctly, as pcl::PCLPointCloud2 * does not contain a sensor origin/orientation. Reading any file * > PLY_V6 will generate a warning. * @@ -186,7 +186,7 @@ namespace pcl * to the next byte after the header (e.g., 513). */ inline int - read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, const int offset = 0) + read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset = 0) { Eigen::Vector4f origin; Eigen::Quaternionf orientation; @@ -206,7 +206,7 @@ namespace pcl template inline int read (const std::string &file_name, pcl::PointCloud &cloud, const int offset = 0) { - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; int ply_version; int res = read (file_name, blob, cloud.sensor_origin_, cloud.sensor_orientation_, ply_version, offset); @@ -576,7 +576,7 @@ namespace pcl Eigen::Matrix3f orientation_; //vertex element artifacts - sensor_msgs::PointCloud2 *cloud_; + pcl::PCLPointCloud2 *cloud_; size_t vertex_count_, vertex_properties_counter_; int vertex_offset_before_; //range element artifacts @@ -611,7 +611,7 @@ namespace pcl * element range_grid will be used. */ inline std::string - generateHeaderBinary (const sensor_msgs::PointCloud2 &cloud, + generateHeaderBinary (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, int valid_points, @@ -630,7 +630,7 @@ namespace pcl * element range_grid will be used. */ inline std::string - generateHeaderASCII (const sensor_msgs::PointCloud2 &cloud, + generateHeaderASCII (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, int valid_points, @@ -649,7 +649,7 @@ namespace pcl * element range_grid will be used. */ int - writeASCII (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + writeASCII (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), int precision = 8, @@ -664,7 +664,7 @@ namespace pcl * element range_grid will be used */ int - writeBinary (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + writeBinary (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), bool use_camera = true); @@ -678,7 +678,7 @@ namespace pcl * PLY format, false (default) for ASCII */ inline int - write (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), const bool binary = false) @@ -700,7 +700,7 @@ namespace pcl * use range_grid element */ inline int - write (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), bool binary = false, @@ -723,7 +723,7 @@ namespace pcl * use range_grid element */ inline int - write (const std::string &file_name, const sensor_msgs::PointCloud2::ConstPtr &cloud, + write (const std::string &file_name, const pcl::PCLPointCloud2::ConstPtr &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), bool binary = false, @@ -749,7 +749,7 @@ namespace pcl Eigen::Vector4f origin = cloud.sensor_origin_; Eigen::Quaternionf orientation = cloud.sensor_orientation_; - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::toROSMsg (cloud, blob); // Save the data @@ -762,7 +762,7 @@ namespace pcl * \param[in] binary whether the PLY file should be saved as binary data (true) or ascii (false) */ std::string - generateHeader (const sensor_msgs::PointCloud2 &cloud, + generateHeader (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, bool binary, @@ -772,7 +772,7 @@ namespace pcl void writeContentWithCameraASCII (int nr_points, int point_size, - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, std::ofstream& fs); @@ -780,7 +780,7 @@ namespace pcl void writeContentWithRangeGridASCII (int nr_points, int point_size, - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, std::ostringstream& fs, int& nb_valid_points); }; @@ -790,14 +790,14 @@ namespace pcl /** \brief Load a PLY v.6 file into a templated PointCloud type. * * Any PLY files containg sensor data will generate a warning as a - * sensor_msgs/PointCloud2 message cannot hold the sensor origin. + * pcl/PCLPointCloud2 message cannot hold the sensor origin. * * \param[in] file_name the name of the file to load * \param[in] cloud the resultant templated point cloud * \ingroup io */ inline int - loadPLYFile (const std::string &file_name, sensor_msgs::PointCloud2 &cloud) + loadPLYFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud) { pcl::PLYReader p; return (p.read (file_name, cloud)); @@ -812,7 +812,7 @@ namespace pcl * \ingroup io */ inline int - loadPLYFile (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, + loadPLYFile (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) { pcl::PLYReader p; @@ -841,7 +841,7 @@ namespace pcl * \ingroup io */ inline int - savePLYFile (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, + savePLYFile (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin = Eigen::Vector4f::Zero (), const Eigen::Quaternionf &orientation = Eigen::Quaternionf::Identity (), bool binary_mode = false, bool use_camera = true) diff --git a/io/include/pcl/io/vtk_io.h b/io/include/pcl/io/vtk_io.h index 8b8dded3bfe..181f6dd3307 100644 --- a/io/include/pcl/io/vtk_io.h +++ b/io/include/pcl/io/vtk_io.h @@ -42,7 +42,7 @@ #define PCL_IO_VTK_IO_H_ #include -#include +#include #include // Please do not add any functions tha depend on VTK structures to this file! @@ -68,7 +68,7 @@ namespace pcl * \ingroup io */ PCL_EXPORTS int - saveVTKFile (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, unsigned precision = 5); + saveVTKFile (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, unsigned precision = 5); } } diff --git a/io/include/pcl/io/vtk_lib_io.h b/io/include/pcl/io/vtk_lib_io.h index 45e5313cf83..9c6a9e9cb7c 100644 --- a/io/include/pcl/io/vtk_lib_io.h +++ b/io/include/pcl/io/vtk_lib_io.h @@ -218,13 +218,13 @@ namespace pcl pointCloudTovtkPolyData (const pcl::PointCloud& cloud, vtkPolyData* const polydata); - /** \brief Convert a PointCloud2 object to a VTK PolyData object. - * \param[in] cloud the input PointCloud2Ptr object + /** \brief Convert a PCLPointCloud2 object to a VTK PolyData object. + * \param[in] cloud the input PCLPointCloud2Ptr object * \param[out] poly_data the resultant VTK PolyData object * \ingroup io */ PCL_EXPORTS void - pointCloudTovtkPolyData(const sensor_msgs::PointCloud2Ptr& cloud, vtkSmartPointer& poly_data); + pointCloudTovtkPolyData(const pcl::PCLPointCloud2Ptr& cloud, vtkSmartPointer& poly_data); /** \brief Convert a pcl::PointCloud object to a VTK StructuredGrid one. * \param[in] cloud the input pcl::PointCloud object diff --git a/io/src/ascii_io.cpp b/io/src/ascii_io.cpp index 15593932138..f719e5d3133 100644 --- a/io/src/ascii_io.cpp +++ b/io/src/ascii_io.cpp @@ -50,8 +50,8 @@ pcl::ASCIIReader::ASCIIReader () name_ = "AsciiReader"; { - sensor_msgs::PointField f; - f.datatype = sensor_msgs::PointField::FLOAT32; + pcl::PCLPointField f; + f.datatype = pcl::PCLPointField::FLOAT32; f.count = 1; f.name = "x"; f.offset = 0; @@ -59,8 +59,8 @@ pcl::ASCIIReader::ASCIIReader () } { - sensor_msgs::PointField f; - f.datatype = sensor_msgs::PointField::FLOAT32; + pcl::PCLPointField f; + f.datatype = pcl::PCLPointField::FLOAT32; f.count = 1; f.name = "y"; f.offset = 4; @@ -68,8 +68,8 @@ pcl::ASCIIReader::ASCIIReader () } { - sensor_msgs::PointField f; - f.datatype = sensor_msgs::PointField::FLOAT32; + pcl::PCLPointField f; + f.datatype = pcl::PCLPointField::FLOAT32; f.count = 1; f.name = "z"; f.offset = 8; @@ -85,7 +85,7 @@ pcl::ASCIIReader::~ASCIIReader () ////////////////////////////////////////////////////////////////////////////// int pcl::ASCIIReader::readHeader (const std::string& file_name, - sensor_msgs::PointCloud2& cloud, Eigen::Vector4f& origin, + pcl::PCLPointCloud2& cloud, Eigen::Vector4f& origin, Eigen::Quaternionf& orientation, int& file_version, int& data_type, unsigned int& data_idx, const int offset) { @@ -130,7 +130,7 @@ pcl::ASCIIReader::readHeader (const std::string& file_name, int pcl::ASCIIReader::read ( const std::string& file_name, - sensor_msgs::PointCloud2& cloud, + pcl::PCLPointCloud2& cloud, Eigen::Vector4f& origin, Eigen::Quaternionf& orientation, int& file_version, const int offset) { @@ -178,7 +178,7 @@ pcl::ASCIIReader::read ( ////////////////////////////////////////////////////////////////////////////// void -pcl::ASCIIReader::setInputFields (const std::vector& fields) +pcl::ASCIIReader::setInputFields (const std::vector& fields) { fields_ = fields; } @@ -194,47 +194,47 @@ pcl::ASCIIReader::setSepChars (const std::string &chars) int pcl::ASCIIReader::parse ( const std::string& token, - const sensor_msgs::PointField& field, + const pcl::PCLPointField& field, uint8_t* data_target) { switch (field.datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return (1); } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 1; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 2; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 2; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 4; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 4; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 4; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { *(reinterpret_cast(data_target)) = boost::lexical_cast (token); return 8; @@ -249,21 +249,21 @@ pcl::ASCIIReader::typeSize (int type) { switch (type) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: return 1; - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: return 1; - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: return 2; - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: return 2; - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: return 4; - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: return 4; - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: return 4; - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: return 8; } return (0); diff --git a/io/src/hdl_grabber.cpp b/io/src/hdl_grabber.cpp index a6183886e6b..7e39c02722e 100644 --- a/io/src/hdl_grabber.cpp +++ b/io/src/hdl_grabber.cpp @@ -326,15 +326,9 @@ pcl::HDLGrabber::toPointClouds (HDLDataPacket *dataPacket) time(&time_); time_t velodyneTime = (time_ & 0x00000000ffffffffl) << 32 | dataPacket->gpsTimestamp; -#ifdef USE_ROS - current_scan_xyz_->header.stamp.fromNSec (velodyneTime * 1000); - current_scan_xyzrgb_->header.stamp.fromNSec (velodyneTime * 1000); - current_scan_xyzi_->header.stamp.fromNSec (velodyneTime * 1000); -#else //USE_ROS current_scan_xyz_->header.stamp = velodyneTime; current_scan_xyzrgb_->header.stamp = velodyneTime; current_scan_xyzi_->header.stamp = velodyneTime; -#endif //USE_ROS current_scan_xyz_->header.seq = scanCounter; current_scan_xyzrgb_->header.seq = scanCounter; current_scan_xyzi_->header.seq = scanCounter; @@ -352,15 +346,9 @@ pcl::HDLGrabber::toPointClouds (HDLDataPacket *dataPacket) if (current_sweep_xyzrgb_->size () > 0) { current_sweep_xyz_->is_dense = current_sweep_xyzrgb_->is_dense = current_sweep_xyzi_->is_dense = false; -#ifdef USE_ROS - current_sweep_xyz_->header.stamp.fromNSec (velodyneTime * 1000); - current_sweep_xyzrgb_->header.stamp.fromNSec (velodyneTime * 1000); - current_sweep_xyzi_->header.stamp.fromNSec (velodyneTime * 1000); -#else //USE_ROS current_sweep_xyz_->header.stamp = velodyneTime; current_sweep_xyzrgb_->header.stamp = velodyneTime; current_sweep_xyzi_->header.stamp = velodyneTime; -#endif //USE_ROS current_sweep_xyz_->header.seq = sweepCounter; current_sweep_xyzrgb_->header.seq = sweepCounter; current_sweep_xyzi_->header.seq = sweepCounter; diff --git a/io/src/image_grabber.cpp b/io/src/image_grabber.cpp index 167ddded619..ce1bb92394c 100644 --- a/io/src/image_grabber.cpp +++ b/io/src/image_grabber.cpp @@ -84,15 +84,15 @@ struct pcl::ImageGrabberBase::ImageGrabberImpl //! Get cloud at a particular location bool - getCloudAt (size_t idx, sensor_msgs::PointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, + getCloudAt (size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, double &fx, double &fy, double &cx, double &cy) const; //! Get cloud at a particular location bool - getCloudVTK (size_t idx, sensor_msgs::PointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const; + getCloudVTK (size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const; //! Get cloud at a particular location bool - getCloudPCLZF (size_t idx, sensor_msgs::PointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, + getCloudPCLZF (size_t idx, pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, double &fx, double &fy, double &cx, double &cy) const; //! Scrapes a directory for image files which contain "rgb" or "depth" and @@ -147,7 +147,7 @@ struct pcl::ImageGrabberBase::ImageGrabberImpl TimeTrigger time_trigger_; - sensor_msgs::PointCloud2 next_cloud_; + pcl::PCLPointCloud2 next_cloud_; //! Two cases, for depth only and depth+color pcl::PointCloud next_cloud_depth_; pcl::PointCloud next_cloud_color_; @@ -517,7 +517,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getTimestampFromFilepath ( ///////////////////////////////////////////////////////////////////////////// bool pcl::ImageGrabberBase::ImageGrabberImpl::getCloudAt (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, double &fx, @@ -544,7 +544,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getCloudAt (size_t idx, bool pcl::ImageGrabberBase::ImageGrabberImpl::getCloudVTK (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const { @@ -628,11 +628,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getCloudVTK (size_t idx, uint64_t timestamp; if (getTimestampFromFilepath (depth_image_file, timestamp)) { -#ifdef USE_ROS - cloud_color.header.stamp.fromNSec (timestamp * 1000); -#else cloud_color.header.stamp = timestamp; -#endif //USE_ROS } pcl::toROSMsg (cloud_color, blob); @@ -664,11 +660,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getCloudVTK (size_t idx, uint64_t timestamp; if (getTimestampFromFilepath (depth_image_file, timestamp)) { -#ifdef USE_ROS - cloud.header.stamp.fromNSec (timestamp * 1000); -#else cloud.header.stamp = timestamp; -#endif //USE_ROS } pcl::toROSMsg (cloud, blob); @@ -687,7 +679,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getCloudVTK (size_t idx, bool pcl::ImageGrabberBase::ImageGrabberImpl::getCloudPCLZF (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, double &fx, @@ -759,11 +751,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getCloudPCLZF (size_t idx, uint64_t timestamp; if (getTimestampFromFilepath (depth_pclzf_file, timestamp)) { -#ifdef USE_ROS - cloud_color.header.stamp.fromNSec (timestamp * 1000); -#else cloud_color.header.stamp = timestamp; -#endif //USE_ROS } pcl::toROSMsg (cloud_color, blob); } @@ -804,11 +792,7 @@ pcl::ImageGrabberBase::ImageGrabberImpl::getCloudPCLZF (size_t idx, uint64_t timestamp; if (getTimestampFromFilepath (depth_pclzf_file, timestamp)) { -#ifdef USE_ROS - cloud.header.stamp.fromNSec (timestamp * 1000); -#else cloud.header.stamp = timestamp; -#endif //USE_ROS } pcl::toROSMsg (cloud, blob); } @@ -1040,7 +1024,7 @@ pcl::ImageGrabberBase::numFrames () const ////////////////////////////////////////////////////////////////////////////////////////// bool pcl::ImageGrabberBase::getCloudAt (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const { diff --git a/io/src/obj_io.cpp b/io/src/obj_io.cpp index ebc585607ed..900340639a4 100644 --- a/io/src/obj_io.cpp +++ b/io/src/obj_io.cpp @@ -96,7 +96,7 @@ pcl::io::saveOBJFile (const std::string &file_name, count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; // adding vertex - if ((tex_mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((tex_mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( tex_mesh.cloud.fields[d].name == "x" || tex_mesh.cloud.fields[d].name == "y" || tex_mesh.cloud.fields[d].name == "z")) @@ -137,7 +137,7 @@ pcl::io::saveOBJFile (const std::string &file_name, count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; // adding vertex - if ((tex_mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((tex_mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( tex_mesh.cloud.fields[d].name == "normal_x" || tex_mesh.cloud.fields[d].name == "normal_y" || tex_mesh.cloud.fields[d].name == "normal_z")) @@ -280,7 +280,7 @@ pcl::io::saveOBJFile (const std::string &file_name, { int c = 0; // adding vertex - if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( mesh.cloud.fields[d].name == "x" || mesh.cloud.fields[d].name == "y" || mesh.cloud.fields[d].name == "z")) @@ -318,7 +318,7 @@ pcl::io::saveOBJFile (const std::string &file_name, { int c = 0; // adding vertex - if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( mesh.cloud.fields[d].name == "normal_x" || mesh.cloud.fields[d].name == "normal_y" || mesh.cloud.fields[d].name == "normal_z")) diff --git a/io/src/pcd_grabber.cpp b/io/src/pcd_grabber.cpp index e18dec9adc2..cc1d5998d0e 100644 --- a/io/src/pcd_grabber.cpp +++ b/io/src/pcd_grabber.cpp @@ -76,7 +76,7 @@ struct pcl::PCDGrabberBase::PCDGrabberImpl //! Get cloud at a particular location bool getCloudAt (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation); @@ -92,7 +92,7 @@ struct pcl::PCDGrabberBase::PCDGrabberImpl std::vector::iterator pcd_iterator_; TimeTrigger time_trigger_; - sensor_msgs::PointCloud2 next_cloud_; + pcl::PCLPointCloud2 next_cloud_; Eigen::Vector4f origin_; Eigen::Quaternionf orientation_; bool valid_; @@ -305,7 +305,7 @@ pcl::PCDGrabberBase::PCDGrabberImpl::scrapeForClouds (bool force) // Go through and index the clouds PCDReader reader; - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; for (size_t i = 0; i < pcd_files_.size (); ++i) { std::string pcd_file = pcd_files_[i]; @@ -344,7 +344,7 @@ pcl::PCDGrabberBase::PCDGrabberImpl::scrapeForClouds (bool force) /////////////////////////////////////////////////////////////////////////////////////////// bool pcl::PCDGrabberBase::PCDGrabberImpl::getCloudAt (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) { @@ -461,7 +461,7 @@ pcl::PCDGrabberBase::isRepeatOn () const /////////////////////////////////////////////////////////////////////////////////////////// bool pcl::PCDGrabberBase::getCloudAt (size_t idx, - sensor_msgs::PointCloud2 &blob, + pcl::PCLPointCloud2 &blob, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation) const { diff --git a/io/src/pcd_io.cpp b/io/src/pcd_io.cpp index 85618adad05..311e1cda56b 100644 --- a/io/src/pcd_io.cpp +++ b/io/src/pcd_io.cpp @@ -108,7 +108,7 @@ pcl::PCDWriter::resetLockingPermissions (const std::string &file_name, /////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDReader::readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, +pcl::PCDReader::readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &pcd_version, int &data_type, unsigned int &data_idx, const int offset) { @@ -202,7 +202,7 @@ pcl::PCDReader::readHeader (const std::string &file_name, sensor_msgs::PointClou for (int i = 0; i < specified_channel_count; ++i, offset += 4) { cloud.fields[i].offset = offset; - cloud.fields[i].datatype = sensor_msgs::PointField::FLOAT32; + cloud.fields[i].datatype = pcl::PCLPointField::FLOAT32; cloud.fields[i].count = 1; } cloud.point_step = offset; @@ -398,7 +398,7 @@ pcl::PCDReader::readHeader (const std::string &file_name, sensor_msgs::PointClou /////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDReader::readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, const int offset) +pcl::PCDReader::readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset) { // Default values cloud.width = cloud.height = cloud.point_step = cloud.row_step = 0; @@ -485,7 +485,7 @@ pcl::PCDReader::readHeader (const std::string &file_name, sensor_msgs::PointClou for (int i = 0; i < specified_channel_count; ++i, offset += 4) { cloud.fields[i].offset = offset; - cloud.fields[i].datatype = sensor_msgs::PointField::FLOAT32; + cloud.fields[i].datatype = pcl::PCLPointField::FLOAT32; cloud.fields[i].count = 1; } cloud.point_step = offset; @@ -662,7 +662,7 @@ pcl::PCDReader::readHeader (const std::string &file_name, sensor_msgs::PointClou ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, +pcl::PCDReader::read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &pcd_version, const int offset) { @@ -742,51 +742,51 @@ pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl { switch (cloud.fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { - copyStringValue::type> ( + copyStringValue::type> ( st.at (total + c), cloud, idx, d, c); break; } @@ -901,7 +901,7 @@ pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl } // Get the fields sizes - std::vector fields (cloud.fields.size ()); + std::vector fields (cloud.fields.size ()); std::vector fields_sizes (cloud.fields.size ()); int nri = 0, fsize = 0; for (size_t i = 0; i < cloud.fields.size (); ++i) @@ -976,51 +976,51 @@ pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl { switch (cloud.fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { - if (!isValueFinite::type>(cloud, i, point_size, d, c)) + if (!isValueFinite::type>(cloud, i, point_size, d, c)) cloud.is_dense = false; break; } @@ -1038,7 +1038,7 @@ pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, const int offset) +pcl::PCDReader::read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, const int offset) { int pcd_version; Eigen::Vector4f origin; @@ -1054,7 +1054,7 @@ pcl::PCDReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::string -pcl::PCDWriter::generateHeaderASCII (const sensor_msgs::PointCloud2 &cloud, +pcl::PCDWriter::generateHeaderASCII (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) { std::ostringstream oss; @@ -1154,7 +1154,7 @@ pcl::PCDWriter::generateHeaderASCII (const sensor_msgs::PointCloud2 &cloud, /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::string -pcl::PCDWriter::generateHeaderBinary (const sensor_msgs::PointCloud2 &cloud, +pcl::PCDWriter::generateHeaderBinary (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) { std::ostringstream oss; @@ -1235,7 +1235,7 @@ pcl::PCDWriter::generateHeaderBinary (const sensor_msgs::PointCloud2 &cloud, /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::string -pcl::PCDWriter::generateHeaderBinaryCompressed (const sensor_msgs::PointCloud2 &cloud, +pcl::PCDWriter::generateHeaderBinaryCompressed (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) { @@ -1288,7 +1288,7 @@ pcl::PCDWriter::generateHeaderBinaryCompressed (const sensor_msgs::PointCloud2 & /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDWriter::writeASCII (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, +pcl::PCDWriter::writeASCII (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, const int precision) { @@ -1338,44 +1338,44 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const sensor_msgs::Poi { switch (cloud.fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { - copyValueString::type>(cloud, i, point_size, d, c, stream); + copyValueString::type>(cloud, i, point_size, d, c, stream); break; } default: @@ -1400,7 +1400,7 @@ pcl::PCDWriter::writeASCII (const std::string &file_name, const sensor_msgs::Poi /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDWriter::writeBinary (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, +pcl::PCDWriter::writeBinary (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) { if (cloud.data.empty ()) @@ -1511,7 +1511,7 @@ pcl::PCDWriter::writeBinary (const std::string &file_name, const sensor_msgs::Po /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// int -pcl::PCDWriter::writeBinaryCompressed (const std::string &file_name, const sensor_msgs::PointCloud2 &cloud, +pcl::PCDWriter::writeBinaryCompressed (const std::string &file_name, const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation) { if (cloud.data.empty ()) @@ -1549,7 +1549,7 @@ pcl::PCDWriter::writeBinaryCompressed (const std::string &file_name, const senso size_t fsize = 0; size_t data_size = 0; size_t nri = 0; - std::vector fields (cloud.fields.size ()); + std::vector fields (cloud.fields.size ()); std::vector fields_sizes (cloud.fields.size ()); // Compute the total size of the fields for (size_t i = 0; i < cloud.fields.size (); ++i) diff --git a/io/src/ply_io.cpp b/io/src/ply_io.cpp index 534abdd0b08..2eb063374da 100644 --- a/io/src/ply_io.cpp +++ b/io/src/ply_io.cpp @@ -102,19 +102,19 @@ pcl::PLYReader::endHeaderCallback () void pcl::PLYReader::appendFloatProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (::pcl::PCLPointField ()); + ::pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::FLOAT32; + current_field.datatype = ::pcl::PCLPointField::FLOAT32; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::FLOAT32) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (::pcl::PCLPointField::FLOAT32) * size); } void pcl::PLYReader::amendProperty (const std::string& old_name, const std::string& new_name, uint8_t new_datatype) { - std::vector< ::sensor_msgs::PointField>::reverse_iterator finder = cloud_->fields.rbegin (); + std::vector< ::pcl::PCLPointField>::reverse_iterator finder = cloud_->fields.rbegin (); for (; finder != cloud_->fields.rend (); ++finder) if (finder->name == old_name) break; @@ -127,85 +127,85 @@ pcl::PLYReader::amendProperty (const std::string& old_name, const std::string& n void pcl::PLYReader::appendUnsignedIntProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (::pcl::PCLPointField ()); + ::pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::UINT32; + current_field.datatype = ::pcl::PCLPointField::UINT32; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::UINT32) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (::pcl::PCLPointField::UINT32) * size); } void pcl::PLYReader::appendIntProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::INT32; + current_field.datatype = pcl::PCLPointField::INT32; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::INT32) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (pcl::PCLPointField::INT32) * size); } void pcl::PLYReader::appendDoubleProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::FLOAT64; + current_field.datatype = pcl::PCLPointField::FLOAT64; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::FLOAT64) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (pcl::PCLPointField::FLOAT64) * size); } void pcl::PLYReader::appendUnsignedCharProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::UINT8; + current_field.datatype = pcl::PCLPointField::UINT8; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::UINT8) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (pcl::PCLPointField::UINT8) * size); } void pcl::PLYReader::appendCharProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::INT8; + current_field.datatype = pcl::PCLPointField::INT8; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::INT8) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (pcl::PCLPointField::INT8) * size); } void pcl::PLYReader::appendUnsignedShortProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::UINT16; + current_field.datatype = pcl::PCLPointField::UINT16; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::UINT16) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (pcl::PCLPointField::UINT16) * size); } void pcl::PLYReader::appendShortProperty (const std::string& name, const size_t& size) { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = name; current_field.offset = cloud_->point_step; - current_field.datatype = ::sensor_msgs::PointField::INT16; + current_field.datatype = pcl::PCLPointField::INT16; current_field.count = static_cast (size); - cloud_->point_step += static_cast (pcl::getFieldSize (::sensor_msgs::PointField::INT16) * size); + cloud_->point_step += static_cast (pcl::getFieldSize (pcl::PCLPointField::INT16) * size); } namespace pcl @@ -294,7 +294,7 @@ namespace pcl } else if (property_name == "alpha") { - amendProperty ("rgb", "rgba", sensor_msgs::PointField::UINT32); + amendProperty ("rgb", "rgba", pcl::PCLPointField::UINT32); return boost::bind (&pcl::PLYReader::vertexAlphaCallback, this, _1); } else if (property_name == "intensity") @@ -402,7 +402,7 @@ namespace pcl // Adjust size only once if (vertex_count_ == 0) { - std::vector< ::sensor_msgs::PointField>::reverse_iterator finder = cloud_->fields.rbegin (); + std::vector< pcl::PCLPointField>::reverse_iterator finder = cloud_->fields.rbegin (); for (; finder != cloud_->fields.rend (); ++finder) if (finder->name == name) break; @@ -434,8 +434,8 @@ namespace pcl } else if (element_name == "vertex") { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = property_name; current_field.offset = cloud_->point_step; current_field.datatype = pcl::traits::asEnum::value; @@ -463,8 +463,8 @@ namespace pcl { if (element_name == "vertex") { - cloud_->fields.push_back (::sensor_msgs::PointField ()); - ::sensor_msgs::PointField ¤t_field = cloud_->fields.back (); + cloud_->fields.push_back (pcl::PCLPointField ()); + pcl::PCLPointField ¤t_field = cloud_->fields.back (); current_field.name = property_name; current_field.offset = cloud_->point_step; current_field.datatype = pcl::traits::asEnum::value; @@ -721,7 +721,7 @@ pcl::PLYReader::parse (const std::string& istream_filename) //////////////////////////////////////////////////////////////////////////////////////// int -pcl::PLYReader::readHeader (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, +pcl::PLYReader::readHeader (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &, Eigen::Quaternionf &, int &, int &, unsigned int &, const int) { @@ -740,7 +740,7 @@ pcl::PLYReader::readHeader (const std::string &file_name, sensor_msgs::PointClou //////////////////////////////////////////////////////////////////////////////////////// int -pcl::PLYReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cloud, +pcl::PLYReader::read (const std::string &file_name, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &origin, Eigen::Quaternionf &orientation, int &ply_version, const int) { // kept only for backward compatibility @@ -766,10 +766,10 @@ pcl::PLYReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl if ((*range_grid_)[r].size () == 0) { for (size_t f = 0; f < cloud_->fields.size (); ++f) - if (cloud_->fields[f].datatype == ::sensor_msgs::PointField::FLOAT32) + if (cloud_->fields[f].datatype == ::pcl::PCLPointField::FLOAT32) memcpy (&data[r * cloud_->point_step + cloud_->fields[f].offset], reinterpret_cast (&f_nan), sizeof (float)); - else if (cloud_->fields[f].datatype == ::sensor_msgs::PointField::FLOAT64) + else if (cloud_->fields[f].datatype == ::pcl::PCLPointField::FLOAT64) memcpy (&data[r * cloud_->point_step + cloud_->fields[f].offset], reinterpret_cast (&d_nan), sizeof (double)); else @@ -800,7 +800,7 @@ pcl::PLYReader::read (const std::string &file_name, sensor_msgs::PointCloud2 &cl //////////////////////////////////////////////////////////////////////////////////////// std::string -pcl::PLYWriter::generateHeader (const sensor_msgs::PointCloud2 &cloud, +pcl::PLYWriter::generateHeader (const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &, bool binary, @@ -876,14 +876,14 @@ pcl::PLYWriter::generateHeader (const sensor_msgs::PointCloud2 &cloud, oss << " list uint"; switch (cloud.fields[i].datatype) { - case sensor_msgs::PointField::INT8 : oss << " char "; break; - case sensor_msgs::PointField::UINT8 : oss << " uchar "; break; - case sensor_msgs::PointField::INT16 : oss << " short "; break; - case sensor_msgs::PointField::UINT16 : oss << " ushort "; break; - case sensor_msgs::PointField::INT32 : oss << " int "; break; - case sensor_msgs::PointField::UINT32 : oss << " uint "; break; - case sensor_msgs::PointField::FLOAT32 : oss << " float "; break; - case sensor_msgs::PointField::FLOAT64 : oss << " double "; break; + case pcl::PCLPointField::INT8 : oss << " char "; break; + case pcl::PCLPointField::UINT8 : oss << " uchar "; break; + case pcl::PCLPointField::INT16 : oss << " short "; break; + case pcl::PCLPointField::UINT16 : oss << " ushort "; break; + case pcl::PCLPointField::INT32 : oss << " int "; break; + case pcl::PCLPointField::UINT32 : oss << " uint "; break; + case pcl::PCLPointField::FLOAT32 : oss << " float "; break; + case pcl::PCLPointField::FLOAT64 : oss << " double "; break; default : { PCL_ERROR ("[pcl::PLYWriter::generateHeader] unknown data field type!"); @@ -934,7 +934,7 @@ pcl::PLYWriter::generateHeader (const sensor_msgs::PointCloud2 &cloud, int pcl::PLYWriter::writeASCII (const std::string &file_name, - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, int precision, @@ -982,7 +982,7 @@ pcl::PLYWriter::writeASCII (const std::string &file_name, void pcl::PLYWriter::writeContentWithCameraASCII (int nr_points, int point_size, - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, std::ofstream& fs) @@ -1002,42 +1002,42 @@ pcl::PLYWriter::writeContentWithCameraASCII (int nr_points, { switch (cloud.fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { char value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (char)], sizeof (char)); fs << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { unsigned char value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (unsigned char)], sizeof (unsigned char)); fs << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { short value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (short)], sizeof (short)); fs << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { unsigned short value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (unsigned short)], sizeof (unsigned short)); fs << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { int value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (int)], sizeof (int)); fs << value; break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { if (cloud.fields[d].name.find ("rgba") == std::string::npos) { @@ -1057,7 +1057,7 @@ pcl::PLYWriter::writeContentWithCameraASCII (int nr_points, } break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { if (cloud.fields[d].name.find ("rgb") == std::string::npos) { @@ -1076,7 +1076,7 @@ pcl::PLYWriter::writeContentWithCameraASCII (int nr_points, } break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { double value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (double)], sizeof (double)); @@ -1121,7 +1121,7 @@ pcl::PLYWriter::writeContentWithCameraASCII (int nr_points, void pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points, int point_size, - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, std::ostringstream& fs, int& valid_points) { @@ -1143,42 +1143,42 @@ pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points, { switch (cloud.fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { char value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (char)], sizeof (char)); line << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { unsigned char value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (unsigned char)], sizeof (unsigned char)); line << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { short value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (short)], sizeof (short)); line << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { unsigned short value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (unsigned short)], sizeof (unsigned short)); line << boost::numeric_cast (value); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { int value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (int)], sizeof (int)); line << value; break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { if (cloud.fields[d].name.find ("rgba") == std::string::npos) { @@ -1198,7 +1198,7 @@ pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points, } break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { if (cloud.fields[d].name.find ("rgb") == std::string::npos) { @@ -1223,7 +1223,7 @@ pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points, } break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { double value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + c * sizeof (double)], sizeof (double)); @@ -1268,7 +1268,7 @@ pcl::PLYWriter::writeContentWithRangeGridASCII (int nr_points, //////////////////////////////////////////////////////////////////////////////////////// int pcl::PLYWriter::writeBinary (const std::string &file_name, - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const Eigen::Vector4f &origin, const Eigen::Quaternionf &orientation, bool use_camera) @@ -1299,7 +1299,7 @@ pcl::PLYWriter::writeBinary (const std::string &file_name, // Determine the field containing the x-coordinate int xfield = pcl::getFieldIndex (cloud, "x"); - if (xfield >= 0 && cloud.fields[xfield].datatype != sensor_msgs::PointField::FLOAT32) + if (xfield >= 0 && cloud.fields[xfield].datatype != pcl::PCLPointField::FLOAT32) xfield = -1; // If no x-coordinate field exists, then assume all points are valid @@ -1371,42 +1371,42 @@ pcl::PLYWriter::writeBinary (const std::string &file_name, { switch (cloud.fields[d].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: { char value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + (total + c) * sizeof (char)], sizeof (char)); fpout.write (reinterpret_cast (&value), sizeof (char)); break; } - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: { unsigned char value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + (total + c) * sizeof (unsigned char)], sizeof (unsigned char)); fpout.write (reinterpret_cast (&value), sizeof (unsigned char)); break; } - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: { short value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + (total + c) * sizeof (short)], sizeof (short)); fpout.write (reinterpret_cast (&value), sizeof (short)); break; } - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: { unsigned short value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + (total + c) * sizeof (unsigned short)], sizeof (unsigned short)); fpout.write (reinterpret_cast (&value), sizeof (unsigned short)); break; } - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: { int value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + (total + c) * sizeof (int)], sizeof (int)); fpout.write (reinterpret_cast (&value), sizeof (int)); break; } - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: { if (cloud.fields[d].name.find ("rgba") == std::string::npos) { @@ -1429,7 +1429,7 @@ pcl::PLYWriter::writeBinary (const std::string &file_name, } break; } - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: { if (cloud.fields[d].name.find ("rgb") == std::string::npos) { @@ -1450,7 +1450,7 @@ pcl::PLYWriter::writeBinary (const std::string &file_name, } break; } - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: { double value; memcpy (&value, &cloud.data[i * point_size + cloud.fields[d].offset + (total + c) * sizeof (double)], sizeof (double)); @@ -1606,7 +1606,7 @@ pcl::io::savePLYFile (const std::string &file_name, const pcl::PolygonMesh &mesh int c = 0; // adding vertex - if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( mesh.cloud.fields[d].name == "x" || mesh.cloud.fields[d].name == "y" || mesh.cloud.fields[d].name == "z")) @@ -1618,7 +1618,7 @@ pcl::io::savePLYFile (const std::string &file_name, const pcl::PolygonMesh &mesh // break; ++xyz; } - else if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && + else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (mesh.cloud.fields[d].name == "rgb")) { @@ -1626,7 +1626,7 @@ pcl::io::savePLYFile (const std::string &file_name, const pcl::PolygonMesh &mesh memcpy (&color, &mesh.cloud.data[i * point_size + mesh.cloud.fields[rgb_index].offset + c * sizeof (float)], sizeof (RGB)); fs << int (color.r) << " " << int (color.g) << " " << int (color.b); } - else if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::UINT32) && + else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::UINT32) && (mesh.cloud.fields[d].name == "rgba")) { pcl::RGB color; @@ -1735,7 +1735,7 @@ pcl::io::savePLYFileBinary (const std::string &file_name, const pcl::PolygonMesh int c = 0; // adding vertex - if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( mesh.cloud.fields[d].name == "x" || mesh.cloud.fields[d].name == "y" || mesh.cloud.fields[d].name == "z")) @@ -1747,7 +1747,7 @@ pcl::io::savePLYFileBinary (const std::string &file_name, const pcl::PolygonMesh // break; ++xyz; } - else if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && + else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && (mesh.cloud.fields[d].name == "rgb")) { @@ -1757,7 +1757,7 @@ pcl::io::savePLYFileBinary (const std::string &file_name, const pcl::PolygonMesh fpout.write (reinterpret_cast (&color.g), sizeof (unsigned char)); fpout.write (reinterpret_cast (&color.b), sizeof (unsigned char)); } - else if ((mesh.cloud.fields[d].datatype == sensor_msgs::PointField::UINT32) && + else if ((mesh.cloud.fields[d].datatype == pcl::PCLPointField::UINT32) && (mesh.cloud.fields[d].name == "rgba")) { pcl::RGB color; diff --git a/io/src/vtk_io.cpp b/io/src/vtk_io.cpp index d5cc50606e6..b20f2a9d88e 100644 --- a/io/src/vtk_io.cpp +++ b/io/src/vtk_io.cpp @@ -75,7 +75,7 @@ pcl::io::saveVTKFile (const std::string &file_name, if (count == 0) count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; - if ((triangles.cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((triangles.cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( triangles.cloud.fields[d].name == "x" || triangles.cloud.fields[d].name == "y" || triangles.cloud.fields[d].name == "z")) @@ -128,7 +128,7 @@ pcl::io::saveVTKFile (const std::string &file_name, if (count == 0) count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; - if (triangles.cloud.fields[field_index].datatype == sensor_msgs::PointField::FLOAT32) + if (triangles.cloud.fields[field_index].datatype == pcl::PCLPointField::FLOAT32) { pcl::RGB color; memcpy (&color, &triangles.cloud.data[i * point_size + triangles.cloud.fields[field_index].offset + c * sizeof (float)], sizeof (RGB)); @@ -149,7 +149,7 @@ pcl::io::saveVTKFile (const std::string &file_name, ////////////////////////////////////////////////////////////////////////////////////////////// int pcl::io::saveVTKFile (const std::string &file_name, - const sensor_msgs::PointCloud2 &cloud, unsigned precision) + const pcl::PCLPointCloud2 &cloud, unsigned precision) { if (cloud.data.empty ()) { @@ -178,7 +178,7 @@ pcl::io::saveVTKFile (const std::string &file_name, if (count == 0) count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; - if ((cloud.fields[d].datatype == sensor_msgs::PointField::FLOAT32) && ( + if ((cloud.fields[d].datatype == pcl::PCLPointField::FLOAT32) && ( cloud.fields[d].name == "x" || cloud.fields[d].name == "y" || cloud.fields[d].name == "z")) @@ -215,7 +215,7 @@ pcl::io::saveVTKFile (const std::string &file_name, if (count == 0) count = 1; // we simply cannot tolerate 0 counts (coming from older converter code) int c = 0; - if (cloud.fields[field_index].datatype == sensor_msgs::PointField::FLOAT32) + if (cloud.fields[field_index].datatype == pcl::PCLPointField::FLOAT32) { pcl::RGB color; memcpy (&color, &cloud.data[i * point_size + cloud.fields[field_index].offset + c * sizeof (float)], sizeof (RGB)); diff --git a/io/src/vtk_lib_io.cpp b/io/src/vtk_lib_io.cpp index 08d2c34af0d..cdbb2301f0d 100644 --- a/io/src/vtk_lib_io.cpp +++ b/io/src/vtk_lib_io.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include @@ -283,9 +283,9 @@ pcl::io::vtk2mesh (const vtkSmartPointer& poly_data, pcl::PolygonMe rgb_cloud->points[i].b = point_color[2]; } - sensor_msgs::PointCloud2 rgb_cloud2; + pcl::PCLPointCloud2 rgb_cloud2; pcl::toROSMsg (*rgb_cloud, rgb_cloud2); - sensor_msgs::PointCloud2 aux; + pcl::PCLPointCloud2 aux; pcl::concatenateFields (rgb_cloud2, mesh.cloud, aux); mesh.cloud = aux; } @@ -312,9 +312,9 @@ pcl::io::vtk2mesh (const vtkSmartPointer& poly_data, pcl::PolygonMe normal_cloud->points[i].normal_z = normal[2]; } - sensor_msgs::PointCloud2 normal_cloud2; + pcl::PCLPointCloud2 normal_cloud2; pcl::toROSMsg (*normal_cloud, normal_cloud2); - sensor_msgs::PointCloud2 aux; + pcl::PCLPointCloud2 aux; pcl::concatenateFields (normal_cloud2, mesh.cloud, aux); mesh.cloud = aux; } @@ -517,7 +517,7 @@ pcl::io::saveRangeImagePlanarFilePNG ( /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void -pcl::io::pointCloudTovtkPolyData(const sensor_msgs::PointCloud2Ptr& cloud, vtkSmartPointer& poly_data) +pcl::io::pointCloudTovtkPolyData(const pcl::PCLPointCloud2Ptr& cloud, vtkSmartPointer& poly_data) { if (!poly_data.GetPointer()) poly_data = vtkSmartPointer::New (); // OR poly_data->Reset(); diff --git a/io/tools/convert_pcd_ascii_binary.cpp b/io/tools/convert_pcd_ascii_binary.cpp index 9a6fd7ac6ba..deedc8ab651 100644 --- a/io/tools/convert_pcd_ascii_binary.cpp +++ b/io/tools/convert_pcd_ascii_binary.cpp @@ -59,7 +59,7 @@ main (int argc, char** argv) return (-1); } - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; Eigen::Vector4f origin; Eigen::Quaternionf orientation; if (pcl::io::loadPCDFile (string (argv[1]), cloud, origin, orientation) < 0) diff --git a/io/tools/hdl_grabber_example.cpp b/io/tools/hdl_grabber_example.cpp index 5b2f55b064b..f6878f4b13e 100644 --- a/io/tools/hdl_grabber_example.cpp +++ b/io/tools/hdl_grabber_example.cpp @@ -50,11 +50,7 @@ class SimpleHDLGrabber if (sweep->header.seq == 0) { pcl::uint64_t stamp; -#ifdef USE_ROS - stamp = sweep->header.stamp.toNSec () / 1000; -#else //USE_ROS stamp = sweep->header.stamp; -#endif //USE_ROS time_t systemTime = static_cast(((stamp & 0xffffffff00000000l) >> 32) & 0x00000000ffffffff); pcl::uint32_t usec = static_cast(stamp & 0x00000000ffffffff); std::cout << std::hex << stamp << " " << ctime(&systemTime) << " usec: " << usec << std::endl; diff --git a/keypoints/include/pcl/keypoints/sift_keypoint.h b/keypoints/include/pcl/keypoints/sift_keypoint.h index 7b58085837a..636f3ba78b0 100644 --- a/keypoints/include/pcl/keypoints/sift_keypoint.h +++ b/keypoints/include/pcl/keypoints/sift_keypoint.h @@ -195,7 +195,7 @@ namespace pcl int scale_idx_; /** \brief The list of fields present in the output point cloud data. */ - std::vector out_fields_; + std::vector out_fields_; SIFTKeypointFieldSelector getFieldValue_; }; diff --git a/keypoints/include/pcl/keypoints/susan.h b/keypoints/include/pcl/keypoints/susan.h index b1eef6fe5f9..a4c1937c536 100644 --- a/keypoints/include/pcl/keypoints/susan.h +++ b/keypoints/include/pcl/keypoints/susan.h @@ -193,7 +193,7 @@ namespace pcl */ int label_idx_; /** \brief The list of fields present in the output point cloud data. */ - std::vector out_fields_; + std::vector out_fields_; pcl::common::IntensityFieldAccessor intensity_out_; }; } diff --git a/ml/include/pcl/ml/impl/kmeans.hpp b/ml/include/pcl/ml/impl/kmeans.hpp index c6752ffbe79..e5c65a29b04 100644 --- a/ml/include/pcl/ml/impl/kmeans.hpp +++ b/ml/include/pcl/ml/impl/kmeans.hpp @@ -82,7 +82,7 @@ pcl::Kmeans::cluster (std::vector &clusters) } pcl::PointCloud point; - std::vector fields; + std::vector fields; int user_index = -1; // if no cluster field name is set, check for X Y Z @@ -168,7 +168,7 @@ pcl::Kmeans::cluster (std::vector &clusters) std::cout << "t: " << t << std::endl; */ - //std::vector fields; + //std::vector fields; //pcl::getFieldIndex (*input_, "xyz", fields); diff --git a/ml/src/kmeans.cpp b/ml/src/kmeans.cpp index 4c7454e9226..9cfcbaeef62 100644 --- a/ml/src/kmeans.cpp +++ b/ml/src/kmeans.cpp @@ -202,7 +202,7 @@ pcl::Kmeans::cluster (std::vector &clusters) } pcl::PointCloud point; - std::vector fields; + std::vector fields; int user_index = -1; // if no cluster field name is set, check for X Y Z @@ -291,7 +291,7 @@ pcl::Kmeans::cluster (std::vector &clusters) std::cout << "t: " << t << std::endl; */ - //std::vector fields; + //std::vector fields; //pcl::getFieldIndex (*input_, "xyz", fields); diff --git a/outofcore/include/pcl/outofcore/impl/octree_base.hpp b/outofcore/include/pcl/outofcore/impl/octree_base.hpp index bc5709ed6ee..3002f00e6f2 100644 --- a/outofcore/include/pcl/outofcore/impl/octree_base.hpp +++ b/outofcore/include/pcl/outofcore/impl/octree_base.hpp @@ -79,7 +79,7 @@ namespace pcl , read_write_mutex_ () , metadata_ (new OutofcoreOctreeBaseMetadata ()) , sample_percent_ (0.125) - , lod_filter_ptr_ (new pcl::RandomSample ()) + , lod_filter_ptr_ (new pcl::RandomSample ()) { //validate the root filename if (!this->checkExtension (root_name)) @@ -107,7 +107,7 @@ namespace pcl , read_write_mutex_ () , metadata_ (new OutofcoreOctreeBaseMetadata ()) , sample_percent_ (0.125) - , lod_filter_ptr_ (new pcl::RandomSample ()) + , lod_filter_ptr_ (new pcl::RandomSample ()) { //Enlarge the bounding box to a cube so our voxels will be cubes Eigen::Vector3d tmp_min = min; @@ -129,7 +129,7 @@ namespace pcl , read_write_mutex_ () , metadata_ (new OutofcoreOctreeBaseMetadata ()) , sample_percent_ (0.125) - , lod_filter_ptr_ (new pcl::RandomSample ()) + , lod_filter_ptr_ (new pcl::RandomSample ()) { //Create a new outofcore tree this->init (max_depth, min, max, root_node_name, coord_sys); @@ -229,7 +229,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template boost::uint64_t - OutofcoreOctreeBase::addPointCloud (sensor_msgs::PointCloud2::Ptr &input_cloud, const bool skip_bb_check) + OutofcoreOctreeBase::addPointCloud (pcl::PCLPointCloud2::Ptr &input_cloud, const bool skip_bb_check) { uint64_t pt_added = this->root_node_->addPointCloud (input_cloud, skip_bb_check) ; // assert (input_cloud->width*input_cloud->height == pt_added); @@ -251,7 +251,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template boost::uint64_t - OutofcoreOctreeBase::addPointCloud_and_genLOD (sensor_msgs::PointCloud2::Ptr &input_cloud) + OutofcoreOctreeBase::addPointCloud_and_genLOD (pcl::PCLPointCloud2::Ptr &input_cloud) { // Lock the tree while writing boost::unique_lock < boost::shared_mutex > lock (read_write_mutex_); @@ -321,7 +321,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeBase::queryBBIncludes (const Eigen::Vector3d& min, const Eigen::Vector3d& max, const boost::uint64_t query_depth, const sensor_msgs::PointCloud2::Ptr& dst_blob) const + OutofcoreOctreeBase::queryBBIncludes (const Eigen::Vector3d& min, const Eigen::Vector3d& max, const boost::uint64_t query_depth, const pcl::PCLPointCloud2::Ptr& dst_blob) const { boost::shared_lock < boost::shared_mutex > lock (read_write_mutex_); @@ -344,7 +344,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeBase::queryBoundingBox (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const int query_depth, const sensor_msgs::PointCloud2::Ptr &dst_blob, double percent) + OutofcoreOctreeBase::queryBoundingBox (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const int query_depth, const pcl::PCLPointCloud2::Ptr &dst_blob, double percent) { if (percent==1.0) { @@ -497,7 +497,7 @@ namespace pcl } //////////////////////////////////////////////////////////////////////////////// - template pcl::Filter::Ptr + template pcl::Filter::Ptr OutofcoreOctreeBase::getLODFilter () { return (lod_filter_ptr_); @@ -505,7 +505,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// - template const pcl::Filter::ConstPtr + template const pcl::Filter::ConstPtr OutofcoreOctreeBase::getLODFilter () const { return (lod_filter_ptr_); @@ -514,7 +514,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeBase::setLODFilter (const pcl::Filter::Ptr& filter_arg) + OutofcoreOctreeBase::setLODFilter (const pcl::Filter::Ptr& filter_arg) { lod_filter_ptr_ = filter_arg; } @@ -604,7 +604,7 @@ namespace pcl BranchNode* leaf = current_branch.back (); - sensor_msgs::PointCloud2::Ptr leaf_input_cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr leaf_input_cloud (new pcl::PCLPointCloud2 ()); //read the data from the PCD file associated with the leaf; it is full resolution leaf->read (leaf_input_cloud); assert (leaf_input_cloud->width*leaf_input_cloud->height > 0); @@ -635,14 +635,14 @@ namespace pcl lod_filter_ptr_->setSample (static_cast(sample_size)); //create our destination - sensor_msgs::PointCloud2::Ptr downsampled_cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr downsampled_cloud (new pcl::PCLPointCloud2 ()); //create destination for indices pcl::IndicesPtr downsampled_cloud_indices (new std::vector< int > ()); lod_filter_ptr_->filter (*downsampled_cloud_indices); //extract the "random subset", size by setSampleSize - pcl::ExtractIndices extractor; + pcl::ExtractIndices extractor; extractor.setInputCloud (leaf_input_cloud); extractor.setIndices (downsampled_cloud_indices); extractor.filter (*downsampled_cloud); diff --git a/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp b/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp index c03579f67d7..0f8c7b31139 100644 --- a/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp +++ b/outofcore/include/pcl/outofcore/impl/octree_base_node.hpp @@ -505,7 +505,7 @@ namespace pcl template boost::uint64_t - OutofcoreOctreeBaseNode::addPointCloud (const typename sensor_msgs::PointCloud2::Ptr& input_cloud, const bool skip_bb_check) + OutofcoreOctreeBaseNode::addPointCloud (const typename pcl::PCLPointCloud2::Ptr& input_cloud, const bool skip_bb_check) { assert (this->root_node_->m_tree_ != NULL); @@ -546,7 +546,7 @@ namespace pcl createChild (i); } - sensor_msgs::PointCloud2::Ptr dst_cloud (new sensor_msgs::PointCloud2 () ); + pcl::PCLPointCloud2::Ptr dst_cloud (new pcl::PCLPointCloud2 () ); PCL_DEBUG ( "[pcl::outofcore::OutofcoreOctreeBaseNode::%s] Extracting indices to bins\n", __FUNCTION__); @@ -663,7 +663,7 @@ namespace pcl } //////////////////////////////////////////////////////////////////////////////// template boost::uint64_t - OutofcoreOctreeBaseNode::addDataAtMaxDepth (const sensor_msgs::PointCloud2::Ptr input_cloud, const bool skip_bb_check) + OutofcoreOctreeBaseNode::addDataAtMaxDepth (const pcl::PCLPointCloud2::Ptr input_cloud, const bool skip_bb_check) { //this assumes data is already in the correct bin if(skip_bb_check == true) @@ -717,7 +717,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template boost::uint64_t - OutofcoreOctreeBaseNode::addPointCloud_and_genLOD (const sensor_msgs::PointCloud2::Ptr input_cloud) //, const bool skip_bb_check = false ) + OutofcoreOctreeBaseNode::addPointCloud_and_genLOD (const pcl::PCLPointCloud2::Ptr input_cloud) //, const bool skip_bb_check = false ) { boost::uint64_t points_added = 0; @@ -746,7 +746,7 @@ namespace pcl // 1. Get indices from a random sample // 2. Extract those indices with the extract indices class (in order to also get the complement) //------------------------------------------------------------ - pcl::RandomSample random_sampler; + pcl::RandomSample random_sampler; random_sampler.setInputCloud (input_cloud); //set sample size to 1/8 of total points (12.5%) @@ -754,20 +754,20 @@ namespace pcl random_sampler.setSample (static_cast (sample_size)); //create our destination - sensor_msgs::PointCloud2::Ptr downsampled_cloud ( new sensor_msgs::PointCloud2 () ); + pcl::PCLPointCloud2::Ptr downsampled_cloud ( new pcl::PCLPointCloud2 () ); //create destination for indices pcl::IndicesPtr downsampled_cloud_indices ( new std::vector< int > () ); random_sampler.filter (*downsampled_cloud_indices); //extract the "random subset", size by setSampleSize - pcl::ExtractIndices extractor; + pcl::ExtractIndices extractor; extractor.setInputCloud (input_cloud); extractor.setIndices (downsampled_cloud_indices); extractor.filter (*downsampled_cloud); //extract the complement of those points (i.e. everything remaining) - sensor_msgs::PointCloud2::Ptr remaining_points ( new sensor_msgs::PointCloud2 () ); + pcl::PCLPointCloud2::Ptr remaining_points ( new pcl::PCLPointCloud2 () ); extractor.setNegative (true); extractor.filter (*remaining_points); @@ -803,7 +803,7 @@ namespace pcl } //copy correct indices into a temporary cloud - sensor_msgs::PointCloud2::Ptr tmp_local_point_cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr tmp_local_point_cloud (new pcl::PCLPointCloud2 ()); pcl::copyPointCloud (*remaining_points, indices[i], *tmp_local_point_cloud); //recursively add points and keep track of how many were successfully added to the tree @@ -1390,7 +1390,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeBaseNode::queryBBIncludes (const Eigen::Vector3d& min_bb, const Eigen::Vector3d& max_bb, size_t query_depth, const sensor_msgs::PointCloud2::Ptr& dst_blob) + OutofcoreOctreeBaseNode::queryBBIncludes (const Eigen::Vector3d& min_bb, const Eigen::Vector3d& max_bb, size_t query_depth, const pcl::PCLPointCloud2::Ptr& dst_blob) { uint64_t startingSize = dst_blob->width*dst_blob->height; PCL_DEBUG ("[pcl::outofcore::OutofcoreOctreeBaseNode::%s] Starting points in destination blob: %ul\n", __FUNCTION__, startingSize ); @@ -1420,9 +1420,9 @@ namespace pcl } else //otherwise if we are at the max depth { - //get all the points from the payload and return (easy with PointCloud2) - sensor_msgs::PointCloud2::Ptr tmp_blob (new sensor_msgs::PointCloud2 ()); - sensor_msgs::PointCloud2::Ptr tmp_dst_blob (new sensor_msgs::PointCloud2 ()); + //get all the points from the payload and return (easy with PCLPointCloud2) + pcl::PCLPointCloud2::Ptr tmp_blob (new pcl::PCLPointCloud2 ()); + pcl::PCLPointCloud2::Ptr tmp_dst_blob (new pcl::PCLPointCloud2 ()); //load all the data in this node from disk payload_->readRange (0, payload_->size (), tmp_blob); @@ -1484,7 +1484,7 @@ namespace pcl if( dst_blob->width*dst_blob->height > 0 ) { //need a new tmp destination with extracted points within BB - sensor_msgs::PointCloud2::Ptr tmp_blob_within_bb (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr tmp_blob_within_bb (new pcl::PCLPointCloud2 ()); //copy just the points marked in indices pcl::copyPointCloud ( *tmp_blob, indices, *tmp_blob_within_bb ); @@ -1588,7 +1588,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeBaseNode::queryBBIncludes_subsample (const Eigen::Vector3d& min_bb, const Eigen::Vector3d& max_bb, boost::uint64_t query_depth, const sensor_msgs::PointCloud2::Ptr& dst_blob, double percent) + OutofcoreOctreeBaseNode::queryBBIncludes_subsample (const Eigen::Vector3d& min_bb, const Eigen::Vector3d& max_bb, boost::uint64_t query_depth, const pcl::PCLPointCloud2::Ptr& dst_blob, double percent) { if (intersectsWithBoundingBox (min_bb, max_bb)) { @@ -1614,7 +1614,7 @@ namespace pcl if (inBoundingBox (min_bb, max_bb)) { - sensor_msgs::PointCloud2::Ptr tmp_blob; + pcl::PCLPointCloud2::Ptr tmp_blob; this->payload_->read (tmp_blob); uint64_t num_pts = tmp_blob->width*tmp_blob->height; @@ -1630,15 +1630,15 @@ namespace pcl } - pcl::RandomSample random_sampler; + pcl::RandomSample random_sampler; random_sampler.setInputCloud (tmp_blob); - sensor_msgs::PointCloud2::Ptr downsampled_points (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr downsampled_points (new pcl::PCLPointCloud2 ()); //set sample size as percent * number of points read random_sampler.setSample (static_cast (sample_points)); - pcl::ExtractIndices extractor; + pcl::ExtractIndices extractor; pcl::IndicesPtr downsampled_cloud_indices (new std::vector ()); random_sampler.filter (*downsampled_cloud_indices); @@ -1913,7 +1913,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template int - OutofcoreOctreeBaseNode::read (sensor_msgs::PointCloud2::Ptr &output_cloud) + OutofcoreOctreeBaseNode::read (pcl::PCLPointCloud2::Ptr &output_cloud) { return (this->payload_->read (output_cloud)); } @@ -2004,7 +2004,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeBaseNode::sortOctantIndices (const sensor_msgs::PointCloud2::Ptr &input_cloud, std::vector< std::vector > &indices, const Eigen::Vector3d &mid_xyz) + OutofcoreOctreeBaseNode::sortOctantIndices (const pcl::PCLPointCloud2::Ptr &input_cloud, std::vector< std::vector > &indices, const Eigen::Vector3d &mid_xyz) { if (indices.size () < 8) indices.resize (8); diff --git a/outofcore/include/pcl/outofcore/impl/octree_disk_container.hpp b/outofcore/include/pcl/outofcore/impl/octree_disk_container.hpp index c776715c14b..bd4fe59aeeb 100644 --- a/outofcore/include/pcl/outofcore/impl/octree_disk_container.hpp +++ b/outofcore/include/pcl/outofcore/impl/octree_disk_container.hpp @@ -51,7 +51,7 @@ // PCL #include #include -#include +#include // PCL (Urban Robotics) #include @@ -134,7 +134,7 @@ namespace pcl filelen_ = len / sizeof(PointT); - sensor_msgs::PointCloud2 cloud_info; + pcl::PCLPointCloud2 cloud_info; Eigen::Vector4f origin; Eigen::Quaternionf orientation; int pcd_version; @@ -509,9 +509,9 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeDiskContainer::insertRange (const sensor_msgs::PointCloud2::Ptr& input_cloud) + OutofcoreOctreeDiskContainer::insertRange (const pcl::PCLPointCloud2::Ptr& input_cloud) { - sensor_msgs::PointCloud2::Ptr tmp_cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr tmp_cloud (new pcl::PCLPointCloud2 ()); //if there's a pcd file with data associated with this node, read the data, concatenate, and resave if (boost::filesystem::exists (*disk_storage_filename_)) @@ -550,7 +550,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template void - OutofcoreOctreeDiskContainer::readRange (const uint64_t, const uint64_t, sensor_msgs::PointCloud2::Ptr& dst) + OutofcoreOctreeDiskContainer::readRange (const uint64_t, const uint64_t, pcl::PCLPointCloud2::Ptr& dst) { pcl::PCDReader reader; @@ -574,9 +574,9 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////// template int - OutofcoreOctreeDiskContainer::read (sensor_msgs::PointCloud2::Ptr& output_cloud) + OutofcoreOctreeDiskContainer::read (pcl::PCLPointCloud2::Ptr& output_cloud) { - sensor_msgs::PointCloud2::Ptr temp_output_cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr temp_output_cloud (new pcl::PCLPointCloud2 ()); if (boost::filesystem::exists (*disk_storage_filename_)) { @@ -672,7 +672,7 @@ namespace pcl template boost::uint64_t OutofcoreOctreeDiskContainer::getDataSize () const { - sensor_msgs::PointCloud2 cloud_info; + pcl::PCLPointCloud2 cloud_info; Eigen::Vector4f origin; Eigen::Quaternionf orientation; int pcd_version; diff --git a/outofcore/include/pcl/outofcore/octree_base.h b/outofcore/include/pcl/outofcore/octree_base.h index 6e3b4a97698..64f2e7140e4 100644 --- a/outofcore/include/pcl/outofcore/octree_base.h +++ b/outofcore/include/pcl/outofcore/octree_base.h @@ -62,7 +62,7 @@ #include #include -#include +#include namespace pcl { @@ -109,7 +109,7 @@ namespace pcl * in up to eight subdirectories named from 0 to 7, where a * metadata and optionally a pcd file will exist. The PCD files * are stored in compressed binary PCD format, containing all of - * the fields existing in the PointCloud2 objects originally + * the fields existing in the PCLPointCloud2 objects originally * inserted into the out of core object. * * A brief outline of the out of core octree can be seen @@ -254,12 +254,12 @@ namespace pcl /** \brief Recursively copies points from input_cloud into the leaf nodes of the out-of-core octree, and stores them to disk. * - * \param[in] input_cloud The cloud of points to be inserted into the out-of-core octree. Note if multiple PointCloud2 objects are added to the tree, this assumes that they all have exactly the same fields. + * \param[in] input_cloud The cloud of points to be inserted into the out-of-core octree. Note if multiple PCLPointCloud2 objects are added to the tree, this assumes that they all have exactly the same fields. * \param[in] skip_bb_check (default=false) whether to skip the bounding box check on insertion. Note the bounding box check is never skipped in the current implementation. * \return Number of poitns successfully copied from the point cloud to the octree */ boost::uint64_t - addPointCloud (sensor_msgs::PointCloud2::Ptr &input_cloud, const bool skip_bb_check = false); + addPointCloud (pcl::PCLPointCloud2::Ptr &input_cloud, const bool skip_bb_check = false); /** \brief Recursively add points to the tree. * @@ -279,10 +279,10 @@ namespace pcl * octree. */ boost::uint64_t - addPointCloud_and_genLOD (sensor_msgs::PointCloud2::Ptr &input_cloud); + addPointCloud_and_genLOD (pcl::PCLPointCloud2::Ptr &input_cloud); boost::uint64_t - addPointCloud (sensor_msgs::PointCloud2::Ptr &input_cloud); + addPointCloud (pcl::PCLPointCloud2::Ptr &input_cloud); boost::uint64_t addPointCloud_and_genLOD (PointCloudConstPtr point_cloud); @@ -334,7 +334,7 @@ namespace pcl void queryBBIncludes (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const boost::uint64_t query_depth, AlignedPointTVector &dst) const; - /** \brief Query all points falling within the input bounding box at \ref query_depth and return a PointCloud2 object in \ref dst_blob. + /** \brief Query all points falling within the input bounding box at \ref query_depth and return a PCLPointCloud2 object in \ref dst_blob. * * \param[in] min The minimum corner of the input bounding box. * \param[in] max The maximum corner of the input bounding box. @@ -342,7 +342,7 @@ namespace pcl * \param[out] dst_blob Storage location for the points satisfying the query. **/ void - queryBBIncludes (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const boost::uint64_t query_depth, const sensor_msgs::PointCloud2::Ptr &dst_blob) const; + queryBBIncludes (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const boost::uint64_t query_depth, const pcl::PCLPointCloud2::Ptr &dst_blob) const; /** \brief Returns a random subsample of points within the given bounding box at \ref query_depth. * @@ -356,10 +356,10 @@ namespace pcl queryBBIncludes_subsample (const Eigen::Vector3d &min, const Eigen::Vector3d &max, uint64_t query_depth, const double percent, AlignedPointTVector &dst) const; //-------------------------------------------------------------------------------- - //PointCloud2 methods + //PCLPointCloud2 methods //-------------------------------------------------------------------------------- - /** \brief Query all points falling within the input bounding box at \ref query_depth and return a PointCloud2 object in \ref dst_blob. If the optional argument for filter is given, points are processed by that filter before returning. + /** \brief Query all points falling within the input bounding box at \ref query_depth and return a PCLPointCloud2 object in \ref dst_blob. If the optional argument for filter is given, points are processed by that filter before returning. * \param[in] min The minimum corner of the input bounding box. * \param[in] max The maximum corner of the input bounding box. * \param[in] query_depth The depth of tree at which to query; only points at this depth are returned @@ -367,7 +367,7 @@ namespace pcl * \param[in] percent optional sampling percentage which is applied after each time data are read from disk */ virtual void - queryBoundingBox (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const int query_depth, const sensor_msgs::PointCloud2::Ptr &dst_blob, double percent = 1.0); + queryBoundingBox (const Eigen::Vector3d &min, const Eigen::Vector3d &max, const int query_depth, const pcl::PCLPointCloud2::Ptr &dst_blob, double percent = 1.0); /** \brief Returns list of pcd files from nodes whose bounding boxes intersect with the input bounding box. * \param[in] min The minimum corner of the input bounding box. @@ -534,15 +534,15 @@ namespace pcl OutofcoreNodeType* getBranchChildPtr (const BranchNode& branch_arg, unsigned char childIdx_arg) const; - pcl::Filter::Ptr + pcl::Filter::Ptr getLODFilter (); - const pcl::Filter::ConstPtr + const pcl::Filter::ConstPtr getLODFilter () const; - /** \brief Sets the filter to use when building the levels of depth. Recommended filters are pcl::RandomSample or pcl::VoxelGrid */ + /** \brief Sets the filter to use when building the levels of depth. Recommended filters are pcl::RandomSample or pcl::VoxelGrid */ void - setLODFilter (const pcl::Filter::Ptr& filter_arg); + setLODFilter (const pcl::Filter::Ptr& filter_arg); /** \brief Returns the sample_percent_ used when constructing the LOD. */ double @@ -650,7 +650,7 @@ namespace pcl double sample_percent_; - pcl::RandomSample::Ptr lod_filter_ptr_; + pcl::RandomSample::Ptr lod_filter_ptr_; }; } diff --git a/outofcore/include/pcl/outofcore/octree_base_node.h b/outofcore/include/pcl/outofcore/octree_base_node.h index 0ead7f79161..14ffaedb1ef 100644 --- a/outofcore/include/pcl/outofcore/octree_base_node.h +++ b/outofcore/include/pcl/outofcore/octree_base_node.h @@ -41,7 +41,7 @@ #define PCL_OUTOFCORE_OCTREE_BASE_NODE_H_ #include -#include +#include #include #include @@ -180,7 +180,7 @@ namespace pcl * \param[out] dst_blob destion of points returned by the queries */ virtual void - queryBBIncludes (const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb, size_t query_depth, const sensor_msgs::PointCloud2::Ptr &dst_blob); + queryBBIncludes (const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb, size_t query_depth, const pcl::PCLPointCloud2::Ptr &dst_blob); /** \brief Recursively add points that fall into the queried bounding box up to the \b query_depth * @@ -193,7 +193,7 @@ namespace pcl queryBBIncludes_subsample (const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb, boost::uint64_t query_depth, const double percent, AlignedPointTVector &v); virtual void - queryBBIncludes_subsample (const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb, boost::uint64_t query_depth, const sensor_msgs::PointCloud2::Ptr& dst_blob, double percent = 1.0); + queryBBIncludes_subsample (const Eigen::Vector3d &min_bb, const Eigen::Vector3d &max_bb, boost::uint64_t query_depth, const pcl::PCLPointCloud2::Ptr& dst_blob, double percent = 1.0); /** \brief Recursive acquires PCD paths to any node with which the queried bounding box intersects (at query_depth only). */ @@ -216,17 +216,17 @@ namespace pcl virtual boost::uint64_t addDataToLeaf (const std::vector &p, const bool skip_bb_check = true); - /** \brief Add a single PointCloud2 object into the octree. + /** \brief Add a single PCLPointCloud2 object into the octree. * * \param[in] input_cloud * \param[in] skip_bb_check (default = false) */ virtual boost::uint64_t - addPointCloud (const sensor_msgs::PointCloud2::Ptr &input_cloud, const bool skip_bb_check = false); + addPointCloud (const pcl::PCLPointCloud2::Ptr &input_cloud, const bool skip_bb_check = false); - /** \brief Add a single PointCloud2 into the octree and build the subsampled LOD during construction; this method of LOD construction is not multiresolution. Rather, there are no redundant data. */ + /** \brief Add a single PCLPointCloud2 into the octree and build the subsampled LOD during construction; this method of LOD construction is not multiresolution. Rather, there are no redundant data. */ virtual boost::uint64_t - addPointCloud_and_genLOD (const sensor_msgs::PointCloud2::Ptr input_cloud); //, const bool skip_bb_check); + addPointCloud_and_genLOD (const pcl::PCLPointCloud2::Ptr input_cloud); //, const bool skip_bb_check); /** \brief Recursively add points to the leaf and children subsampling LODs * on the way down. @@ -243,7 +243,7 @@ namespace pcl writeVPythonVisual (std::ofstream &file); virtual int - read (sensor_msgs::PointCloud2::Ptr &output_cloud); + read (pcl::PCLPointCloud2::Ptr &output_cloud); virtual inline node_type_t getNodeType () const @@ -390,15 +390,15 @@ namespace pcl * bounding box it represents; otherwise only adds points that * fall within the bounding box * - * \param[in] input_cloud PointCloud2 points to attempt to add to the tree; - * \warning PointCloud2 inserted into the tree must have x,y,z fields, and must be of same type of any other points inserted in the tree + * \param[in] input_cloud PCLPointCloud2 points to attempt to add to the tree; + * \warning PCLPointCloud2 inserted into the tree must have x,y,z fields, and must be of same type of any other points inserted in the tree * \param[in] skip_bb_check (default true) if @b true, doesn't check that points * are in the proper bounding box; if @b false, only adds the * points that fall into the bounding box to this node * \return number of points successfully added */ boost::uint64_t - addDataAtMaxDepth (const sensor_msgs::PointCloud2::Ptr input_cloud, const bool skip_bb_check = true); + addDataAtMaxDepth (const pcl::PCLPointCloud2::Ptr input_cloud, const bool skip_bb_check = true); /** \brief Tests whether the input bounding box intersects with the current node's bounding box * \param[in] min_bb The minimum corner of the input bounding box @@ -517,7 +517,7 @@ namespace pcl * This could be overloaded with a parallelized implementation */ void - sortOctantIndices (const sensor_msgs::PointCloud2::Ptr &input_cloud, std::vector< std::vector > &indices, const Eigen::Vector3d &mid_xyz); + sortOctantIndices (const pcl::PCLPointCloud2::Ptr &input_cloud, std::vector< std::vector > &indices, const Eigen::Vector3d &mid_xyz); /** \brief Enlarges the shortest two sidelengths of the * bounding box to a cubic shape; operation is done in diff --git a/outofcore/include/pcl/outofcore/octree_disk_container.h b/outofcore/include/pcl/outofcore/octree_disk_container.h index a032d4bb35c..74e45d95f57 100644 --- a/outofcore/include/pcl/outofcore/octree_disk_container.h +++ b/outofcore/include/pcl/outofcore/octree_disk_container.h @@ -47,7 +47,7 @@ #include #include #include -#include +#include //allows operation on POSIX #if !defined WIN32 @@ -106,9 +106,9 @@ namespace pcl void insertRange (const AlignedPointTVector& src); - /** \brief Inserts a PointCloud2 object directly into the disk container */ + /** \brief Inserts a PCLPointCloud2 object directly into the disk container */ void - insertRange (const sensor_msgs::PointCloud2::Ptr &input_cloud); + insertRange (const pcl::PCLPointCloud2::Ptr &input_cloud); void insertRange (const PointT* const * start, const uint64_t count); @@ -136,13 +136,13 @@ namespace pcl readRange (const uint64_t start, const uint64_t count, AlignedPointTVector &dst); void - readRange (const uint64_t, const uint64_t, sensor_msgs::PointCloud2::Ptr &dst); + readRange (const uint64_t, const uint64_t, pcl::PCLPointCloud2::Ptr &dst); /** \brief Reads the entire point contents from disk into \ref output_cloud * \param[out] output_cloud */ int - read (sensor_msgs::PointCloud2::Ptr &output_cloud); + read (pcl::PCLPointCloud2::Ptr &output_cloud); /** \brief grab percent*count random points. points are \b not guaranteed to be * unique (could have multiple identical points!) diff --git a/outofcore/include/pcl/outofcore/outofcore_base_data.h b/outofcore/include/pcl/outofcore/outofcore_base_data.h index 5a8f779bac7..8c2fd70d9f1 100644 --- a/outofcore/include/pcl/outofcore/outofcore_base_data.h +++ b/outofcore/include/pcl/outofcore/outofcore_base_data.h @@ -203,7 +203,7 @@ namespace pcl std::string tree_name_; /** \brief Delineates the point types of the field; maps to JSON "pointtype":string: - * \note This is inconsistent with "point type" fields used in PointCloud2 and in other places in PCL + * \note This is inconsistent with "point type" fields used in PCLPointCloud2 and in other places in PCL */ std::string point_type_; diff --git a/outofcore/outofcore.doxy b/outofcore/outofcore.doxy index 0c8d2452c93..722c7b3d047 100644 --- a/outofcore/outofcore.doxy +++ b/outofcore/outofcore.doxy @@ -14,7 +14,7 @@ pcl_outofcore provides an interface to construct and query outofcore octrees via OutofcoreOctreeBase. The out of core octree - can be used with any PointCloud2 with point types containing ``x'', + can be used with any PCLPointCloud2 with point types containing ``x'', ``y'' and ``z'' fields. No internal checking is done to verify this. On the other hand, point clouds do not need to be filtered for NaN entries; the library will automatically ignore NaN points in the @@ -33,7 +33,7 @@ entire tree that gives direct access to the in-memory node datastructre, OutofcoreOctreeBaseNode. Please note that this library is still under development, and that interested users should - use the PointCloud2-based insertion and query methods. + use the PCLPointCloud2-based insertion and query methods. \section secOutofcore Example Usage diff --git a/outofcore/src/visualization/outofcore_cloud.cpp b/outofcore/src/visualization/outofcore_cloud.cpp index 045f6d7be07..356f5934f10 100644 --- a/outofcore/src/visualization/outofcore_cloud.cpp +++ b/outofcore/src/visualization/outofcore_cloud.cpp @@ -78,7 +78,7 @@ OutofcoreCloud::pcdReaderThread () { vtkSmartPointer cloud_data = vtkSmartPointer::New (); - sensor_msgs::PointCloud2Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2Ptr cloud (new pcl::PCLPointCloud2); pcl::io::loadPCDFile (pcd_queue_item->pcd_file, *cloud); pcl::io::pointCloudTovtkPolyData (cloud, cloud_data); diff --git a/outofcore/tools/outofcore_print.cpp b/outofcore/tools/outofcore_print.cpp index 1de050975ec..07aea68992b 100644 --- a/outofcore/tools/outofcore_print.cpp +++ b/outofcore/tools/outofcore_print.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include @@ -60,13 +60,13 @@ namespace ba = boost::accumulators; -// todo: Read clouds as PointCloud2 so we don't need to define PointT explicitly. -// This also requires our octree to take PointCloud2 as an input. +// todo: Read clouds as PCLPointCloud2 so we don't need to define PointT explicitly. +// This also requires our octree to take PCLPointCloud2 as an input. typedef pcl::PointXYZ PointT; using namespace pcl; using namespace pcl::outofcore; -using namespace sensor_msgs; +using namespace pcl; using pcl::console::parse_argument; using pcl::console::parse_file_extension_argument; diff --git a/outofcore/tools/outofcore_process.cpp b/outofcore/tools/outofcore_process.cpp index f101b1b5abc..8411f9bd46c 100644 --- a/outofcore/tools/outofcore_process.cpp +++ b/outofcore/tools/outofcore_process.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include @@ -52,13 +52,13 @@ #include #include -// todo: Read clouds as PointCloud2 so we don't need to define PointT explicitly. -// This also requires our octree to take PointCloud2 as an input. +// todo: Read clouds as PCLPointCloud2 so we don't need to define PointT explicitly. +// This also requires our octree to take PCLPointCloud2 as an input. typedef pcl::PointXYZ PointT; using namespace pcl; using namespace pcl::outofcore; -using namespace sensor_msgs; +using namespace pcl; using pcl::console::parse_argument; using pcl::console::parse_file_extension_argument; @@ -74,14 +74,14 @@ typedef OutofcoreOctreeBase<> octree_disk; const int OCTREE_DEPTH (0); const int OCTREE_RESOLUTION (1); -PointCloud2::Ptr +PCLPointCloud2::Ptr getCloudFromFile (boost::filesystem::path pcd_path) { print_info ("Reading: %s ", pcd_path.c_str ()); // Read PCD file - PointCloud2::Ptr cloud(new PointCloud2); + PCLPointCloud2::Ptr cloud(new PCLPointCloud2); if (io::loadPCDFile (pcd_path.string (), *cloud) == -1) { @@ -106,7 +106,7 @@ outofcoreProcess (std::vector pcd_paths, boost::filesys { // Get cloud - PointCloud2::Ptr cloud = getCloudFromFile (pcd_paths[i]); + PCLPointCloud2::Ptr cloud = getCloudFromFile (pcd_paths[i]); PointCloud::Ptr cloudXYZ (new PointCloud); fromROSMsg (*cloud, *cloudXYZ); @@ -183,7 +183,7 @@ outofcoreProcess (std::vector pcd_paths, boost::filesys for (size_t i = 0; i < pcd_paths.size (); i++) { - PointCloud2::Ptr cloud = getCloudFromFile (pcd_paths[i]); + PCLPointCloud2::Ptr cloud = getCloudFromFile (pcd_paths[i]); boost::uint64_t pts = 0; diff --git a/outofcore/tools/outofcore_viewer.cpp b/outofcore/tools/outofcore_viewer.cpp index 6fd2df4709d..8c289b0fa36 100644 --- a/outofcore/tools/outofcore_viewer.cpp +++ b/outofcore/tools/outofcore_viewer.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include @@ -74,7 +74,7 @@ using namespace pcl; using namespace pcl::outofcore; -using namespace sensor_msgs; +using namespace pcl; using pcl::console::parse_argument; using pcl::console::find_switch; @@ -82,7 +82,7 @@ using pcl::console::print_error; using pcl::console::print_warn; using pcl::console::print_info; -//typedef PointCloud2 PointT; +//typedef PCLPointCloud2 PointT; typedef PointXYZ PointT; typedef OutofcoreOctreeBase, PointT> octree_disk; diff --git a/recognition/src/ransac_based/obj_rec_ransac.cpp b/recognition/src/ransac_based/obj_rec_ransac.cpp index 8494ba8ecf0..2aedcdd52b0 100644 --- a/recognition/src/ransac_based/obj_rec_ransac.cpp +++ b/recognition/src/ransac_based/obj_rec_ransac.cpp @@ -334,7 +334,7 @@ pcl::recognition::ObjRecRANSAC::groupHypotheses(list& hypotheses int num_accepted = 0; #ifdef OBJ_REC_RANSAC_VERBOSE - printf("done\n testing the cluster representatives ...\n", __func__); fflush (stdout); + printf("ObjRecRANSAC::%s(): done\n testing the cluster representatives ...\n", __func__); fflush (stdout); // These are some variables needed when printing the recognition progress float progress_factor = 100.0f/static_cast (transform_space.getNumberOfOccupiedRotationSpaces ()); int num_done = 0; diff --git a/registration/include/pcl/registration/correspondence_estimation.h b/registration/include/pcl/registration/correspondence_estimation.h index 1915580bb8f..ec5422c7a9d 100644 --- a/registration/include/pcl/registration/correspondence_estimation.h +++ b/registration/include/pcl/registration/correspondence_estimation.h @@ -290,7 +290,7 @@ namespace pcl PointCloudTargetPtr input_transformed_; /** \brief The types of input point fields available. */ - std::vector input_fields_; + std::vector input_fields_; /** \brief Abstract class get name method. */ inline const std::string& diff --git a/registration/include/pcl/registration/icp.h b/registration/include/pcl/registration/icp.h index f28f9078841..baf06be07c1 100644 --- a/registration/include/pcl/registration/icp.h +++ b/registration/include/pcl/registration/icp.h @@ -178,7 +178,7 @@ namespace pcl setInputSource (const PointCloudSourceConstPtr &cloud) { Registration::setInputSource (cloud); - std::vector fields; + std::vector fields; pcl::getFields (*cloud, fields); source_has_normals_ = false; for (size_t i = 0; i < fields.size (); ++i) @@ -213,7 +213,7 @@ namespace pcl setInputTarget (const PointCloudTargetConstPtr &cloud) { Registration::setInputTarget (cloud); - std::vector fields; + std::vector fields; pcl::getFields (*cloud, fields); target_has_normals_ = false; for (size_t i = 0; i < fields.size (); ++i) diff --git a/sample_consensus/src/sac.cpp b/sample_consensus/src/sac.cpp index 85161c7d3bd..3441e73295b 100644 --- a/sample_consensus/src/sac.cpp +++ b/sample_consensus/src/sac.cpp @@ -48,13 +48,13 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(RandomSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointNormal)) - PCL_INSTANTIATE(MEstimatorSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(RandomizedMEstimatorSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(RandomizedRandomSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(ProgressiveSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(MaximumLikelihoodSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(LeastMedianSquares, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(RandomSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointNormal)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(MEstimatorSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(RandomizedMEstimatorSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(RandomizedRandomSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(ProgressiveSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(MaximumLikelihoodSampleConsensus, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(LeastMedianSquares, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(RandomSampleConsensus, PCL_XYZ_POINT_TYPES) PCL_INSTANTIATE(MEstimatorSampleConsensus, PCL_XYZ_POINT_TYPES) diff --git a/sample_consensus/src/sac_model_circle.cpp b/sample_consensus/src/sac_model_circle.cpp index 15c0fc35a1b..806d31bcb71 100644 --- a/sample_consensus/src/sac_model_circle.cpp +++ b/sample_consensus/src/sac_model_circle.cpp @@ -43,7 +43,7 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SampleConsensusModelCircle2D, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SampleConsensusModelCircle2D, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(SampleConsensusModelCircle2D, PCL_XYZ_POINT_TYPES) #endif diff --git a/sample_consensus/src/sac_model_circle3d.cpp b/sample_consensus/src/sac_model_circle3d.cpp index a90179c659d..7b1dad7ca2c 100644 --- a/sample_consensus/src/sac_model_circle3d.cpp +++ b/sample_consensus/src/sac_model_circle3d.cpp @@ -42,7 +42,7 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SampleConsensusModelCircle3D, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SampleConsensusModelCircle3D, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(SampleConsensusModelCircle3D, PCL_XYZ_POINT_TYPES) #endif diff --git a/sample_consensus/src/sac_model_line.cpp b/sample_consensus/src/sac_model_line.cpp index dab7d2cf13c..39cbe7570c7 100644 --- a/sample_consensus/src/sac_model_line.cpp +++ b/sample_consensus/src/sac_model_line.cpp @@ -44,8 +44,8 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SampleConsensusModelLine, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(SampleConsensusModelParallelLine, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SampleConsensusModelLine, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(SampleConsensusModelParallelLine, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(SampleConsensusModelLine, PCL_XYZ_POINT_TYPES) PCL_INSTANTIATE(SampleConsensusModelParallelLine, PCL_XYZ_POINT_TYPES) diff --git a/sample_consensus/src/sac_model_plane.cpp b/sample_consensus/src/sac_model_plane.cpp index 89087547bc8..311e7f1116a 100644 --- a/sample_consensus/src/sac_model_plane.cpp +++ b/sample_consensus/src/sac_model_plane.cpp @@ -45,9 +45,9 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SampleConsensusModelPlane, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(SampleConsensusModelPerpendicularPlane, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) - PCL_INSTANTIATE(SampleConsensusModelParallelPlane, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SampleConsensusModelPlane, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(SampleConsensusModelPerpendicularPlane, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) + PCL_INSTANTIATE(SampleConsensusModelParallelPlane, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(SampleConsensusModelPlane, PCL_XYZ_POINT_TYPES) PCL_INSTANTIATE(SampleConsensusModelPerpendicularPlane, PCL_XYZ_POINT_TYPES) diff --git a/sample_consensus/src/sac_model_sphere.cpp b/sample_consensus/src/sac_model_sphere.cpp index f601a3118f1..03d84652715 100644 --- a/sample_consensus/src/sac_model_sphere.cpp +++ b/sample_consensus/src/sac_model_sphere.cpp @@ -43,7 +43,7 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SampleConsensusModelSphere, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SampleConsensusModelSphere, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(SampleConsensusModelSphere, PCL_XYZ_POINT_TYPES) #endif diff --git a/sample_consensus/src/sac_model_stick.cpp b/sample_consensus/src/sac_model_stick.cpp index ce6dca330bb..0b00fba0ddd 100644 --- a/sample_consensus/src/sac_model_stick.cpp +++ b/sample_consensus/src/sac_model_stick.cpp @@ -44,7 +44,7 @@ #include // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SampleConsensusModelStick, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SampleConsensusModelStick, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) #else PCL_INSTANTIATE(SampleConsensusModelStick, PCL_XYZ_POINT_TYPES) #endif diff --git a/segmentation/include/pcl/segmentation/impl/crf_segmentation.hpp b/segmentation/include/pcl/segmentation/impl/crf_segmentation.hpp index c1f063e9988..7694b011fff 100644 --- a/segmentation/include/pcl/segmentation/impl/crf_segmentation.hpp +++ b/segmentation/include/pcl/segmentation/impl/crf_segmentation.hpp @@ -244,7 +244,7 @@ pcl::CrfSegmentation::createDataVectorFromVoxelGrid () /* // get the size of the input fields - std::vector< sensor_msgs::PointField > fields; + std::vector< pcl::PCLPointField > fields; pcl::getFields (*input_cloud_, fields); for (int i = 0; i < fields.size (); i++) @@ -255,7 +255,7 @@ pcl::CrfSegmentation::createDataVectorFromVoxelGrid () // reserve space for the data vector data_.resize (filtered_cloud_->points.size ()); - std::vector< sensor_msgs::PointField > fields; + std::vector< pcl::PCLPointField > fields; // check if we have color data bool color_data = false; int rgba_index = -1; diff --git a/segmentation/include/pcl/segmentation/impl/grabcut.hpp b/segmentation/include/pcl/segmentation/impl/grabcut.hpp index e82b5719704..26de56535b3 100644 --- a/segmentation/include/pcl/segmentation/impl/grabcut.hpp +++ b/segmentation/include/pcl/segmentation/impl/grabcut.hpp @@ -41,7 +41,7 @@ pcl::GrabCut::initCompute () return (false); } - std::vector in_fields_; + std::vector in_fields_; if ((pcl::getFieldIndex (*input_, "rgb", in_fields_) == -1) && (pcl::getFieldIndex (*input_, "rgba", in_fields_) == -1)) { diff --git a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp index c1320df5c7a..4081aadffac 100644 --- a/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp +++ b/segmentation/include/pcl/segmentation/impl/unary_classifier.hpp @@ -72,7 +72,7 @@ pcl::UnaryClassifier::setInputCloud (typename pcl::PointCloud::P input_cloud_ = input_cloud; pcl::PointCloud point; - std::vector fields; + std::vector fields; int label_index = -1; label_index = pcl::getFieldIndex (point, "label", fields); @@ -135,7 +135,7 @@ pcl::UnaryClassifier::findClusters (typename pcl::PointCloud::Pt std::vector &cluster_numbers) { // find the 'label' field index - std::vector fields; + std::vector fields; int label_idx = -1; pcl::PointCloud point; label_idx = pcl::getFieldIndex (point, "label", fields); @@ -171,7 +171,7 @@ pcl::UnaryClassifier::getCloudWithLabel (typename pcl::PointCloud fields; + std::vector fields; int label_idx = -1; pcl::PointCloud point; label_idx = pcl::getFieldIndex (point, "label", fields); diff --git a/segmentation/src/sac_segmentation.cpp b/segmentation/src/sac_segmentation.cpp index 9c2ff2b358f..39a9adb1848 100644 --- a/segmentation/src/sac_segmentation.cpp +++ b/segmentation/src/sac_segmentation.cpp @@ -44,7 +44,7 @@ // Instantiations of specific point types #ifdef PCL_ONLY_CORE_POINT_TYPES - PCL_INSTANTIATE(SACSegmentation, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)) + PCL_INSTANTIATE(SACSegmentation, (pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB)(pcl::PointXYZRGBNormal)) PCL_INSTANTIATE_PRODUCT(SACSegmentationFromNormals, ((pcl::PointXYZ)(pcl::PointXYZI)(pcl::PointXYZRGBA)(pcl::PointXYZRGB))((pcl::Normal))) #else PCL_INSTANTIATE(SACSegmentation, PCL_XYZ_POINT_TYPES) diff --git a/simulation/tools/sim_viewer.cpp b/simulation/tools/sim_viewer.cpp index 4da607d10eb..1b3d23e91ff 100644 --- a/simulation/tools/sim_viewer.cpp +++ b/simulation/tools/sim_viewer.cpp @@ -102,11 +102,11 @@ using namespace pcl::simulation; using namespace std; -typedef pcl::visualization::PointCloudColorHandler ColorHandler; +typedef pcl::visualization::PointCloudColorHandler ColorHandler; typedef ColorHandler::Ptr ColorHandlerPtr; typedef ColorHandler::ConstPtr ColorHandlerConstPtr; -typedef pcl::visualization::PointCloudGeometryHandler GeometryHandler; +typedef pcl::visualization::PointCloudGeometryHandler GeometryHandler; typedef GeometryHandler::Ptr GeometryHandlerPtr; typedef GeometryHandler::ConstPtr GeometryHandlerConstPtr; @@ -134,7 +134,7 @@ isValidFieldName (const std::string &field) } bool -isMultiDimensionalFeatureField (const sensor_msgs::PointField &field) +isMultiDimensionalFeatureField (const pcl::PCLPointField &field) { if (field.count > 1) return (true); @@ -185,7 +185,7 @@ pp_callback (const pcl::visualization::PointPickingEvent& event, void* cookie) { if (event.getPointIndex () == -1) return; - sensor_msgs::PointCloud2::Ptr cloud = *static_cast(cookie); + pcl::PCLPointCloud2::Ptr cloud = *static_cast(cookie); if (!cloud) return; @@ -825,11 +825,11 @@ main (int argc, char** argv) p->setShapeRenderingProperties (pcl::visualization::PCL_VISUALIZER_OPACITY, opaque.at (i), cloud_name.str ()); } - sensor_msgs::PointCloud2::Ptr cloud; + pcl::PCLPointCloud2::Ptr cloud; // Go through PCD files for (size_t i = 0; i < p_file_indices.size (); ++i) { - cloud.reset (new sensor_msgs::PointCloud2); + cloud.reset (new pcl::PCLPointCloud2); Eigen::Vector4f origin; Eigen::Quaternionf orientation; int version; @@ -894,15 +894,15 @@ main (int argc, char** argv) if (fcolorparam) { if (fcolor_r.size () > i && fcolor_g.size () > i && fcolor_b.size () > i) - color_handler.reset (new pcl::visualization::PointCloudColorHandlerCustom (cloud, fcolor_r[i], fcolor_g[i], fcolor_b[i])); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerCustom (cloud, fcolor_r[i], fcolor_g[i], fcolor_b[i])); else - color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); } else - color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); // Add the dataset with a XYZ and a random handler - geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ (cloud)); + geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ (cloud)); // Add the cloud to the renderer //p->addPointCloud (cloud_xyz, geometry_handler, color_handler, cloud_name.str (), viewport); p->addPointCloud (cloud, geometry_handler, color_handler, origin, orientation, cloud_name.str (), viewport); @@ -978,12 +978,12 @@ main (int argc, char** argv) for (size_t f = 0; f < cloud->fields.size (); ++f) { if (cloud->fields[f].name == "rgb" || cloud->fields[f].name == "rgba") - color_handler.reset (new pcl::visualization::PointCloudColorHandlerRGBField (cloud)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerRGBField (cloud)); else { if (!isValidFieldName (cloud->fields[f].name)) continue; - color_handler.reset (new pcl::visualization::PointCloudColorHandlerGenericField (cloud, cloud->fields[f].name)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerGenericField (cloud, cloud->fields[f].name)); } // Add the cloud to the renderer //p->addPointCloud (cloud_xyz, color_handler, cloud_name.str (), viewport); @@ -991,7 +991,7 @@ main (int argc, char** argv) } } // Additionally, add normals as a handler - geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerSurfaceNormal (cloud)); + geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerSurfaceNormal (cloud)); if (geometry_handler->isCapable ()) //p->addPointCloud (cloud_xyz, geometry_handler, cloud_name.str (), viewport); p->addPointCloud (cloud, geometry_handler, origin, orientation, cloud_name.str (), viewport); diff --git a/stereo/include/pcl/stereo/stereo_grabber.h b/stereo/include/pcl/stereo/stereo_grabber.h index 3e331f90074..0420f070438 100644 --- a/stereo/include/pcl/stereo/stereo_grabber.h +++ b/stereo/include/pcl/stereo/stereo_grabber.h @@ -122,7 +122,7 @@ namespace pcl private: virtual void - publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const = 0; + publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const = 0; // to separate and hide the implementation from interface: PIMPL struct StereoGrabberImpl; @@ -138,7 +138,7 @@ namespace pcl StereoGrabber (const std::vector >& files, float frames_per_second = 0, bool repeat = false); protected: virtual void - publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const; + publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const; boost::signals2::signal >&)>* signal_; }; @@ -161,7 +161,7 @@ namespace pcl //////////////////////////////////////////////////////////////////////////////////////////////////////////////// template void - StereoGrabber::publish (const sensor_msgs::PointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const + StereoGrabber::publish (const pcl::PCLPointCloud2& blob, const Eigen::Vector4f& origin, const Eigen::Quaternionf& orientation) const { typename pcl::PointCloud::Ptr cloud (new pcl::PointCloud ()); pcl::fromROSMsg (blob, *cloud); diff --git a/stereo/src/stereo_grabber.cpp b/stereo/src/stereo_grabber.cpp index 0800fb10d79..d4d3e274a31 100644 --- a/stereo/src/stereo_grabber.cpp +++ b/stereo/src/stereo_grabber.cpp @@ -62,7 +62,7 @@ struct pcl::StereoGrabberBase::StereoGrabberImpl std::vector >::iterator pair_iterator_; TimeTrigger time_trigger_; - sensor_msgs::PointCloud2 next_cloud_; + pcl::PCLPointCloud2 next_cloud_; Eigen::Vector4f origin_; Eigen::Quaternionf orientation_; bool valid_; diff --git a/surface/include/pcl/surface/impl/concave_hull.hpp b/surface/include/pcl/surface/impl/concave_hull.hpp index 24b558ad5f6..9ddfb213571 100644 --- a/surface/include/pcl/surface/impl/concave_hull.hpp +++ b/surface/include/pcl/surface/impl/concave_hull.hpp @@ -605,7 +605,7 @@ pcl::ConcaveHull::performReconstruction (PolygonMesh &output) pcl::PointCloud hull_points; performReconstruction (hull_points, output.polygons); - // Convert the PointCloud into a PointCloud2 + // Convert the PointCloud into a PCLPointCloud2 pcl::toROSMsg (hull_points, output.cloud); } diff --git a/surface/include/pcl/surface/impl/convex_hull.hpp b/surface/include/pcl/surface/impl/convex_hull.hpp index c1e8cf31586..5d5473ba52c 100644 --- a/surface/include/pcl/surface/impl/convex_hull.hpp +++ b/surface/include/pcl/surface/impl/convex_hull.hpp @@ -449,7 +449,7 @@ pcl::ConvexHull::performReconstruction (PolygonMesh &output) pcl::PointCloud hull_points; performReconstruction (hull_points, output.polygons, true); - // Convert the PointCloud into a PointCloud2 + // Convert the PointCloud into a PCLPointCloud2 pcl::toROSMsg (hull_points, output.cloud); } diff --git a/surface/include/pcl/surface/reconstruction.h b/surface/include/pcl/surface/reconstruction.h index 94dd032bc3e..8b3c6edbddc 100644 --- a/surface/include/pcl/surface/reconstruction.h +++ b/surface/include/pcl/surface/reconstruction.h @@ -209,7 +209,7 @@ namespace pcl * \param[out] output the resultant reconstructed surface model * * \note This method copies the input point cloud data from - * PointCloud to PointCloud2, and is implemented here for backwards + * PointCloud to PCLPointCloud2, and is implemented here for backwards * compatibility only! * */ diff --git a/test/common/test_io.cpp b/test/common/test_io.cpp index 518109057ee..975c4106bf4 100644 --- a/test/common/test_io.cpp +++ b/test/common/test_io.cpp @@ -155,7 +155,7 @@ TEST (PCL, concatenatePointCloud) cloud_xyz_rgba2.push_back (pt_xyz_rgba2); cloud_xyz_rgba2.push_back (pt_xyz_rgba2); - sensor_msgs::PointCloud2 cloud1, cloud2, cloud_out, cloud_out2, cloud_out3, cloud_out4; + pcl::PCLPointCloud2 cloud1, cloud2, cloud_out, cloud_out2, cloud_out3, cloud_out4; pcl::toROSMsg (cloud_xyz_rgba, cloud1); pcl::toROSMsg (cloud_xyz_rgba2, cloud2); diff --git a/test/features/test_brisk.cpp b/test/features/test_brisk.cpp index 72effa25f7f..b5686838714 100644 --- a/test/features/test_brisk.cpp +++ b/test/features/test_brisk.cpp @@ -60,6 +60,7 @@ PointCloud::Ptr cloud_descriptors_gt (new PointCloud brisk_keypoint_estimation; brisk_keypoint_estimation.setThreshold (60); @@ -118,6 +119,9 @@ TEST (PCL, BRISK_2D) EXPECT_NEAR (0.0f, sqr_dist, 1e-4); } +#else + PCL_WARN ("Not compiled with SSE4.1, skipping test of Brisk.\n"); +#endif } diff --git a/test/filters/test_filters.cpp b/test/filters/test_filters.cpp index 43a8c4e1392..1d527b55a2c 100644 --- a/test/filters/test_filters.cpp +++ b/test/filters/test_filters.cpp @@ -66,11 +66,11 @@ using namespace pcl; using namespace pcl::io; using namespace std; -using namespace sensor_msgs; +using namespace pcl; using namespace Eigen; -PointCloud2::Ptr cloud_blob (new PointCloud2); +PCLPointCloud2::Ptr cloud_blob (new PCLPointCloud2); PointCloud::Ptr cloud (new PointCloud); vector indices_; @@ -147,10 +147,10 @@ TEST (ExtractIndices, Filters) EXPECT_EQ (cloud->points[cloud->points.size () - 2].y, output.points[output.points.size () - 1].y); EXPECT_EQ (cloud->points[cloud->points.size () - 2].z, output.points[output.points.size () - 1].z); - // Test the sensor_msgs::PointCloud2 method - ExtractIndices ei2; + // Test the pcl::PCLPointCloud2 method + ExtractIndices ei2; - PointCloud2 output_blob; + PCLPointCloud2 output_blob; ei2.setInputCloud (cloud_blob); ei2.setIndices (indices); ei2.filter (output_blob); @@ -381,10 +381,10 @@ TEST (PassThrough, Filters) EXPECT_NEAR (output.points[41].y, cloud->points[41].y, 1e-5); EXPECT_NEAR (output.points[41].z, cloud->points[41].z, 1e-5); - // Test the PointCloud2 method - PassThrough pt2; + // Test the PCLPointCloud2 method + PassThrough pt2; - PointCloud2 output_blob; + PCLPointCloud2 output_blob; pt2.setInputCloud (cloud_blob); pt2.filter (output_blob); @@ -431,7 +431,7 @@ TEST (PassThrough, Filters) EXPECT_NEAR (output.points[354].y, 0.17516, 1e-5); EXPECT_NEAR (output.points[354].z, -0.0444, 1e-5); - PassThrough pt2_(true); + PassThrough pt2_(true); pt2_.setInputCloud (cloud_blob); pt2_.filter (output_blob); @@ -608,10 +608,10 @@ TEST (VoxelGrid, Filters) EXPECT_LE (fabs (output.points[neighbors.at (0)].y - output.points[centroidIdx].y), 0.02); EXPECT_LE ( output.points[neighbors.at (0)].z - output.points[centroidIdx].z, 0.02 * 2); - // Test the sensor_msgs::PointCloud2 method - VoxelGrid grid2; + // Test the pcl::PCLPointCloud2 method + VoxelGrid grid2; - PointCloud2 output_blob; + PCLPointCloud2 output_blob; grid2.setLeafSize (0.02f, 0.02f, 0.02f); grid2.setInputCloud (cloud_blob); @@ -694,8 +694,8 @@ TEST (VoxelGrid, Filters) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TEST (VoxelGrid_RGB, Filters) { - PointCloud2 cloud_rgb_blob_; - PointCloud2::Ptr cloud_rgb_blob_ptr_; + PCLPointCloud2 cloud_rgb_blob_; + PCLPointCloud2::Ptr cloud_rgb_blob_ptr_; PointCloud cloud_rgb_; PointCloud::Ptr cloud_rgb_ptr_; @@ -727,7 +727,7 @@ TEST (VoxelGrid_RGB, Filters) } toROSMsg (cloud_rgb_, cloud_rgb_blob_); - cloud_rgb_blob_ptr_.reset (new PointCloud2 (cloud_rgb_blob_)); + cloud_rgb_blob_ptr_.reset (new PCLPointCloud2 (cloud_rgb_blob_)); cloud_rgb_ptr_.reset (new PointCloud (cloud_rgb_)); PointCloud output_rgb; @@ -754,8 +754,8 @@ TEST (VoxelGrid_RGB, Filters) EXPECT_NEAR (b, ave_b, 1.0); } - VoxelGrid grid2; - PointCloud2 output_rgb_blob; + VoxelGrid grid2; + PCLPointCloud2 output_rgb_blob; grid2.setLeafSize (0.03f, 0.03f, 0.03f); grid2.setInputCloud (cloud_rgb_blob_ptr_); @@ -791,8 +791,8 @@ float getRandomNumber (float max = 1.0, float min = 0.0) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TEST (VoxelGrid_XYZNormal, Filters) { - PointCloud2 cloud_blob_; - PointCloud2::Ptr cloud_blob_ptr_; + PCLPointCloud2 cloud_blob_; + PCLPointCloud2::Ptr cloud_blob_ptr_; PointCloud::Ptr input (new PointCloud); PointCloud output; @@ -935,10 +935,10 @@ TEST (VoxelGrid_XYZNormal, Filters) } toROSMsg (*input, cloud_blob_); - cloud_blob_ptr_.reset (new PointCloud2 (cloud_blob_)); + cloud_blob_ptr_.reset (new PCLPointCloud2 (cloud_blob_)); - VoxelGrid grid2; - PointCloud2 output_blob; + VoxelGrid grid2; + PCLPointCloud2 output_blob; grid2.setLeafSize (1.0f, 1.0f, 1.0f); grid2.setFilterLimits (0.0f, 2.0f); @@ -1077,10 +1077,10 @@ TEST (ProjectInliers, Filters) for (size_t i = 0; i < output.points.size (); ++i) EXPECT_NEAR (output.points[i].z, 0.0, 1e-4); - // Test the sensor_msgs::PointCloud2 method - ProjectInliers proj2; + // Test the pcl::PCLPointCloud2 method + ProjectInliers proj2; - PointCloud2 output_blob; + PCLPointCloud2 output_blob; proj2.setModelType (SACMODEL_PLANE); proj2.setInputCloud (cloud_blob); @@ -1112,9 +1112,9 @@ TEST (RadiusOutlierRemoval, Filters) EXPECT_NEAR (cloud_out.points[cloud_out.points.size () - 1].y, 0.16039, 1e-4); EXPECT_NEAR (cloud_out.points[cloud_out.points.size () - 1].z, -0.021299, 1e-4); - // Test the sensor_msgs::PointCloud2 method - PointCloud2 cloud_out2; - RadiusOutlierRemoval outrem2; + // Test the pcl::PCLPointCloud2 method + PCLPointCloud2 cloud_out2; + RadiusOutlierRemoval outrem2; outrem2.setInputCloud (cloud_blob); outrem2.setRadiusSearch (0.02); outrem2.setMinNeighborsInRadius (15); @@ -1144,8 +1144,8 @@ TEST (RadiusOutlierRemoval, Filters) EXPECT_NEAR (cloud_out.points[cloud_out.points.size () - 1].y, 0.16039, 1e-4); EXPECT_NEAR (cloud_out.points[cloud_out.points.size () - 1].z, -0.021299, 1e-4); - // Test the sensor_msgs::PointCloud2 method - RadiusOutlierRemoval outrem2_(true); + // Test the pcl::PCLPointCloud2 method + RadiusOutlierRemoval outrem2_(true); outrem2_.setInputCloud (cloud_blob); outrem2_.setRadiusSearch (0.02); outrem2_.setMinNeighborsInRadius (15); @@ -1337,15 +1337,15 @@ TEST (CropBox, Filters) cropBoxFilter.filter (indices); EXPECT_EQ (int (indices.size ()), 9); - // PointCloud2 + // PCLPointCloud2 // ------------------------------------------------------------------------- // Create cloud with center point and corner points - PointCloud2::Ptr input2 (new PointCloud2); + PCLPointCloud2::Ptr input2 (new PCLPointCloud2); pcl::toROSMsg (*input, *input2); // Test the PointCloud method - CropBox cropBoxFilter2(true); + CropBox cropBoxFilter2(true); cropBoxFilter2.setInputCloud (input2); // Cropbox slighlty bigger then bounding box of points @@ -1357,7 +1357,7 @@ TEST (CropBox, Filters) cropBoxFilter2.filter (indices2); // Cloud - PointCloud2 cloud_out2; + PCLPointCloud2 cloud_out2; cropBoxFilter2.filter (cloud_out2); // Should contain all @@ -1369,7 +1369,7 @@ TEST (CropBox, Filters) EXPECT_EQ (int (removed_indices2->size ()), 0); // Test setNegative - PointCloud2 cloud_out2_negative; + PCLPointCloud2 cloud_out2_negative; cropBoxFilter2.setNegative (true); cropBoxFilter2.filter (cloud_out2_negative); EXPECT_EQ (int (cloud_out2_negative.width), 0); @@ -1506,9 +1506,9 @@ TEST (StatisticalOutlierRemoval, Filters) EXPECT_NEAR (output.points[output.points.size () - 1].y, 0.17516, 1e-4); EXPECT_NEAR (output.points[output.points.size () - 1].z, -0.0444, 1e-4); - // Test the sensor_msgs::PointCloud2 method - PointCloud2 output2; - StatisticalOutlierRemoval outrem2; + // Test the pcl::PCLPointCloud2 method + PCLPointCloud2 output2; + StatisticalOutlierRemoval outrem2; outrem2.setInputCloud (cloud_blob); outrem2.setMeanK (50); outrem2.setStddevMulThresh (1.0); @@ -1561,8 +1561,8 @@ TEST (StatisticalOutlierRemoval, Filters) EXPECT_NEAR (output.points[output.points.size () - 1].y, 0.17516, 1e-4); EXPECT_NEAR (output.points[output.points.size () - 1].z, -0.0444, 1e-4); - // Test the sensor_msgs::PointCloud2 method - StatisticalOutlierRemoval outrem2_(true); + // Test the pcl::PCLPointCloud2 method + StatisticalOutlierRemoval outrem2_(true); outrem2_.setInputCloud (cloud_blob); outrem2_.setMeanK (50); outrem2_.setStddevMulThresh (1.0); diff --git a/test/filters/test_sampling.cpp b/test/filters/test_sampling.cpp index d61269c49d5..2fb196a784f 100644 --- a/test/filters/test_sampling.cpp +++ b/test/filters/test_sampling.cpp @@ -196,11 +196,11 @@ TEST (RandomSample, Filters) removed = sample.getRemovedIndices (); EXPECT_TRUE (removed->empty ()); - // Test the sensor_msgs::PointCloud2 method + // Test the pcl::PCLPointCloud2 method // Randomly sample 10 points from cloud - sensor_msgs::PointCloud2::Ptr cloud_blob (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud_blob (new pcl::PCLPointCloud2 ()); toROSMsg (*cloud_walls, *cloud_blob); - RandomSample sample2; + RandomSample sample2; sample2.setInputCloud (cloud_blob); sample2.setSample (10); @@ -211,7 +211,7 @@ TEST (RandomSample, Filters) EXPECT_EQ (int (indices2.size ()), 10); // Cloud - sensor_msgs::PointCloud2 output_blob; + pcl::PCLPointCloud2 output_blob; sample2.filter (output_blob); fromROSMsg (output_blob, cloud_out); diff --git a/test/io/test_io.cpp b/test/io/test_io.cpp index 5a96e252af5..04f31ee9f31 100644 --- a/test/io/test_io.cpp +++ b/test/io/test_io.cpp @@ -38,7 +38,7 @@ */ #include -#include +#include #include #include #include @@ -72,7 +72,7 @@ TEST (PCL, ComplexPCDFileASCII) "0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 -69.234001 -65.460999 19.173"; fs.close (); - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; int res = loadPCDFile ("complex_ascii.pcd", blob); EXPECT_NE (int (res), -1); EXPECT_EQ (blob.width, 1); @@ -84,27 +84,27 @@ TEST (PCL, ComplexPCDFileASCII) EXPECT_EQ (blob.fields[0].name, "fpfh"); EXPECT_EQ (blob.fields[0].offset, 0); EXPECT_EQ (blob.fields[0].count, 33); - EXPECT_EQ (blob.fields[0].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (blob.fields[0].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (blob.fields[1].name, "_"); EXPECT_EQ (blob.fields[1].offset, 4 * 33); EXPECT_EQ (blob.fields[1].count, 10); - EXPECT_EQ (blob.fields[1].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (blob.fields[1].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (blob.fields[2].name, "x"); EXPECT_EQ (blob.fields[2].offset, 4 * 33 + 10 * 1); EXPECT_EQ (blob.fields[2].count, 1); - EXPECT_EQ (blob.fields[2].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (blob.fields[2].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (blob.fields[3].name, "y"); EXPECT_EQ (blob.fields[3].offset, 4 * 33 + 10 * 1 + 4); EXPECT_EQ (blob.fields[3].count, 1); - EXPECT_EQ (blob.fields[3].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (blob.fields[3].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (blob.fields[4].name, "z"); EXPECT_EQ (blob.fields[4].offset, 4 * 33 + 10 * 1 + 4 + 4); EXPECT_EQ (blob.fields[4].count, 1); - EXPECT_EQ (blob.fields[4].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (blob.fields[4].datatype, pcl::PCLPointField::FLOAT32); int x_idx = pcl::getFieldIndex (blob, "x"); EXPECT_EQ (x_idx, 2); @@ -176,7 +176,7 @@ TEST (PCL, AllTypesPCDFile) "-50 250 251 -250 2500 2501 -250000 250000 250001 250.05 -250.05 -251.05"; fs.close (); - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; int res = loadPCDFile ("all_types.pcd", blob); EXPECT_NE (int (res), -1); EXPECT_EQ (blob.width, 1); @@ -213,14 +213,14 @@ TEST (PCL, AllTypesPCDFile) EXPECT_EQ (blob.fields[6].count, 1); EXPECT_EQ (blob.fields[7].count, 2); - EXPECT_EQ (blob.fields[0].datatype, sensor_msgs::PointField::INT8); - EXPECT_EQ (blob.fields[1].datatype, sensor_msgs::PointField::UINT8); - EXPECT_EQ (blob.fields[2].datatype, sensor_msgs::PointField::INT16); - EXPECT_EQ (blob.fields[3].datatype, sensor_msgs::PointField::UINT16); - EXPECT_EQ (blob.fields[4].datatype, sensor_msgs::PointField::INT32); - EXPECT_EQ (blob.fields[5].datatype, sensor_msgs::PointField::UINT32); - EXPECT_EQ (blob.fields[6].datatype, sensor_msgs::PointField::FLOAT32); - EXPECT_EQ (blob.fields[7].datatype, sensor_msgs::PointField::FLOAT64); + EXPECT_EQ (blob.fields[0].datatype, pcl::PCLPointField::INT8); + EXPECT_EQ (blob.fields[1].datatype, pcl::PCLPointField::UINT8); + EXPECT_EQ (blob.fields[2].datatype, pcl::PCLPointField::INT16); + EXPECT_EQ (blob.fields[3].datatype, pcl::PCLPointField::UINT16); + EXPECT_EQ (blob.fields[4].datatype, pcl::PCLPointField::INT32); + EXPECT_EQ (blob.fields[5].datatype, pcl::PCLPointField::UINT32); + EXPECT_EQ (blob.fields[6].datatype, pcl::PCLPointField::FLOAT32); + EXPECT_EQ (blob.fields[7].datatype, pcl::PCLPointField::FLOAT64); int8_t b1; uint8_t b2; @@ -349,7 +349,7 @@ TEST (PCL, ConcatenateFields) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TEST (PCL, IO) { - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; PointCloud cloud; cloud.width = 640; @@ -382,35 +382,35 @@ TEST (PCL, IO) EXPECT_FLOAT_EQ (last.intensity, static_cast (nr_p - 1)); // Test getFieldIndex - std::vector fields; + std::vector fields; pcl::getFields (cloud, fields); EXPECT_EQ (fields.size (), size_t (4)); int x_idx = pcl::getFieldIndex (cloud, "x", fields); EXPECT_EQ (x_idx, 0); EXPECT_EQ (fields[x_idx].offset, uint32_t (0)); EXPECT_EQ (fields[x_idx].name, "x"); - EXPECT_EQ (fields[x_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (fields[x_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (fields[x_idx].count, uint32_t (1)); int y_idx = pcl::getFieldIndex (cloud, "y", fields); EXPECT_EQ (y_idx, 1); EXPECT_EQ (fields[y_idx].offset, uint32_t (4)); EXPECT_EQ (fields[y_idx].name, "y"); - EXPECT_EQ (fields[y_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (fields[y_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (fields[y_idx].count, uint32_t (1)); int z_idx = pcl::getFieldIndex (cloud, "z", fields); EXPECT_EQ (z_idx, 2); EXPECT_EQ (fields[z_idx].offset, uint32_t (8)); EXPECT_EQ (fields[z_idx].name, "z"); - EXPECT_EQ (fields[z_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (fields[z_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (fields[z_idx].count, uint32_t (1)); int intensity_idx = pcl::getFieldIndex (cloud, "intensity", fields); EXPECT_EQ (intensity_idx, 3); EXPECT_EQ (fields[intensity_idx].offset, uint32_t (16)); // NOTE: intensity_idx.offset should be 12, but we are padding in PointXYZ (!) EXPECT_EQ (fields[intensity_idx].name, "intensity"); - EXPECT_EQ (fields[intensity_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (fields[intensity_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (fields[intensity_idx].count, uint32_t (1)); // Convert from data type to blob @@ -421,26 +421,26 @@ TEST (PCL, IO) EXPECT_EQ (x_idx, 0); EXPECT_EQ (cloud_blob.fields[x_idx].offset, uint32_t (0)); EXPECT_EQ (cloud_blob.fields[x_idx].name, "x"); - EXPECT_EQ (cloud_blob.fields[x_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (cloud_blob.fields[x_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (cloud_blob.fields[x_idx].count, uint32_t (1)); y_idx = pcl::getFieldIndex (cloud_blob, "y"); EXPECT_EQ (y_idx, 1); EXPECT_EQ (cloud_blob.fields[y_idx].offset, uint32_t (4)); EXPECT_EQ (cloud_blob.fields[y_idx].name, "y"); - EXPECT_EQ (cloud_blob.fields[y_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (cloud_blob.fields[y_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (cloud_blob.fields[y_idx].count, uint32_t (1)); z_idx = pcl::getFieldIndex (cloud_blob, "z"); EXPECT_EQ (z_idx, 2); EXPECT_EQ (cloud_blob.fields[z_idx].offset, uint32_t (8)); EXPECT_EQ (cloud_blob.fields[z_idx].name, "z"); - EXPECT_EQ (cloud_blob.fields[z_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (cloud_blob.fields[z_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (cloud_blob.fields[z_idx].count, uint32_t (1)); intensity_idx = pcl::getFieldIndex (cloud_blob, "intensity"); EXPECT_EQ (intensity_idx, 3); //EXPECT_EQ (cloud_blob.fields[intensity_idx].offset, (uint32_t)12); // NOTE: the fields.offset is 16 in PointCloud, but we are obtaining the correct offset in toROSMsg EXPECT_EQ (cloud_blob.fields[intensity_idx].offset, uint32_t (16)); // NOTE: the fields.offset is 16 in PointCloud, but we are obtaining the correct offset in toROSMsg EXPECT_EQ (cloud_blob.fields[intensity_idx].name, "intensity"); - EXPECT_EQ (cloud_blob.fields[intensity_idx].datatype, sensor_msgs::PointField::FLOAT32); + EXPECT_EQ (cloud_blob.fields[intensity_idx].datatype, pcl::PCLPointField::FLOAT32); EXPECT_EQ (cloud_blob.fields[intensity_idx].count, uint32_t (1)); fromROSMsg (cloud_blob, cloud); @@ -656,7 +656,7 @@ TEST (PCL, IO) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TEST (PCL, PCDReaderWriter) { - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; PointCloud cloud; cloud.width = 640; @@ -808,7 +808,7 @@ TEST (PCL, ASCIIReader) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TEST (PCL, PLYReaderWriter) { - sensor_msgs::PointCloud2 cloud_blob, cloud_blob2; + pcl::PCLPointCloud2 cloud_blob, cloud_blob2; PointCloud cloud, cloud2; cloud.width = 640; @@ -927,7 +927,7 @@ TEST (PCL, EigenConversions) for (int i = 0; i < int (cloud.points.size ()); ++i) cloud.points[i].x = cloud.points[i].y = cloud.points[i].z = static_cast (i); - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; toROSMsg (cloud, blob); Eigen::MatrixXf mat; @@ -1044,7 +1044,7 @@ TEST (PCL, LZF) ASSERT_EQ (cloud2.points[i].z, cloud.points[i].z); } - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::toROSMsg (cloud, blob); res = writer.writeBinaryCompressed ("test_pcl_io_compressed.pcd", blob); EXPECT_EQ (res, 0); @@ -1087,7 +1087,7 @@ TEST (PCL, LZFExtended) cloud.points[i].rgb = static_cast (1024 * rand () / (RAND_MAX + 1.0)); } - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::toROSMsg (cloud, blob); PCDWriter writer; diff --git a/test/io/test_iterators.cpp b/test/io/test_iterators.cpp index 4f2ed956129..3d053efd356 100644 --- a/test/io/test_iterators.cpp +++ b/test/io/test_iterators.cpp @@ -38,7 +38,7 @@ #include -#include +#include #include #include #include diff --git a/test/io/test_ply_mesh_io.cpp b/test/io/test_ply_mesh_io.cpp index 1cad65993e5..51debec3684 100644 --- a/test/io/test_ply_mesh_io.cpp +++ b/test/io/test_ply_mesh_io.cpp @@ -39,7 +39,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/octree/CMakeLists.txt b/test/octree/CMakeLists.txt index 50174f7b159..e1c3ab8c2cb 100644 --- a/test/octree/CMakeLists.txt +++ b/test/octree/CMakeLists.txt @@ -1,4 +1,4 @@ PCL_ADD_TEST(a_octree_test test_octree FILES test_octree.cpp LINK_WITH pcl_gtest pcl_common) -link_ros_libs (test_octree) + #link_ros_libs (test_octree) diff --git a/test/outofcore/test_outofcore.cpp b/test/outofcore/test_outofcore.cpp index 3d887ca6136..0a3580399fd 100644 --- a/test/outofcore/test_outofcore.cpp +++ b/test/outofcore/test_outofcore.cpp @@ -60,7 +60,7 @@ using namespace pcl; #include #include -#include +#include using namespace pcl::outofcore; @@ -588,7 +588,7 @@ TEST_F (OutofcoreTest, Outofcore_PointCloud2Basic) const double min[3] = { -1.0, -1.0, -1.0 }; const double max[3] = { 1.0, 1.0, 1.0 }; - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2 ()); } */ @@ -732,7 +732,7 @@ TEST_F (OutofcoreTest, PointCloud2_Constructors) test_cloud->points.push_back (tmp); } - boost::shared_ptr point_cloud (new sensor_msgs::PointCloud2 ()); + boost::shared_ptr point_cloud (new pcl::PCLPointCloud2 ()); pcl::toROSMsg (*test_cloud, *point_cloud); @@ -761,7 +761,7 @@ TEST_F (OutofcoreTest, PointCloud2_Insertion) point_cloud.points.push_back (PointT (static_cast(rand () % 10), static_cast(rand () % 10), static_cast(rand () % 10))); - sensor_msgs::PointCloud2::Ptr input_cloud (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr input_cloud (new pcl::PCLPointCloud2 ()); toROSMsg (point_cloud, *input_cloud); ASSERT_EQ (point_cloud.width*point_cloud.height, input_cloud->width*input_cloud->height); @@ -815,8 +815,8 @@ TEST_F (OutofcoreTest, PointCloud2_MultiplePointCloud) second_cloud->points.push_back (tmp); } - sensor_msgs::PointCloud2::Ptr first_cloud_ptr (new sensor_msgs::PointCloud2 ()); - sensor_msgs::PointCloud2::Ptr second_cloud_ptr (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr first_cloud_ptr (new pcl::PCLPointCloud2 ()); + pcl::PCLPointCloud2::Ptr second_cloud_ptr (new pcl::PCLPointCloud2 ()); toROSMsg (*first_cloud, *first_cloud_ptr); toROSMsg (*second_cloud, *second_cloud_ptr); @@ -827,7 +827,7 @@ TEST_F (OutofcoreTest, PointCloud2_MultiplePointCloud) shallow_outofcore.addPointCloud (first_cloud); shallow_outofcore.addPointCloud (second_cloud); - sensor_msgs::PointCloud2::Ptr result (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr result (new pcl::PCLPointCloud2 ()); shallow_outofcore.queryBBIncludes (min, max, 0, result); size_t num_points_queried = result->width*result->height; @@ -863,7 +863,7 @@ TEST_F (OutofcoreTest, PointCloud2_QueryBoundingBox) test_cloud->points.push_back (tmp); } - sensor_msgs::PointCloud2::Ptr dst_blob (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr dst_blob (new pcl::PCLPointCloud2 ()); pcl::toROSMsg (*test_cloud, *dst_blob); @@ -873,7 +873,7 @@ TEST_F (OutofcoreTest, PointCloud2_QueryBoundingBox) uint64_t points_added = octreeA.addPointCloud (dst_blob, false); EXPECT_EQ (points_added, dst_blob->width*dst_blob->height); - sensor_msgs::PointCloud2::Ptr dst_blob2 (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr dst_blob2 (new pcl::PCLPointCloud2 ()); octreeA.queryBoundingBox (min, max, 2, dst_blob2); std::list filenames; @@ -886,7 +886,7 @@ TEST_F (OutofcoreTest, PointCloud2_QueryBoundingBox) } -//test that the PointCloud2 query returns the same points as the templated queries +//test that the PCLPointCloud2 query returns the same points as the templated queries TEST_F (OutofcoreTest, PointCloud2_Query) { @@ -915,7 +915,7 @@ TEST_F (OutofcoreTest, PointCloud2_Query) test_cloud->points.push_back (tmp); } - sensor_msgs::PointCloud2::Ptr dst_blob (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr dst_blob (new pcl::PCLPointCloud2 ()); pcl::toROSMsg (*test_cloud, *dst_blob); @@ -928,12 +928,12 @@ TEST_F (OutofcoreTest, PointCloud2_Query) ASSERT_EQ (points_added, dst_blob->width*dst_blob->height) << "Number of points returned by addPointCloud does not match the number of poitns in the input point cloud\n"; ASSERT_EQ (LOD_points_added, dst_blob->width*dst_blob->height) << "Number of points returned by addPointCloud_and_genLOD does not match the number of points in the input point cloud\n"; - sensor_msgs::PointCloud2::Ptr query_result_a (new sensor_msgs::PointCloud2 ()); - sensor_msgs::PointCloud2::Ptr query_result_b (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr query_result_a (new pcl::PCLPointCloud2 ()); + pcl::PCLPointCloud2::Ptr query_result_b (new pcl::PCLPointCloud2 ()); octreeA.queryBBIncludes (min, max, int (octreeA.getDepth ()), query_result_a); - EXPECT_EQ (test_cloud->width*test_cloud->height, query_result_a->width*query_result_a->height) << "PointCloud2 Query number of points returned failed\n"; + EXPECT_EQ (test_cloud->width*test_cloud->height, query_result_a->width*query_result_a->height) << "PCLPointCloud2 Query number of points returned failed\n"; uint64_t total_octreeB_LOD_query = 0; @@ -946,7 +946,7 @@ TEST_F (OutofcoreTest, PointCloud2_Query) query_result_b->height =0; } - EXPECT_EQ (test_cloud->width*test_cloud->height, total_octreeB_LOD_query) << "PointCloud2 Query number of points returned failed\n"; + EXPECT_EQ (test_cloud->width*test_cloud->height, total_octreeB_LOD_query) << "PCLPointCloud2 Query number of points returned failed\n"; cleanUpFilesystem (); } diff --git a/test/surface/test_concave_hull.cpp b/test/surface/test_concave_hull.cpp index bc2913c21b8..79791f5ce2f 100644 --- a/test/surface/test_concave_hull.cpp +++ b/test/surface/test_concave_hull.cpp @@ -288,7 +288,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -315,7 +315,7 @@ main (int argc, char** argv) // Process for update cloud if (argc == 3) { - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_convex_hull.cpp b/test/surface/test_convex_hull.cpp index 4a8e11968d8..354202680d6 100644 --- a/test/surface/test_convex_hull.cpp +++ b/test/surface/test_convex_hull.cpp @@ -119,7 +119,7 @@ TEST (PCL, ConvexHull_bunny) PolygonMesh mesh; chull.reconstruct (mesh); - // convert the internal PointCloud2 to a PointCloud + // convert the internal PCLPointCloud2 to a PointCloud PointCloud hull2; pcl::fromROSMsg (mesh.cloud, hull2); @@ -281,7 +281,7 @@ TEST (PCL, ConvexHull_LTable) PolygonMesh mesh; chull.reconstruct (mesh); - // convert the internal PointCloud2 to a PointCloud + // convert the internal PCLPointCloud2 to a PointCloud PointCloud hull2; pcl::fromROSMsg (mesh.cloud, hull2); @@ -495,7 +495,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -522,7 +522,7 @@ main (int argc, char** argv) // Process for update cloud if (argc == 3) { - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_ear_clipping.cpp b/test/surface/test_ear_clipping.cpp index 9fd1cb38f2d..ffb079d38cc 100644 --- a/test/surface/test_ear_clipping.cpp +++ b/test/surface/test_ear_clipping.cpp @@ -117,7 +117,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -143,7 +143,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_gp3.cpp b/test/surface/test_gp3.cpp index be135501d4a..02ba8337ee6 100644 --- a/test/surface/test_gp3.cpp +++ b/test/surface/test_gp3.cpp @@ -250,7 +250,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -276,7 +276,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_grid_projection.cpp b/test/surface/test_grid_projection.cpp index 2aa8cf15ab1..c3a79e87b3f 100644 --- a/test/surface/test_grid_projection.cpp +++ b/test/surface/test_grid_projection.cpp @@ -94,7 +94,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -120,7 +120,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_marching_cubes.cpp b/test/surface/test_marching_cubes.cpp index 83bd541f9c7..6c50eb99730 100644 --- a/test/surface/test_marching_cubes.cpp +++ b/test/surface/test_marching_cubes.cpp @@ -112,7 +112,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -138,7 +138,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_moving_least_squares.cpp b/test/surface/test_moving_least_squares.cpp index 37f24279b83..718bad2656f 100644 --- a/test/surface/test_moving_least_squares.cpp +++ b/test/surface/test_moving_least_squares.cpp @@ -184,7 +184,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -210,7 +210,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_organized_fast_mesh.cpp b/test/surface/test_organized_fast_mesh.cpp index 2ae119767de..0432f5001e5 100644 --- a/test/surface/test_organized_fast_mesh.cpp +++ b/test/surface/test_organized_fast_mesh.cpp @@ -121,7 +121,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -147,7 +147,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/surface/test_poisson.cpp b/test/surface/test_poisson.cpp index 7dc96e6e109..c2b4063677e 100644 --- a/test/surface/test_poisson.cpp +++ b/test/surface/test_poisson.cpp @@ -101,7 +101,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -127,7 +127,7 @@ main (int argc, char** argv) // Process for update cloud if(argc == 3){ - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/test/test_sample_consensus.cpp b/test/test_sample_consensus.cpp index 5314cff9b1b..94a6b970538 100644 --- a/test/test_sample_consensus.cpp +++ b/test/test_sample_consensus.cpp @@ -948,7 +948,7 @@ int } // Load a standard PCD file from disk - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; if (loadPCDFile (argv[1], cloud_blob) < 0) { std::cerr << "Failed to read test file. Please download `sac_plane_test.pcd` and pass its path to the test." << std::endl; diff --git a/test/test_transforms.cpp b/test/test_transforms.cpp index 25c8abf4999..2c199007425 100644 --- a/test/test_transforms.cpp +++ b/test/test_transforms.cpp @@ -37,7 +37,7 @@ #include // For debug -#include +#include #include #include #include @@ -53,7 +53,7 @@ const float PI = 3.14159265f; const float rho = sqrtf (2.0f) / 2.0f; // cos(PI/4) == sin(PI/4) PointCloud cloud; -sensor_msgs::PointCloud2 cloud_blob; +pcl::PCLPointCloud2 cloud_blob; void init () diff --git a/test/test_visualization.cpp b/test/test_visualization.cpp index fc83d5984af..4448cb898c4 100644 --- a/test/test_visualization.cpp +++ b/test/test_visualization.cpp @@ -124,7 +124,7 @@ main (int argc, char** argv) } // Load file - sensor_msgs::PointCloud2 cloud_blob; + pcl::PCLPointCloud2 cloud_blob; loadPCDFile (argv[1], cloud_blob); fromROSMsg (cloud_blob, *cloud); @@ -151,7 +151,7 @@ main (int argc, char** argv) // Process for update cloud if (argc == 3) { - sensor_msgs::PointCloud2 cloud_blob1; + pcl::PCLPointCloud2 cloud_blob1; loadPCDFile (argv[2], cloud_blob1); fromROSMsg (cloud_blob1, *cloud1); // Create search tree diff --git a/tools/add_gaussian_noise.cpp b/tools/add_gaussian_noise.cpp index 9a53ea8f311..2df44d2a232 100644 --- a/tools/add_gaussian_noise.cpp +++ b/tools/add_gaussian_noise.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -59,7 +59,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -74,7 +74,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, double standard_deviation) { TicToc tt; @@ -103,7 +103,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou xyz_cloud_filtered->points[point_i].z = xyz_cloud->points[point_i].z + static_cast (var_nor ()); } - sensor_msgs::PointCloud2 input_xyz_filtered; + pcl::PCLPointCloud2 input_xyz_filtered; toROSMsg (*xyz_cloud_filtered, input_xyz_filtered); concatenateFields (*input, input_xyz_filtered, output); @@ -111,7 +111,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -149,12 +149,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-sd", standard_deviation); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Add the noise - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, standard_deviation); // Save into the second file diff --git a/tools/bilateral_upsampling.cpp b/tools/bilateral_upsampling.cpp index ff6a15c1c1f..24215d24c31 100644 --- a/tools/bilateral_upsampling.cpp +++ b/tools/bilateral_upsampling.cpp @@ -38,7 +38,7 @@ */ -#include +#include #include #include #include @@ -70,7 +70,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -85,7 +85,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, int window_size, double sigma_color, double sigma_depth) { PointCloud::Ptr cloud (new pcl::PointCloud ()); @@ -112,7 +112,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -156,12 +156,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-sigma_depth", sigma_depth); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Do the smoothing - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, window_size, sigma_color, sigma_depth); // Save into the second file diff --git a/tools/boundary_estimation.cpp b/tools/boundary_estimation.cpp index ff87b1d3647..879236e743e 100644 --- a/tools/boundary_estimation.cpp +++ b/tools/boundary_estimation.cpp @@ -37,7 +37,7 @@ * */ -#include +#include #include #include #include @@ -69,7 +69,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -90,7 +90,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, int k, double radius, double angle) { // Convert data to PointCloud @@ -117,13 +117,13 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", boundaries.width * boundaries.height); print_info (" points]\n"); // Convert data back - sensor_msgs::PointCloud2 output_boundaries; + pcl::PCLPointCloud2 output_boundaries; toROSMsg (boundaries, output_boundaries); concatenateFields (*input, output_boundaries, output); } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -166,12 +166,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-thresh", angle); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, k, radius, angle); // Save into the second file diff --git a/tools/cluster_extraction.cpp b/tools/cluster_extraction.cpp index 029de169286..d16184e4bd9 100644 --- a/tools/cluster_extraction.cpp +++ b/tools/cluster_extraction.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -71,7 +71,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -86,7 +86,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, std::vector &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, std::vector &output, int min, int max, double tolerance) { // Convert data to PointCloud @@ -117,17 +117,17 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, std::vector::const_iterator it = cluster_indices.begin (); it != cluster_indices.end (); ++it) { - pcl::ExtractIndices extract; + pcl::ExtractIndices extract; extract.setInputCloud (input); extract.setIndices (boost::make_shared (*it)); - sensor_msgs::PointCloud2::Ptr out (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr out (new pcl::PCLPointCloud2); extract.filter (*out); output.push_back (out); } } void -saveCloud (const std::string &filename, const std::vector &output) +saveCloud (const std::string &filename, const std::vector &output) { TicToc tt; tt.tic (); @@ -177,12 +177,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-tolerance", tolerance); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - std::vector output; + std::vector output; compute (cloud, output, min, max, tolerance); // Save into the second file diff --git a/tools/compute_cloud_error.cpp b/tools/compute_cloud_error.cpp index 185e002aa04..24fa79c2890 100644 --- a/tools/compute_cloud_error.cpp +++ b/tools/compute_cloud_error.cpp @@ -36,7 +36,7 @@ * $Id$ */ -#include +#include #include #include #include @@ -66,7 +66,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; // print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -81,8 +81,8 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &cloud_source, const sensor_msgs::PointCloud2::ConstPtr &cloud_target, - sensor_msgs::PointCloud2 &output, std::string correspondence_type) +compute (const pcl::PCLPointCloud2::ConstPtr &cloud_source, const pcl::PCLPointCloud2::ConstPtr &cloud_target, + pcl::PCLPointCloud2 &output, std::string correspondence_type) { // Estimate TicToc tt; @@ -205,7 +205,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &cloud_source, const sensor_ms } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -243,15 +243,15 @@ main (int argc, char** argv) parse_argument (argc, argv, "-correspondence", correspondence_type); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud_source (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud_source (new pcl::PCLPointCloud2 ()); if (!loadCloud (argv[p_file_indices[0]], *cloud_source)) return (-1); // Load the second file - sensor_msgs::PointCloud2::Ptr cloud_target (new sensor_msgs::PointCloud2 ()); + pcl::PCLPointCloud2::Ptr cloud_target (new pcl::PCLPointCloud2 ()); if (!loadCloud (argv[p_file_indices[1]], *cloud_target)) return (-1); - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; // Perform the feature estimation compute (cloud_source, cloud_target, output, correspondence_type); diff --git a/tools/concatenate_points_pcd.cpp b/tools/concatenate_points_pcd.cpp index 8d989edbb38..7345ceaf111 100644 --- a/tools/concatenate_points_pcd.cpp +++ b/tools/concatenate_points_pcd.cpp @@ -88,7 +88,7 @@ parseFileExtensionArgument (int argc, char** argv, std::string extension) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { using namespace pcl::console; TicToc tt; @@ -104,7 +104,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { using namespace pcl::console; TicToc tt; @@ -133,11 +133,11 @@ main (int argc, char** argv) std::vector file_indices = parseFileExtensionArgument (argc, argv, ".pcd"); //pcl::PointCloud cloud_all; - sensor_msgs::PointCloud2 cloud_all; + pcl::PCLPointCloud2 cloud_all; for (size_t i = 0; i < file_indices.size (); ++i) { // Load the Point Cloud - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; loadCloud (argv[file_indices[i]], cloud); //pcl::PointCloud cloud; //pcl::io::loadPCDFile (argv[file_indices[i]], cloud); diff --git a/tools/demean_cloud.cpp b/tools/demean_cloud.cpp index cfce76be707..5b7755197eb 100644 --- a/tools/demean_cloud.cpp +++ b/tools/demean_cloud.cpp @@ -52,7 +52,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -67,7 +67,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &cloud) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &cloud) { TicToc tt; tt.tic (); @@ -100,7 +100,7 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (!loadCloud (argv[pcd_file_indices[0]], cloud)) return (-1); @@ -110,9 +110,9 @@ main (int argc, char** argv) compute3DCentroid (cloud_xyz, centroid); demeanPointCloud (cloud_xyz, centroid, cloud_xyz_demeaned); - sensor_msgs::PointCloud2 cloud2_xyz_demeaned; + pcl::PCLPointCloud2 cloud2_xyz_demeaned; toROSMsg (cloud_xyz_demeaned, cloud2_xyz_demeaned); - sensor_msgs::PointCloud2 cloud_out; + pcl::PCLPointCloud2 cloud_out; concatenateFields (cloud, cloud2_xyz_demeaned, cloud_out); // Save cloud diff --git a/tools/extract_feature.cpp b/tools/extract_feature.cpp index de7a11f9286..938eff9207b 100644 --- a/tools/extract_feature.cpp +++ b/tools/extract_feature.cpp @@ -36,7 +36,7 @@ * */ -#include +#include #include #include #include @@ -77,7 +77,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -93,7 +93,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) template void -computeFeatureViaNormals (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +computeFeatureViaNormals (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, int argc, char** argv, bool set_search_flag = true) { int n_k = default_n_k; @@ -146,7 +146,7 @@ computeFeatureViaNormals (const sensor_msgs::PointCloud2::ConstPtr &input, senso } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -184,12 +184,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-feature", feature_name); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; if (feature_name == "PFHEstimation") computeFeatureViaNormals< PFHEstimation, PointXYZ, Normal, PFHSignature125> (cloud, output, argc, argv); diff --git a/tools/fast_bilateral_filter.cpp b/tools/fast_bilateral_filter.cpp index 8d57443c705..de74fbd71b1 100644 --- a/tools/fast_bilateral_filter.cpp +++ b/tools/fast_bilateral_filter.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -65,7 +65,7 @@ printHelp (int, char **argv) } bool -loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud, +loadCloud (const string &filename, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &translation, Eigen::Quaternionf &orientation) { if (loadPCDFile (filename, cloud, translation, orientation) < 0) @@ -75,7 +75,7 @@ loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud, } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, float sigma_s = 5.f, float sigma_r = 0.03f) { // Convert data to PointCloud @@ -96,13 +96,13 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou print_highlight ("Filtered data in "); print_value ("%g", tt.toc ()); print_info (" ms for "); print_value ("%zu", xyz_filtered.size ()); print_info (" points.\n"); // Convert data back - sensor_msgs::PointCloud2 output_xyz; + pcl::PCLPointCloud2 output_xyz; toROSMsg (xyz_filtered, output_xyz); concatenateFields (*input, output_xyz, output); } void -saveCloud (const string &filename, const sensor_msgs::PointCloud2 &output, +saveCloud (const string &filename, const pcl::PCLPointCloud2 &output, const Eigen::Vector4f &translation, const Eigen::Quaternionf &orientation) { PCDWriter w; @@ -120,12 +120,12 @@ batchProcess (const vector &pcd_files, string &output_dir, float sigma_s // Load the first file Eigen::Vector4f translation; Eigen::Quaternionf rotation; - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (pcd_files[i], *cloud, translation, rotation)) continue; // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, sigma_s, sigma_r); // Prepare output file name @@ -192,12 +192,12 @@ main (int argc, char** argv) // Load the first file Eigen::Vector4f translation; Eigen::Quaternionf rotation; - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud, translation, rotation)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, sigma_s, sigma_r); // Save into the second file diff --git a/tools/fpfh_estimation.cpp b/tools/fpfh_estimation.cpp index 1ac7f69ab06..a1d02ca0c96 100644 --- a/tools/fpfh_estimation.cpp +++ b/tools/fpfh_estimation.cpp @@ -37,7 +37,7 @@ * */ -#include +#include #include #include #include @@ -66,7 +66,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -87,7 +87,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, int k, double radius) { // Convert data to PointCloud @@ -113,13 +113,13 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", fpfhs.width * fpfhs.height); print_info (" points]\n"); // Convert data back - sensor_msgs::PointCloud2 output_fpfhs; + pcl::PCLPointCloud2 output_fpfhs; toROSMsg (fpfhs, output_fpfhs); concatenateFields (*input, output_fpfhs, output); } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -160,12 +160,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-radius", radius); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, k, radius); // Save into the second file diff --git a/tools/iterative_closest_point.cpp b/tools/iterative_closest_point.cpp index e25031c9a1c..8e7c45a3c67 100644 --- a/tools/iterative_closest_point.cpp +++ b/tools/iterative_closest_point.cpp @@ -69,7 +69,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -84,9 +84,9 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &source, - const sensor_msgs::PointCloud2::ConstPtr &target, - sensor_msgs::PointCloud2 &transformed_source) +compute (const pcl::PCLPointCloud2::ConstPtr &source, + const pcl::PCLPointCloud2::ConstPtr &target, + pcl::PCLPointCloud2 &transformed_source) { // Convert data to PointCloud PointCloud::Ptr src (new PointCloud); @@ -156,13 +156,13 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &source, transformation (3, 0), transformation (3, 1), transformation (3, 2), transformation (3, 3)); // Convert data back - sensor_msgs::PointCloud2 output_source; + pcl::PCLPointCloud2 output_source; toROSMsg (output, output_source); concatenateFields (*source, output_source, transformed_source); } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -202,13 +202,13 @@ main (int argc, char** argv) } // Load the input files - sensor_msgs::PointCloud2::Ptr src (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr src (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *src)) return (-1); - sensor_msgs::PointCloud2::Ptr tgt (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr tgt (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[1]], *tgt)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (src, tgt, output); // Save into the output file diff --git a/tools/marching_cubes_reconstruction.cpp b/tools/marching_cubes_reconstruction.cpp index 2dbe1ef64fc..86507619b64 100644 --- a/tools/marching_cubes_reconstruction.cpp +++ b/tools/marching_cubes_reconstruction.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -72,7 +72,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -87,7 +87,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, PolygonMesh &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, PolygonMesh &output, int hoppe_or_rbf, float iso_level, int grid_res, float extend_percentage, float off_surface_displacement) { PointCloud::Ptr xyz_cloud (new pcl::PointCloud ()); @@ -192,7 +192,7 @@ main (int argc, char** argv) print_info ("Setting an off-surface displacement of: "); print_value ("%f\n", off_surface_displacement); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[pcd_file_indices[0]], *cloud)) return (-1); diff --git a/tools/mls_smoothing.cpp b/tools/mls_smoothing.cpp index af8ae3bbf2e..e40f35d8950 100644 --- a/tools/mls_smoothing.cpp +++ b/tools/mls_smoothing.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -70,7 +70,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -85,7 +85,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, double search_radius, bool sqr_gauss_param_set, double sqr_gauss_param, bool use_polynomial_fit, int polynomial_order) { @@ -139,7 +139,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -188,12 +188,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-use_polynomial_fit", use_polynomial_fit); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Do the smoothing - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, search_radius, sqr_gauss_param_set, sqr_gauss_param, use_polynomial_fit, polynomial_order); diff --git a/tools/normal_estimation.cpp b/tools/normal_estimation.cpp index 4ade256fccb..81825316291 100644 --- a/tools/normal_estimation.cpp +++ b/tools/normal_estimation.cpp @@ -38,7 +38,7 @@ * */ -#include +#include #include #include #include @@ -70,7 +70,7 @@ printHelp (int, char **argv) } bool -loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud, +loadCloud (const string &filename, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &translation, Eigen::Quaternionf &orientation) { if (loadPCDFile (filename, cloud, translation, orientation) < 0) @@ -80,7 +80,7 @@ loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud, } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, int k, double radius) { // Convert data to PointCloud @@ -115,13 +115,13 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou print_highlight ("Computed normals in "); print_value ("%g", tt.toc ()); print_info (" ms for "); print_value ("%d", normals.width * normals.height); print_info (" points.\n"); // Convert data back - sensor_msgs::PointCloud2 output_normals; + pcl::PCLPointCloud2 output_normals; toROSMsg (normals, output_normals); concatenateFields (*input, output_normals, output); } void -saveCloud (const string &filename, const sensor_msgs::PointCloud2 &output, +saveCloud (const string &filename, const pcl::PCLPointCloud2 &output, const Eigen::Vector4f &translation, const Eigen::Quaternionf &orientation) { PCDWriter w; @@ -139,12 +139,12 @@ batchProcess (const vector &pcd_files, string &output_dir, int k, double // Load the first file Eigen::Vector4f translation; Eigen::Quaternionf rotation; - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (pcd_files[i], *cloud, translation, rotation)) continue; // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, k, radius); // Prepare output file name @@ -211,12 +211,12 @@ main (int argc, char** argv) // Load the first file Eigen::Vector4f translation; Eigen::Quaternionf rotation; - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud, translation, rotation)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, k, radius); // Save into the second file diff --git a/tools/organized_pcd_to_png.cpp b/tools/organized_pcd_to_png.cpp index 1b543088395..62a1577960d 100644 --- a/tools/organized_pcd_to_png.cpp +++ b/tools/organized_pcd_to_png.cpp @@ -52,7 +52,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -106,7 +106,7 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (!loadCloud (argv[pcd_file_indices[0]], cloud)) return (-1); diff --git a/tools/outlier_removal.cpp b/tools/outlier_removal.cpp index 663e18b8131..850c38b0e79 100644 --- a/tools/outlier_removal.cpp +++ b/tools/outlier_removal.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -79,7 +79,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud, +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud, Eigen::Vector4f &translation, Eigen::Quaternionf &orientation) { TicToc tt; @@ -95,7 +95,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud, } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, std::string method, int min_pts, double radius, int mean_k, double std_dev_mul, bool negative, bool keep_organized) @@ -156,7 +156,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou if (keep_organized) { - sensor_msgs::PointCloud2 output_filtered; + pcl::PCLPointCloud2 output_filtered; toROSMsg (*xyz_cloud_filtered, output_filtered); concatenateFields (*input, output_filtered, output); } @@ -167,7 +167,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou indices->indices.push_back (valid_indices[removed_indices->indices[i]]); // Extract the indices of the remaining points - pcl::ExtractIndices ei; + pcl::ExtractIndices ei; ei.setInputCloud (input); ei.setIndices (indices); ei.setNegative (true); @@ -176,7 +176,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output, +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output, const Eigen::Vector4f &translation, const Eigen::Quaternionf &rotation) { TicToc tt; @@ -231,7 +231,7 @@ main (int argc, char** argv) // Load the first file Eigen::Vector4f translation; Eigen::Quaternionf rotation; - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud, translation, rotation)) return (-1); @@ -242,7 +242,7 @@ main (int argc, char** argv) } // Do the smoothing - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, method, min_pts, radius, mean_k, std_dev_mul, negative, keep_organized); // Save into the second file diff --git a/tools/passthrough_filter.cpp b/tools/passthrough_filter.cpp index 904d6434fa5..50842349fe3 100644 --- a/tools/passthrough_filter.cpp +++ b/tools/passthrough_filter.cpp @@ -36,7 +36,7 @@ * $Id$ */ -#include +#include #include #include #include @@ -74,7 +74,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -89,7 +89,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, std::string field_name, float min, float max, bool inside, bool keep_organized) { // Estimate @@ -98,7 +98,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou print_highlight (stderr, "Computing "); - PassThrough passthrough_filter; + PassThrough passthrough_filter; passthrough_filter.setInputCloud (input); passthrough_filter.setFilterFieldName (field_name); passthrough_filter.setFilterLimits (min, max); @@ -110,7 +110,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -131,12 +131,12 @@ batchProcess (const vector &pcd_files, string &output_dir, for (size_t i = 0; i < pcd_files.size (); ++i) { // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (pcd_files[i], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, field_name, min, max, inside, keep_organized); // Prepare output file name @@ -203,12 +203,12 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, field_name, min, max, inside, keep_organized); // Save into the second file diff --git a/tools/pcd2ply.cpp b/tools/pcd2ply.cpp index 505f2ec666d..16447e42363 100644 --- a/tools/pcd2ply.cpp +++ b/tools/pcd2ply.cpp @@ -54,7 +54,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -69,7 +69,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &cloud, bool binary, bool use_camera) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &cloud, bool binary, bool use_camera) { TicToc tt; tt.tic (); @@ -112,7 +112,7 @@ main (int argc, char** argv) print_value ("%s\n", (use_camera ? "using camera" : "no camera")); // Load the first file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (!loadCloud (argv[pcd_file_indices[0]], cloud)) return (-1); diff --git a/tools/pcd2vtk.cpp b/tools/pcd2vtk.cpp index 015ccc8720c..343b10960f5 100644 --- a/tools/pcd2vtk.cpp +++ b/tools/pcd2vtk.cpp @@ -53,7 +53,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -68,7 +68,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &cloud) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &cloud) { TicToc tt; tt.tic (); @@ -102,7 +102,7 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (!loadCloud (argv[pcd_file_indices[0]], cloud)) return (-1); diff --git a/tools/pcd_change_viewpoint.cpp b/tools/pcd_change_viewpoint.cpp index 7d10081fef7..f1e018d50f7 100644 --- a/tools/pcd_change_viewpoint.cpp +++ b/tools/pcd_change_viewpoint.cpp @@ -37,7 +37,7 @@ * */ -#include +#include #include #include #include @@ -57,7 +57,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { Eigen::Vector4f translation; Eigen::Quaternionf orientation; @@ -81,7 +81,7 @@ void saveCloud (const std::string &filename, const Eigen::Vector4f &translation, const Eigen::Quaternionf &orientation, - const sensor_msgs::PointCloud2 &output) + const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -135,7 +135,7 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (!loadCloud (argv[p_file_indices[0]], cloud)) return (-1); diff --git a/tools/pcl_video.cpp b/tools/pcl_video.cpp index 6f42cc61999..f50f459dada 100644 --- a/tools/pcl_video.cpp +++ b/tools/pcl_video.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -77,7 +77,7 @@ class Recorder tide::BlockElement::Ptr block(new tide::SimpleBlock(1, blk_offset.total_microseconds() / 10000)); // Here the frame data itself is added to the block - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; pcl::toROSMsg(*cloud, blob); tide::Block::FramePtr frame_ptr(new tide::Block::Frame(blob.data.begin(), blob.data.end())); @@ -114,7 +114,7 @@ class Recorder int Run() { - // Write the EBML Header. This specifies that the file is an EBML + // Write the EBML PCLHeader. This specifies that the file is an EBML // file, and is a Tide document. tide::EBMLElement ebml_el; ebml_el.write(stream_); @@ -159,7 +159,7 @@ class Recorder // codec used. tide::TrackEntry::Ptr track(new tide::TrackEntry(1, 1, "pointcloud2")); track->name("3D video"); - track->codec_name("sensor_msgs::PointCloud2"); + track->codec_name("pcl::PCLPointCloud2"); // Adding each level 1 element (only the first occurance, in the case of // clusters) to the index makes opening the file later much faster. segment.index.insert(std::make_pair(tracks.id(), @@ -356,10 +356,10 @@ class Player // very small to reduce overhead. tide::BlockElement::FramePtr frame_data(*block->begin()); // Copy the frame data into a serialised cloud structure - sensor_msgs::PointCloud2 blob; + pcl::PCLPointCloud2 blob; blob.height = 480; blob.width = 640; - sensor_msgs::PointField ptype; + pcl::PCLPointField ptype; ptype.name = "x"; ptype.offset = 0; ptype.datatype = 7; diff --git a/tools/plane_projection.cpp b/tools/plane_projection.cpp index 4ad54b7d0f5..ee295d25c8d 100644 --- a/tools/plane_projection.cpp +++ b/tools/plane_projection.cpp @@ -37,7 +37,7 @@ * */ -#include +#include #include #include #include @@ -61,7 +61,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -76,7 +76,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -project (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, float a, float b, float c, float d) +project (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, float a, float b, float c, float d) { Eigen::Vector4f coeffs; coeffs << a, b, c, d; @@ -111,7 +111,7 @@ project (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou pcl::io::savePCDFile ("foo.pcd", *projected_cloud_pcl); // Convert data back - sensor_msgs::PointCloud2 projected_cloud; + pcl::PCLPointCloud2 projected_cloud; toROSMsg (*projected_cloud_pcl, projected_cloud); //we can actually use concatenate fields to inject our projection into the @@ -121,7 +121,7 @@ project (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -167,12 +167,12 @@ main (int argc, char** argv) float d = static_cast (atof (argv[6])); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; project (cloud, output, a, b, c, d); // Save into the second file diff --git a/tools/ply2pcd.cpp b/tools/ply2pcd.cpp index e14ebe22254..5303dd95579 100644 --- a/tools/ply2pcd.cpp +++ b/tools/ply2pcd.cpp @@ -54,7 +54,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -70,7 +70,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &cloud, bool format) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &cloud, bool format) { TicToc tt; tt.tic (); @@ -110,7 +110,7 @@ main (int argc, char** argv) print_info ("PCD output format: "); print_value ("%s\n", (format ? "binary" : "ascii")); // Load the first file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (!loadCloud (argv[ply_file_indices[0]], cloud)) return (-1); diff --git a/tools/poisson_reconstruction.cpp b/tools/poisson_reconstruction.cpp index 775932dde50..6b18eb5c5b9 100644 --- a/tools/poisson_reconstruction.cpp +++ b/tools/poisson_reconstruction.cpp @@ -38,7 +38,7 @@ * */ -#include +#include #include #include #include @@ -71,7 +71,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -86,7 +86,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, PolygonMesh &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, PolygonMesh &output, int depth, int solver_divide, int iso_divide, float point_weight) { PointCloud::Ptr xyz_cloud (new pcl::PointCloud ()); @@ -167,7 +167,7 @@ main (int argc, char** argv) print_info ("Setting point_weight to: "); print_value ("%f\n", point_weight); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[pcd_file_indices[0]], *cloud)) return (-1); diff --git a/tools/sac_segmentation_plane.cpp b/tools/sac_segmentation_plane.cpp index ea2b717016d..a329efdfa41 100644 --- a/tools/sac_segmentation_plane.cpp +++ b/tools/sac_segmentation_plane.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -73,7 +73,7 @@ printHelp (int, char **argv) } bool -loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -88,7 +88,7 @@ loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, int max_iterations = 1000, double threshold = 0.05, bool negative = false) { // Convert data to PointCloud @@ -162,7 +162,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -182,12 +182,12 @@ batchProcess (const vector &pcd_files, string &output_dir, int max_it, d for (size_t i = 0; i < pcd_files.size (); ++i) { // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (pcd_files[i], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, max_it, thresh, negative); // Prepare output file name @@ -266,12 +266,12 @@ main (int argc, char** argv) print_value ("%s\n", negative ? "false" : "true"); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, max_it, thresh, negative); // Save into the second file diff --git a/tools/spin_estimation.cpp b/tools/spin_estimation.cpp index 77951b25850..40fc8957f69 100644 --- a/tools/spin_estimation.cpp +++ b/tools/spin_estimation.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -77,7 +77,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -100,7 +100,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -145,12 +145,12 @@ main (int argc, char** argv) parse_argument (argc, argv, "-neigh", min_neigh); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; // Convert data to PointCloud PointCloud::Ptr xyznormals (new PointCloud); @@ -182,7 +182,7 @@ main (int argc, char** argv) print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", descriptors.width * descriptors.height); print_info (" points]\n"); // Convert data back - sensor_msgs::PointCloud2 output_descr; + pcl::PCLPointCloud2 output_descr; toROSMsg (descriptors, output_descr); concatenateFields (*cloud, output_descr, output); diff --git a/tools/transform_from_viewpoint.cpp b/tools/transform_from_viewpoint.cpp index 103345a6c9e..d18d605b492 100644 --- a/tools/transform_from_viewpoint.cpp +++ b/tools/transform_from_viewpoint.cpp @@ -37,7 +37,7 @@ * */ -#include +#include #include #include #include @@ -59,7 +59,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -74,7 +74,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -transform (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output) +transform (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output) { // Check for 'normals' bool has_normals = false; @@ -94,7 +94,7 @@ transform (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCl fromROSMsg (*input, xyznormals); pcl::transformPointCloud (xyznormals, xyznormals, translation.head<3> (), orientation); // Copy back the xyz and normals - sensor_msgs::PointCloud2 output_xyznormals; + pcl::PCLPointCloud2 output_xyznormals; toROSMsg (xyznormals, output_xyznormals); concatenateFields (*input, output_xyznormals, output); } @@ -104,7 +104,7 @@ transform (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCl fromROSMsg (*input, xyz); pcl::transformPointCloud (xyz, xyz, translation.head<3> (), orientation); // Copy back the xyz and normals - sensor_msgs::PointCloud2 output_xyz; + pcl::PCLPointCloud2 output_xyz; toROSMsg (xyz, output_xyz); concatenateFields (*input, output_xyz, output); } @@ -116,7 +116,7 @@ transform (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCl } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -152,12 +152,12 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the feature estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; transform (cloud, output); // Save into the second file diff --git a/tools/transform_point_cloud.cpp b/tools/transform_point_cloud.cpp index f32e63071e7..5ae26235d16 100644 --- a/tools/transform_point_cloud.cpp +++ b/tools/transform_point_cloud.cpp @@ -38,7 +38,7 @@ * */ -#include +#include #include #include #include @@ -79,7 +79,7 @@ printElapsedTimeAndNumberOfPoints (double t, int w, int h = 1) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -119,7 +119,7 @@ transformPointCloudHelper (PointCloud & in template void -transformPointCloud2AsType (const sensor_msgs::PointCloud2 &input, sensor_msgs::PointCloud2 &output, +transformPointCloud2AsType (const pcl::PCLPointCloud2 &input, pcl::PCLPointCloud2 &output, Eigen::Matrix4f &tform) { PointCloud cloud; @@ -129,7 +129,7 @@ transformPointCloud2AsType (const sensor_msgs::PointCloud2 &input, sensor_msgs:: } void -transformPointCloud2 (const sensor_msgs::PointCloud2 &input, sensor_msgs::PointCloud2 &output, +transformPointCloud2 (const pcl::PCLPointCloud2 &input, pcl::PCLPointCloud2 &output, Eigen::Matrix4f &tform) { // Check for 'rgb' and 'normals' fields @@ -155,7 +155,7 @@ transformPointCloud2 (const sensor_msgs::PointCloud2 &input, sensor_msgs::PointC } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, Eigen::Matrix4f &tform) { TicToc tt; @@ -169,7 +169,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -183,7 +183,7 @@ saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) } template void -multiply (sensor_msgs::PointCloud2 &cloud, int field_offset, double multiplier) +multiply (pcl::PCLPointCloud2 &cloud, int field_offset, double multiplier) { T val; memcpy (&val, &cloud.data[field_offset], sizeof (T)); @@ -192,7 +192,7 @@ multiply (sensor_msgs::PointCloud2 &cloud, int field_offset, double multiplier) } void -scaleInPlace (sensor_msgs::PointCloud2 &cloud, double* multiplier) +scaleInPlace (pcl::PCLPointCloud2 &cloud, double* multiplier) { // Obtain the x, y, and z indices int x_idx = pcl::getFieldIndex (cloud, "x"); @@ -207,28 +207,28 @@ scaleInPlace (sensor_msgs::PointCloud2 &cloud, double* multiplier) assert ((cloud.fields[x_idx].datatype == cloud.fields[z_idx].datatype)); switch (cloud.fields[x_idx].datatype) { - case sensor_msgs::PointField::INT8: + case pcl::PCLPointField::INT8: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::UINT8: + case pcl::PCLPointField::UINT8: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::INT16: + case pcl::PCLPointField::INT16: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::UINT16: + case pcl::PCLPointField::UINT16: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::INT32: + case pcl::PCLPointField::INT32: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::UINT32: + case pcl::PCLPointField::UINT32: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::FLOAT32: + case pcl::PCLPointField::FLOAT32: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; - case sensor_msgs::PointField::FLOAT64: + case pcl::PCLPointField::FLOAT64: for (int i = 0; i < 3; ++i) multiply (cloud, xyz_offset[i], multiplier[i]); break; } @@ -326,12 +326,12 @@ main (int argc, char** argv) } // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Apply the transform - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, tform); // Check if a scaling parameter has been given diff --git a/tools/uniform_sampling.cpp b/tools/uniform_sampling.cpp index ad5e410de80..fc77b1d299e 100644 --- a/tools/uniform_sampling.cpp +++ b/tools/uniform_sampling.cpp @@ -35,7 +35,7 @@ * */ -#include +#include #include #include #include @@ -62,7 +62,7 @@ printHelp (int, char **argv) } bool -loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -77,7 +77,7 @@ loadCloud (const string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, double radius) { // Convert data to PointCloud @@ -104,7 +104,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -145,12 +145,12 @@ main (int argc, char** argv) print_value ("%f\n", radius); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Perform the keypoint estimation - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, radius); // Save into the second file diff --git a/tools/vfh_estimation.cpp b/tools/vfh_estimation.cpp index 1b767edb346..374a0cc900c 100644 --- a/tools/vfh_estimation.cpp +++ b/tools/vfh_estimation.cpp @@ -37,7 +37,7 @@ * */ -#include +#include #include #include #include @@ -67,7 +67,7 @@ loadCloud (const std::string &filename, PointCloud &cloud) print_info ("Available dimensions: "); print_value ("%s\n", getFieldsList (cloud).c_str ()); // Check if the dataset has normals - std::vector fields; + std::vector fields; if (getFieldIndex (cloud, "normal_x", fields) == -1) { print_error ("The input dataset does not contain normal information!\n"); diff --git a/tools/voxel_grid.cpp b/tools/voxel_grid.cpp index dd3f33c5dab..9c1a8bbb013 100644 --- a/tools/voxel_grid.cpp +++ b/tools/voxel_grid.cpp @@ -36,7 +36,7 @@ * */ -#include +#include #include #include #include @@ -68,7 +68,7 @@ printHelp (int, char **argv) } bool -loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) +loadCloud (const std::string &filename, pcl::PCLPointCloud2 &cloud) { TicToc tt; print_highlight ("Loading "); print_value ("%s ", filename.c_str ()); @@ -83,7 +83,7 @@ loadCloud (const std::string &filename, sensor_msgs::PointCloud2 &cloud) } void -compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointCloud2 &output, +compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, float leaf_x, float leaf_y, float leaf_z, const std::string &field, double fmin, double fmax) { TicToc tt; @@ -91,7 +91,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou print_highlight ("Computing "); - VoxelGrid grid; + VoxelGrid grid; grid.setInputCloud (input); grid.setFilterFieldName (field); grid.setFilterLimits (fmin, fmax); @@ -102,7 +102,7 @@ compute (const sensor_msgs::PointCloud2::ConstPtr &input, sensor_msgs::PointClou } void -saveCloud (const std::string &filename, const sensor_msgs::PointCloud2 &output) +saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) { TicToc tt; tt.tic (); @@ -178,12 +178,12 @@ main (int argc, char** argv) print_value ("%f\n", fmax); // Load the first file - sensor_msgs::PointCloud2::Ptr cloud (new sensor_msgs::PointCloud2); + pcl::PCLPointCloud2::Ptr cloud (new pcl::PCLPointCloud2); if (!loadCloud (argv[p_file_indices[0]], *cloud)) return (-1); // Apply the voxel grid - sensor_msgs::PointCloud2 output; + pcl::PCLPointCloud2 output; compute (cloud, output, leaf_x, leaf_y, leaf_z, field, fmin, fmax); // Save into the second file diff --git a/visualization/include/pcl/visualization/common/actor_map.h b/visualization/include/pcl/visualization/common/actor_map.h index c1066d43c09..185c3f82e68 100644 --- a/visualization/include/pcl/visualization/common/actor_map.h +++ b/visualization/include/pcl/visualization/common/actor_map.h @@ -40,8 +40,11 @@ #include #include #include -#include #include +#include +#include +#include +#include template class vtkSmartPointer; class vtkLODActor; @@ -53,11 +56,11 @@ namespace pcl { class PCL_EXPORTS CloudActor { - typedef PointCloudGeometryHandler GeometryHandler; + typedef PointCloudGeometryHandler GeometryHandler; typedef GeometryHandler::Ptr GeometryHandlerPtr; typedef GeometryHandler::ConstPtr GeometryHandlerConstPtr; - typedef PointCloudColorHandler ColorHandler; + typedef PointCloudColorHandler ColorHandler; typedef ColorHandler::Ptr ColorHandlerPtr; typedef ColorHandler::ConstPtr ColorHandlerConstPtr; diff --git a/visualization/include/pcl/visualization/histogram_visualizer.h b/visualization/include/pcl/visualization/histogram_visualizer.h index 69937074a40..58e1031a74f 100644 --- a/visualization/include/pcl/visualization/histogram_visualizer.h +++ b/visualization/include/pcl/visualization/histogram_visualizer.h @@ -102,7 +102,7 @@ namespace pcl * \param[in] win_height the height of the window */ bool - addFeatureHistogram (const sensor_msgs::PointCloud2 &cloud, + addFeatureHistogram (const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id = "cloud", int win_width = 640, int win_height = 200); @@ -129,7 +129,7 @@ namespace pcl * \param[in] win_height the height of the window */ bool - addFeatureHistogram (const sensor_msgs::PointCloud2 &cloud, + addFeatureHistogram (const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id = "cloud", int win_width = 640, int win_height = 200); @@ -149,7 +149,7 @@ namespace pcl * \param[in] id the point cloud object id (default: cloud) */ bool - updateFeatureHistogram (const sensor_msgs::PointCloud2 &cloud, + updateFeatureHistogram (const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id = "cloud"); @@ -172,7 +172,7 @@ namespace pcl * \param[in] id the point cloud object id (default: cloud) */ bool - updateFeatureHistogram (const sensor_msgs::PointCloud2 &cloud, + updateFeatureHistogram (const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id = "cloud"); diff --git a/visualization/include/pcl/visualization/image_viewer.h b/visualization/include/pcl/visualization/image_viewer.h index 94b40c7d1ba..92da2978650 100644 --- a/visualization/include/pcl/visualization/image_viewer.h +++ b/visualization/include/pcl/visualization/image_viewer.h @@ -53,6 +53,7 @@ #include +class vtkImageSlice; class vtkContextActor; class vtkImageViewer; class vtkImageFlip; diff --git a/visualization/include/pcl/visualization/impl/histogram_visualizer.hpp b/visualization/include/pcl/visualization/impl/histogram_visualizer.hpp index 4d9d7283f93..b0eeec0b148 100644 --- a/visualization/include/pcl/visualization/impl/histogram_visualizer.hpp +++ b/visualization/include/pcl/visualization/impl/histogram_visualizer.hpp @@ -92,7 +92,7 @@ pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram ( } // Get the fields present in this cloud - std::vector fields; + std::vector fields; // Check if our field exists int field_idx = pcl::getFieldIndex (cloud, field_name, fields); if (field_idx == -1) @@ -177,7 +177,7 @@ pcl::visualization::PCLHistogramVisualizer::updateFeatureHistogram ( } // Get the fields present in this cloud - std::vector fields; + std::vector fields; // Check if our field exists int field_idx = pcl::getFieldIndex (cloud, field_name, fields); if (field_idx == -1) diff --git a/visualization/include/pcl/visualization/impl/pcl_plotter.hpp b/visualization/include/pcl/visualization/impl/pcl_plotter.hpp index f21fb3737f1..1d2d451184f 100644 --- a/visualization/include/pcl/visualization/impl/pcl_plotter.hpp +++ b/visualization/include/pcl/visualization/impl/pcl_plotter.hpp @@ -72,7 +72,7 @@ pcl::visualization::PCLPlotter::addFeatureHistogram ( } // Get the fields present in this cloud - std::vector fields; + std::vector fields; // Check if our field exists int field_idx = pcl::getFieldIndex (cloud, field_name, fields); if (field_idx == -1) diff --git a/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp b/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp index d214385f4e3..975b9d0549a 100644 --- a/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp +++ b/visualization/include/pcl/visualization/impl/pcl_visualizer.hpp @@ -1538,7 +1538,7 @@ pcl::visualization::PCLVisualizer::addPolygonMesh ( } int rgb_idx = -1; - std::vector fields; + std::vector fields; vtkSmartPointer colors; rgb_idx = pcl::getFieldIndex (*cloud, "rgb", fields); if (rgb_idx == -1) @@ -1756,7 +1756,7 @@ pcl::visualization::PCLVisualizer::updatePolygonMesh ( // Update colors vtkUnsignedCharArray* colors = vtkUnsignedCharArray::SafeDownCast (polydata->GetPointData ()->GetScalars ()); int rgb_idx = -1; - std::vector fields; + std::vector fields; rgb_idx = pcl::getFieldIndex (*cloud, "rgb", fields); if (rgb_idx == -1) rgb_idx = pcl::getFieldIndex (*cloud, "rgba", fields); diff --git a/visualization/include/pcl/visualization/pcl_plotter.h b/visualization/include/pcl/visualization/pcl_plotter.h index 4180406dd0b..e9bedc536a2 100644 --- a/visualization/include/pcl/visualization/pcl_plotter.h +++ b/visualization/include/pcl/visualization/pcl_plotter.h @@ -227,7 +227,7 @@ namespace pcl * \param[in] win_height the height of the window */ bool - addFeatureHistogram (const sensor_msgs::PointCloud2 &cloud, + addFeatureHistogram (const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id = "cloud", int win_width = 640, int win_height = 200); @@ -254,7 +254,7 @@ namespace pcl * \param[in] win_height the height of the window */ bool - addFeatureHistogram (const sensor_msgs::PointCloud2 &cloud, + addFeatureHistogram (const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id = "cloud", int win_width = 640, int win_height = 200); diff --git a/visualization/include/pcl/visualization/pcl_visualizer.h b/visualization/include/pcl/visualization/pcl_visualizer.h index 63f81c30ed7..c5b79cdedd8 100644 --- a/visualization/include/pcl/visualization/pcl_visualizer.h +++ b/visualization/include/pcl/visualization/pcl_visualizer.h @@ -88,11 +88,11 @@ namespace pcl typedef boost::shared_ptr Ptr; typedef boost::shared_ptr ConstPtr; - typedef PointCloudGeometryHandler GeometryHandler; + typedef PointCloudGeometryHandler GeometryHandler; typedef GeometryHandler::Ptr GeometryHandlerPtr; typedef GeometryHandler::ConstPtr GeometryHandlerConstPtr; - typedef PointCloudColorHandler ColorHandler; + typedef PointCloudColorHandler ColorHandler; typedef ColorHandler::Ptr ColorHandlerPtr; typedef ColorHandler::ConstPtr ColorHandlerConstPtr; @@ -697,7 +697,7 @@ namespace pcl * \param[in] viewport the view port where the Point Cloud should be added (default: all) */ bool - addPointCloud (const sensor_msgs::PointCloud2::ConstPtr &cloud, + addPointCloud (const pcl::PCLPointCloud2::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const ColorHandlerConstPtr &color_handler, const Eigen::Vector4f& sensor_origin, @@ -719,7 +719,7 @@ namespace pcl * \param[in] viewport the view port where the Point Cloud should be added (default: all) */ bool - addPointCloud (const sensor_msgs::PointCloud2::ConstPtr &cloud, + addPointCloud (const pcl::PCLPointCloud2::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const Eigen::Vector4f& sensor_origin, const Eigen::Quaternion& sensor_orientation, @@ -740,7 +740,7 @@ namespace pcl * \param[in] viewport the view port where the Point Cloud should be added (default: all) */ bool - addPointCloud (const sensor_msgs::PointCloud2::ConstPtr &cloud, + addPointCloud (const pcl::PCLPointCloud2::ConstPtr &cloud, const ColorHandlerConstPtr &color_handler, const Eigen::Vector4f& sensor_origin, const Eigen::Quaternion& sensor_orientation, diff --git a/visualization/include/pcl/visualization/point_cloud_color_handlers.h b/visualization/include/pcl/visualization/point_cloud_color_handlers.h index 95987e28ae0..78a46160f24 100644 --- a/visualization/include/pcl/visualization/point_cloud_color_handlers.h +++ b/visualization/include/pcl/visualization/point_cloud_color_handlers.h @@ -126,7 +126,7 @@ namespace pcl int field_idx_; /** \brief The list of fields available for this PointCloud. */ - std::vector fields_; + std::vector fields_; }; ////////////////////////////////////////////////////////////////////////////////////// @@ -437,10 +437,10 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudColorHandler + class PCL_EXPORTS PointCloudColorHandler { public: - typedef sensor_msgs::PointCloud2 PointCloud; + typedef pcl::PCLPointCloud2 PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -503,9 +503,9 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudColorHandlerRandom : public PointCloudColorHandler + class PCL_EXPORTS PointCloudColorHandlerRandom : public PointCloudColorHandler { - typedef PointCloudColorHandler::PointCloud PointCloud; + typedef PointCloudColorHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -515,7 +515,7 @@ namespace pcl /** \brief Constructor. */ PointCloudColorHandlerRandom (const PointCloudConstPtr &cloud) : - PointCloudColorHandler (cloud) + PointCloudColorHandler (cloud) { capable_ = true; } @@ -547,9 +547,9 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudColorHandlerCustom : public PointCloudColorHandler + class PCL_EXPORTS PointCloudColorHandlerCustom : public PointCloudColorHandler { - typedef PointCloudColorHandler::PointCloud PointCloud; + typedef PointCloudColorHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -557,7 +557,7 @@ namespace pcl /** \brief Constructor. */ PointCloudColorHandlerCustom (const PointCloudConstPtr &cloud, double r, double g, double b) : - PointCloudColorHandler (cloud), + PointCloudColorHandler (cloud), r_ (r), g_ (g), b_ (b) { capable_ = true; @@ -594,9 +594,9 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudColorHandlerRGBField : public PointCloudColorHandler + class PCL_EXPORTS PointCloudColorHandlerRGBField : public PointCloudColorHandler { - typedef PointCloudColorHandler::PointCloud PointCloud; + typedef PointCloudColorHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -634,9 +634,9 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudColorHandlerHSVField : public PointCloudColorHandler + class PCL_EXPORTS PointCloudColorHandlerHSVField : public PointCloudColorHandler { - typedef PointCloudColorHandler::PointCloud PointCloud; + typedef PointCloudColorHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -681,9 +681,9 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudColorHandlerGenericField : public PointCloudColorHandler + class PCL_EXPORTS PointCloudColorHandlerGenericField : public PointCloudColorHandler { - typedef PointCloudColorHandler::PointCloud PointCloud; + typedef PointCloudColorHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; diff --git a/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h b/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h index 6516c92c9f3..c4a4de4bb55 100644 --- a/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h +++ b/visualization/include/pcl/visualization/point_cloud_geometry_handlers.h @@ -126,7 +126,7 @@ namespace pcl int field_z_idx_; /** \brief The list of fields available for this PointCloud. */ - std::vector fields_; + std::vector fields_; }; ////////////////////////////////////////////////////////////////////////////////////// @@ -319,10 +319,10 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudGeometryHandler + class PCL_EXPORTS PointCloudGeometryHandler { public: - typedef sensor_msgs::PointCloud2 PointCloud; + typedef pcl::PCLPointCloud2 PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -389,7 +389,7 @@ namespace pcl int field_z_idx_; /** \brief The list of fields available for this PointCloud. */ - std::vector fields_; + std::vector fields_; }; ////////////////////////////////////////////////////////////////////////////////////// @@ -399,10 +399,10 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudGeometryHandlerXYZ : public PointCloudGeometryHandler + class PCL_EXPORTS PointCloudGeometryHandlerXYZ : public PointCloudGeometryHandler { public: - typedef PointCloudGeometryHandler::PointCloud PointCloud; + typedef PointCloudGeometryHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -432,10 +432,10 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudGeometryHandlerSurfaceNormal : public PointCloudGeometryHandler + class PCL_EXPORTS PointCloudGeometryHandlerSurfaceNormal : public PointCloudGeometryHandler { public: - typedef PointCloudGeometryHandler::PointCloud PointCloud; + typedef PointCloudGeometryHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; @@ -462,10 +462,10 @@ namespace pcl * \ingroup visualization */ template <> - class PCL_EXPORTS PointCloudGeometryHandlerCustom : public PointCloudGeometryHandler + class PCL_EXPORTS PointCloudGeometryHandlerCustom : public PointCloudGeometryHandler { public: - typedef PointCloudGeometryHandler::PointCloud PointCloud; + typedef PointCloudGeometryHandler::PointCloud PointCloud; typedef PointCloud::Ptr PointCloudPtr; typedef PointCloud::ConstPtr PointCloudConstPtr; diff --git a/visualization/src/common/io.cpp b/visualization/src/common/io.cpp index 19a48bd6ad3..52f81a90b53 100644 --- a/visualization/src/common/io.cpp +++ b/visualization/src/common/io.cpp @@ -120,7 +120,7 @@ pcl::visualization::savePointData (vtkPolyData* data, const std::string &out_fil pcl::console::print_debug (" Load: %s ... ", file_name.c_str ()); // Assume the name of the actor is the name of the file - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; if (pcl::io::loadPCDFile (file_name, cloud) == -1) { pcl::console::print_error (stdout, "[failed]\n"); @@ -136,7 +136,7 @@ pcl::visualization::savePointData (vtkPolyData* data, const std::string &out_fil getCorrespondingPointCloud (cleaner->GetOutput (), cloud_xyz, indices); // Copy the indices and save the file - sensor_msgs::PointCloud2 cloud_out; + pcl::PCLPointCloud2 cloud_out; pcl::copyPointCloud (cloud, indices, cloud_out); std::stringstream ss; ss << out_file << i++ << ".pcd"; diff --git a/visualization/src/histogram_visualizer.cpp b/visualization/src/histogram_visualizer.cpp index 270ede80fde..dc6330af11a 100644 --- a/visualization/src/histogram_visualizer.cpp +++ b/visualization/src/histogram_visualizer.cpp @@ -371,7 +371,7 @@ pcl::visualization::PCLHistogramVisualizer::createActor ( //////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram ( - const sensor_msgs::PointCloud2 &cloud, const std::string &field_name, + const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id, int win_width, int win_height) { // Get the field @@ -418,7 +418,7 @@ pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram ( //////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram ( - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id, int win_width, int win_height) @@ -478,7 +478,7 @@ pcl::visualization::PCLHistogramVisualizer::addFeatureHistogram ( ////////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLHistogramVisualizer::updateFeatureHistogram ( - const sensor_msgs::PointCloud2 &cloud, const std::string &field_name, + const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id) { RenWinInteractMap::iterator am_it = wins_.find (id); @@ -517,7 +517,7 @@ pcl::visualization::PCLHistogramVisualizer::updateFeatureHistogram ( ////////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLHistogramVisualizer::updateFeatureHistogram ( - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id) diff --git a/visualization/src/interactor_style.cpp b/visualization/src/interactor_style.cpp index 09757c12adf..ab703c007e4 100644 --- a/visualization/src/interactor_style.cpp +++ b/visualization/src/interactor_style.cpp @@ -328,7 +328,7 @@ pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown () act->geometry_handler_index_ = index; // Create the new geometry - PointCloudGeometryHandler::ConstPtr geometry_handler = act->geometry_handlers[index]; + PointCloudGeometryHandler::ConstPtr geometry_handler = act->geometry_handlers[index]; // Use the handler to obtain the geometry vtkSmartPointer points; @@ -374,7 +374,7 @@ pcl::visualization::PCLVisualizerInteractorStyle::OnKeyDown () act->color_handler_index_ = index; // Get the new color - PointCloudColorHandler::ConstPtr color_handler = act->color_handlers[index]; + PointCloudColorHandler::ConstPtr color_handler = act->color_handlers[index]; vtkSmartPointer scalars; color_handler->getColor (scalars); diff --git a/visualization/src/pcl_plotter.cpp b/visualization/src/pcl_plotter.cpp index bd3afaf1d7d..ac6b3fa58c3 100644 --- a/visualization/src/pcl_plotter.cpp +++ b/visualization/src/pcl_plotter.cpp @@ -296,7 +296,7 @@ pcl::visualization::PCLPlotter::addHistogramData ( ////////////////////////////////HistVizualizer Functions////////////////////////////////////// bool pcl::visualization::PCLPlotter::addFeatureHistogram ( - const sensor_msgs::PointCloud2 &cloud, const std::string &field_name, + const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const std::string &id, int win_width, int win_height) { // Get the field @@ -328,7 +328,7 @@ pcl::visualization::PCLPlotter::addFeatureHistogram ( ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLPlotter::addFeatureHistogram ( - const sensor_msgs::PointCloud2 &cloud, + const pcl::PCLPointCloud2 &cloud, const std::string &field_name, const int index, const std::string &id, int win_width, int win_height) diff --git a/visualization/src/pcl_visualizer.cpp b/visualization/src/pcl_visualizer.cpp index c3f5d9a56b5..ecf332bfe0e 100644 --- a/visualization/src/pcl_visualizer.cpp +++ b/visualization/src/pcl_visualizer.cpp @@ -2743,7 +2743,7 @@ pcl::visualization::PCLVisualizer::updateColorHandlerIndex (const std::string &i return (false); } // Get the handler - PointCloudColorHandler::ConstPtr color_handler = am_it->second.color_handlers[index]; + PointCloudColorHandler::ConstPtr color_handler = am_it->second.color_handlers[index]; vtkSmartPointer scalars; color_handler->getColor (scalars); @@ -3841,7 +3841,7 @@ pcl::visualization::PCLVisualizer::convertToEigenMatrix ( ////////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::addPointCloud ( - const sensor_msgs::PointCloud2::ConstPtr &, + const pcl::PCLPointCloud2::ConstPtr &, const GeometryHandlerConstPtr &geometry_handler, const ColorHandlerConstPtr &color_handler, const Eigen::Vector4f& sensor_origin, @@ -3864,7 +3864,7 @@ pcl::visualization::PCLVisualizer::addPointCloud ( ////////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::addPointCloud ( - const sensor_msgs::PointCloud2::ConstPtr &cloud, + const pcl::PCLPointCloud2::ConstPtr &cloud, const GeometryHandlerConstPtr &geometry_handler, const Eigen::Vector4f& sensor_origin, const Eigen::Quaternion& sensor_orientation, @@ -3881,14 +3881,14 @@ pcl::visualization::PCLVisualizer::addPointCloud ( return (true); } - PointCloudColorHandlerCustom::Ptr color_handler (new PointCloudColorHandlerCustom (cloud, 255, 255, 255)); + PointCloudColorHandlerCustom::Ptr color_handler (new PointCloudColorHandlerCustom (cloud, 255, 255, 255)); return (fromHandlersToScreen (geometry_handler, color_handler, id, viewport, sensor_origin, sensor_orientation)); } ////////////////////////////////////////////////////////////////////////////////////////////// bool pcl::visualization::PCLVisualizer::addPointCloud ( - const sensor_msgs::PointCloud2::ConstPtr &cloud, + const pcl::PCLPointCloud2::ConstPtr &cloud, const ColorHandlerConstPtr &color_handler, const Eigen::Vector4f& sensor_origin, const Eigen::Quaternion& sensor_orientation, @@ -3904,7 +3904,7 @@ pcl::visualization::PCLVisualizer::addPointCloud ( return (true); } - PointCloudGeometryHandlerXYZ::Ptr geometry_handler (new PointCloudGeometryHandlerXYZ (cloud)); + PointCloudGeometryHandlerXYZ::Ptr geometry_handler (new PointCloudGeometryHandlerXYZ (cloud)); return (fromHandlersToScreen (geometry_handler, color_handler, id, viewport, sensor_origin, sensor_orientation)); } diff --git a/visualization/src/point_cloud_handlers.cpp b/visualization/src/point_cloud_handlers.cpp index 4d5b9bf6f2a..6e8211d6132 100644 --- a/visualization/src/point_cloud_handlers.cpp +++ b/visualization/src/point_cloud_handlers.cpp @@ -45,7 +45,7 @@ /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::visualization::PointCloudColorHandlerCustom::getColor (vtkSmartPointer &scalars) const +pcl::visualization::PointCloudColorHandlerCustom::getColor (vtkSmartPointer &scalars) const { if (!capable_ || !cloud_) return (false); @@ -73,7 +73,7 @@ pcl::visualization::PointCloudColorHandlerCustom::getC /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::visualization::PointCloudColorHandlerRandom::getColor (vtkSmartPointer &scalars) const +pcl::visualization::PointCloudColorHandlerRandom::getColor (vtkSmartPointer &scalars) const { if (!capable_ || !cloud_) return (false); @@ -104,9 +104,9 @@ pcl::visualization::PointCloudColorHandlerRandom::getC } /////////////////////////////////////////////////////////////////////////////////////////// -pcl::visualization::PointCloudColorHandlerRGBField::PointCloudColorHandlerRGBField ( - const pcl::visualization::PointCloudColorHandler::PointCloudConstPtr &cloud) : - pcl::visualization::PointCloudColorHandler::PointCloudColorHandler (cloud) +pcl::visualization::PointCloudColorHandlerRGBField::PointCloudColorHandlerRGBField ( + const pcl::visualization::PointCloudColorHandler::PointCloudConstPtr &cloud) : + pcl::visualization::PointCloudColorHandler::PointCloudColorHandler (cloud) { // Handle the 24-bit packed RGB values field_idx_ = pcl::getFieldIndex (*cloud, "rgb"); @@ -127,7 +127,7 @@ pcl::visualization::PointCloudColorHandlerRGBField::Po /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::visualization::PointCloudColorHandlerRGBField::getColor (vtkSmartPointer &scalars) const +pcl::visualization::PointCloudColorHandlerRGBField::getColor (vtkSmartPointer &scalars) const { if (!capable_ || !cloud_) return (false); @@ -197,9 +197,9 @@ pcl::visualization::PointCloudColorHandlerRGBField::ge } /////////////////////////////////////////////////////////////////////////////////////////// -pcl::visualization::PointCloudColorHandlerHSVField::PointCloudColorHandlerHSVField ( - const pcl::visualization::PointCloudColorHandler::PointCloudConstPtr &cloud) : - pcl::visualization::PointCloudColorHandler::PointCloudColorHandler (cloud), +pcl::visualization::PointCloudColorHandlerHSVField::PointCloudColorHandlerHSVField ( + const pcl::visualization::PointCloudColorHandler::PointCloudConstPtr &cloud) : + pcl::visualization::PointCloudColorHandler::PointCloudColorHandler (cloud), s_field_idx_ (-1), v_field_idx_ (-1) { // Check for the presence of the "H" field @@ -230,7 +230,7 @@ pcl::visualization::PointCloudColorHandlerHSVField::Po /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::visualization::PointCloudColorHandlerHSVField::getColor (vtkSmartPointer &scalars) const +pcl::visualization::PointCloudColorHandlerHSVField::getColor (vtkSmartPointer &scalars) const { if (!capable_ || !cloud_) return (false); @@ -421,10 +421,10 @@ pcl::visualization::PointCloudColorHandlerHSVField::ge } /////////////////////////////////////////////////////////////////////////////////////////// -pcl::visualization::PointCloudColorHandlerGenericField::PointCloudColorHandlerGenericField ( - const pcl::visualization::PointCloudColorHandler::PointCloudConstPtr &cloud, +pcl::visualization::PointCloudColorHandlerGenericField::PointCloudColorHandlerGenericField ( + const pcl::visualization::PointCloudColorHandler::PointCloudConstPtr &cloud, const std::string &field_name) : - pcl::visualization::PointCloudColorHandler::PointCloudColorHandler (cloud), + pcl::visualization::PointCloudColorHandler::PointCloudColorHandler (cloud), field_name_ (field_name) { field_idx_ = pcl::getFieldIndex (*cloud, field_name); @@ -436,7 +436,7 @@ pcl::visualization::PointCloudColorHandlerGenericField /////////////////////////////////////////////////////////////////////////////////////////// bool -pcl::visualization::PointCloudColorHandlerGenericField::getColor (vtkSmartPointer &scalars) const +pcl::visualization::PointCloudColorHandlerGenericField::getColor (vtkSmartPointer &scalars) const { if (!capable_ || !cloud_) return (false); @@ -499,7 +499,7 @@ pcl::visualization::PointCloudColorHandlerGenericField /////////////////////////////////////////////////////////////////////////////////////////// void -pcl::visualization::PointCloudGeometryHandler::getGeometry (vtkSmartPointer &points) const +pcl::visualization::PointCloudGeometryHandler::getGeometry (vtkSmartPointer &points) const { if (!capable_) return; @@ -565,8 +565,8 @@ pcl::visualization::PointCloudGeometryHandler::getGeom } /////////////////////////////////////////////////////////////////////////////////////////// -pcl::visualization::PointCloudGeometryHandlerXYZ::PointCloudGeometryHandlerXYZ (const PointCloudConstPtr &cloud) -: pcl::visualization::PointCloudGeometryHandler::PointCloudGeometryHandler (cloud) +pcl::visualization::PointCloudGeometryHandlerXYZ::PointCloudGeometryHandlerXYZ (const PointCloudConstPtr &cloud) +: pcl::visualization::PointCloudGeometryHandler::PointCloudGeometryHandler (cloud) { field_x_idx_ = pcl::getFieldIndex (*cloud, "x"); if (field_x_idx_ == -1) @@ -581,8 +581,8 @@ pcl::visualization::PointCloudGeometryHandlerXYZ::Poin } /////////////////////////////////////////////////////////////////////////////////////////// -pcl::visualization::PointCloudGeometryHandlerSurfaceNormal::PointCloudGeometryHandlerSurfaceNormal (const PointCloudConstPtr &cloud) -: pcl::visualization::PointCloudGeometryHandler::PointCloudGeometryHandler (cloud) +pcl::visualization::PointCloudGeometryHandlerSurfaceNormal::PointCloudGeometryHandlerSurfaceNormal (const PointCloudConstPtr &cloud) +: pcl::visualization::PointCloudGeometryHandler::PointCloudGeometryHandler (cloud) { field_x_idx_ = pcl::getFieldIndex (*cloud, "normal_x"); if (field_x_idx_ == -1) @@ -597,9 +597,9 @@ pcl::visualization::PointCloudGeometryHandlerSurfaceNormal::PointCloudGeometryHandlerCustom ( +pcl::visualization::PointCloudGeometryHandlerCustom::PointCloudGeometryHandlerCustom ( const PointCloudConstPtr &cloud, const std::string &x_field_name, const std::string &y_field_name, const std::string &z_field_name) -: pcl::visualization::PointCloudGeometryHandler::PointCloudGeometryHandler (cloud), field_name_ () +: pcl::visualization::PointCloudGeometryHandler::PointCloudGeometryHandler (cloud), field_name_ () { field_x_idx_ = pcl::getFieldIndex (*cloud, x_field_name); if (field_x_idx_ == -1) diff --git a/visualization/tools/image_grabber_viewer.cpp b/visualization/tools/image_grabber_viewer.cpp index 32dd1e8e62e..d419ea1604b 100644 --- a/visualization/tools/image_grabber_viewer.cpp +++ b/visualization/tools/image_grabber_viewer.cpp @@ -96,11 +96,7 @@ struct EventHelper cloud_cb (const pcl::PointCloud::ConstPtr & cloud) { pcl::uint64_t timestamp; -#ifdef USE_ROS - timestamp = cloud->header.stamp.toNSec() / 1000; //Microseconds -#else timestamp = cloud->header.stamp; -#endif //USE_ROS if (timestamp > 0) PCL_INFO ("Acquired cloud with timestamp of %lu\n", timestamp); if (mutex_.try_lock ()) diff --git a/visualization/tools/image_viewer.cpp b/visualization/tools/image_viewer.cpp index 68b04515e10..df93d28dff7 100644 --- a/visualization/tools/image_viewer.cpp +++ b/visualization/tools/image_viewer.cpp @@ -56,7 +56,7 @@ int main (int, char ** argv) { pcl::PCDReader reader; - sensor_msgs::PointCloud2 cloud; + pcl::PCLPointCloud2 cloud; reader.read (argv[1], cloud); pcl::PointCloud xyz; diff --git a/visualization/tools/pcd_viewer.cpp b/visualization/tools/pcd_viewer.cpp index 77cc1779a12..9e4d78d31f5 100644 --- a/visualization/tools/pcd_viewer.cpp +++ b/visualization/tools/pcd_viewer.cpp @@ -59,11 +59,11 @@ using namespace pcl::console; -typedef pcl::visualization::PointCloudColorHandler ColorHandler; +typedef pcl::visualization::PointCloudColorHandler ColorHandler; typedef ColorHandler::Ptr ColorHandlerPtr; typedef ColorHandler::ConstPtr ColorHandlerConstPtr; -typedef pcl::visualization::PointCloudGeometryHandler GeometryHandler; +typedef pcl::visualization::PointCloudGeometryHandler GeometryHandler; typedef GeometryHandler::Ptr GeometryHandlerPtr; typedef GeometryHandler::ConstPtr GeometryHandlerConstPtr; @@ -82,7 +82,7 @@ isValidFieldName (const std::string &field) } bool -isMultiDimensionalFeatureField (const sensor_msgs::PointField &field) +isMultiDimensionalFeatureField (const pcl::PCLPointField &field) { if (field.count > 1) return (true); @@ -90,7 +90,7 @@ isMultiDimensionalFeatureField (const sensor_msgs::PointField &field) } bool -isOnly2DImage (const sensor_msgs::PointField &field) +isOnly2DImage (const pcl::PCLPointField &field) { if (field.name == "rgba" || field.name == "rgb") return (true); @@ -148,7 +148,7 @@ pcl::visualization::PCLPlotter ph_global; boost::shared_ptr p; std::vector > imgs; pcl::search::KdTree search; -sensor_msgs::PointCloud2::Ptr cloud; +pcl::PCLPointCloud2::Ptr cloud; pcl::PointCloud::Ptr xyzcloud; void @@ -160,7 +160,7 @@ pp_callback (const pcl::visualization::PointPickingEvent& event, void* cookie) if (!cloud) { - cloud = *reinterpret_cast (cookie); + cloud = *reinterpret_cast (cookie); xyzcloud.reset (new pcl::PointCloud); pcl::fromROSMsg (*cloud, *xyzcloud); search.setInputCloud (xyzcloud); @@ -409,12 +409,12 @@ main (int argc, char** argv) } } - sensor_msgs::PointCloud2::Ptr cloud; + pcl::PCLPointCloud2::Ptr cloud; // Go through PCD files for (size_t i = 0; i < p_file_indices.size (); ++i) { tt.tic (); - cloud.reset (new sensor_msgs::PointCloud2); + cloud.reset (new pcl::PCLPointCloud2); Eigen::Vector4f origin; Eigen::Quaternionf orientation; int version; @@ -506,15 +506,15 @@ main (int argc, char** argv) if (fcolorparam) { if (fcolor_r.size () > i && fcolor_g.size () > i && fcolor_b.size () > i) - color_handler.reset (new pcl::visualization::PointCloudColorHandlerCustom (cloud, fcolor_r[i], fcolor_g[i], fcolor_b[i])); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerCustom (cloud, fcolor_r[i], fcolor_g[i], fcolor_b[i])); else - color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); } else - color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerRandom (cloud)); // Add the dataset with a XYZ and a random handler - geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ (cloud)); + geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerXYZ (cloud)); // Add the cloud to the renderer //p->addPointCloud (cloud_xyz, geometry_handler, color_handler, cloud_name.str (), viewport); p->addPointCloud (cloud, geometry_handler, color_handler, origin, orientation, cloud_name.str (), viewport); @@ -595,12 +595,12 @@ main (int argc, char** argv) for (size_t f = 0; f < cloud->fields.size (); ++f) { if (cloud->fields[f].name == "rgb" || cloud->fields[f].name == "rgba") - color_handler.reset (new pcl::visualization::PointCloudColorHandlerRGBField (cloud)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerRGBField (cloud)); else { if (!isValidFieldName (cloud->fields[f].name)) continue; - color_handler.reset (new pcl::visualization::PointCloudColorHandlerGenericField (cloud, cloud->fields[f].name)); + color_handler.reset (new pcl::visualization::PointCloudColorHandlerGenericField (cloud, cloud->fields[f].name)); } // Add the cloud to the renderer //p->addPointCloud (cloud_xyz, color_handler, cloud_name.str (), viewport); @@ -609,7 +609,7 @@ main (int argc, char** argv) } // Additionally, add normals as a handler - geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerSurfaceNormal (cloud)); + geometry_handler.reset (new pcl::visualization::PointCloudGeometryHandlerSurfaceNormal (cloud)); if (geometry_handler->isCapable ()) //p->addPointCloud (cloud_xyz, geometry_handler, cloud_name.str (), viewport); p->addPointCloud (cloud, geometry_handler, origin, orientation, cloud_name.str (), viewport);