Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

From new to pcl::make_shared using clang-tidy #3206

Closed
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
8913082
apps: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
1e4f25a
common: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
a2000ed
examples: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
62337b2
filters: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
53733f6
io: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
cb27660
keypoints: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
6a8ef83
outofcore: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
3946e1f
people: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
5d3da10
recognition: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
baa4275
registration: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
a9afd0b
search: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
502fe5f
segmentation: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
5b7153e
simulation: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
65ea25a
surface: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
bd7e25e
test: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
c559213
tools: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
f0a1cd7
tracking: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
e949c49
visualization: clang-tidy from new boost::shared_ptr to pcl::make_shared
Jul 4, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
recognition: clang-tidy from new boost::shared_ptr to pcl::make_shared
Andrea Ponza committed Jul 12, 2019
commit 5d3da10249d4971a73190977ae0aa6ede5d39573
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "pcl/recognition/face_detection/face_detector_data_provider.h"
#include <pcl/make_shared.h>
#include "pcl/recognition/face_detection/face_common.h"
#include <pcl/common/time.h>
#include <pcl/features/integral_image_normal.h>
@@ -246,7 +247,7 @@ void pcl::face_detection::FaceDetectorDataProvider<FeatureType, DataSet, LabelTy

//Compute integral image over depth
pcl::IntegralImage2D<float, 1>::Ptr integral_image_depth;
integral_image_depth.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_depth = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);

int element_stride = sizeof(pcl::PointXYZ) / sizeof(float);
int row_stride = element_stride * cloud->width;
@@ -277,15 +278,15 @@ void pcl::face_detection::FaceDetectorDataProvider<FeatureType, DataSet, LabelTy

if (USE_NORMALS_)
{
integral_image_normal_x.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_normal_x = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);
const float *data_nx = reinterpret_cast<const float*> (&normals->points[0]);
integral_image_normal_x->setInput (data_nx, normals->width, normals->height, element_stride_normal, row_stride_normal);

integral_image_normal_y.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_normal_y = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);
const float *data_ny = reinterpret_cast<const float*> (&normals->points[0]);
integral_image_normal_y->setInput (data_ny + 1, normals->width, normals->height, element_stride_normal, row_stride_normal);

integral_image_normal_z.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_normal_z = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);
const float *data_nz = reinterpret_cast<const float*> (&normals->points[0]);
integral_image_normal_z->setInput (data_nz + 2, normals->width, normals->height, element_stride_normal, row_stride_normal);
}
35 changes: 18 additions & 17 deletions recognition/src/face_detection/rf_face_detector_trainer.cpp
Original file line number Diff line number Diff line change
@@ -6,21 +6,22 @@
*/

#include "pcl/recognition/face_detection/rf_face_detector_trainer.h"
#include "pcl/recognition/face_detection/face_common.h"
#include "pcl/filters/passthrough.h"
#include "pcl/filters/voxel_grid.h"
#include "pcl/io/pcd_io.h"
#include "pcl/ml/dt/decision_tree_trainer.h"
#include "pcl/ml/dt/decision_tree_evaluator.h"
#include "pcl/ml/dt/decision_forest_trainer.h"
#include <pcl/make_shared.h>
#include "pcl/ml/dt/decision_forest_evaluator.h"
#include "pcl/filters/passthrough.h"
#include "pcl/ml/dt/decision_forest_trainer.h"
#include "pcl/ml/dt/decision_tree_evaluator.h"
#include "pcl/ml/dt/decision_tree_trainer.h"
#include "pcl/recognition/face_detection/face_common.h"
#include <pcl/features/integral_image_normal.h>
#include <pcl/registration/icp.h>
#include <pcl/registration/transformation_estimation_point_to_plane_lls.h>
#include <pcl/features/normal_3d.h>
#include <pcl/recognition/hv/hv_papazov.h>
#include <pcl/registration/correspondence_estimation_normal_shooting.h>
#include <pcl/registration/correspondence_rejection_sample_consensus.h>
#include "pcl/filters/voxel_grid.h"
#include <pcl/recognition/hv/hv_papazov.h>
#include <pcl/features/normal_3d.h>
#include <pcl/registration/icp.h>
#include <pcl/registration/transformation_estimation_point_to_plane_lls.h>

void pcl::RFFaceDetectorTrainer::trainWithDataProvider()
{
@@ -50,7 +51,7 @@ void pcl::RFFaceDetectorTrainer::trainWithDataProvider()
dft.setThresholds (thresholds_);

typename face_detection::FaceDetectorDataProvider<face_detection::FeatureType, std::vector<face_detection::TrainingExample>, float, int, NodeType>::Ptr dtdp;
dtdp.reset (new face_detection::FaceDetectorDataProvider<face_detection::FeatureType, std::vector<face_detection::TrainingExample>, float, int, NodeType>);
dtdp = pcl::make_shared<face_detection::FaceDetectorDataProvider<face_detection::FeatureType, std::vector<face_detection::TrainingExample>, float, int, NodeType>> ();
dtdp->setUseNormals (use_normals_);
dtdp->setWSize (w_size_);
dtdp->setNumImages (num_images_);
@@ -230,7 +231,7 @@ void pcl::RFFaceDetectorTrainer::setModelPath(std::string & model)
pcl::PointCloud<pcl::PointXYZ>::Ptr model_cloud (new pcl::PointCloud<pcl::PointXYZ> ());
pcl::io::loadPCDFile (model_path_, *model_cloud);

model_original_.reset (new pcl::PointCloud<pcl::PointXYZ> ());
model_original_ = pcl::make_shared<pcl::PointCloud<pcl::PointXYZ>> ();

{
pcl::VoxelGrid<pcl::PointXYZ> voxel_grid_icp;
@@ -270,7 +271,7 @@ void pcl::RFFaceDetectorTrainer::detectFaces()

//compute depth integral image
pcl::IntegralImage2D<float, 1>::Ptr integral_image_depth;
integral_image_depth.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_depth = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);

int element_stride = sizeof(pcl::PointXYZ) / sizeof(float);
int row_stride = element_stride * cloud->width;
@@ -299,15 +300,15 @@ void pcl::RFFaceDetectorTrainer::detectFaces()

if (use_normals_)
{
integral_image_normal_x.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_normal_x = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);
const float *data_nx = reinterpret_cast<const float*> (&normals->points[0]);
integral_image_normal_x->setInput (data_nx, normals->width, normals->height, element_stride_normal, row_stride_normal);

integral_image_normal_y.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_normal_y = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);
const float *data_ny = reinterpret_cast<const float*> (&normals->points[0]);
integral_image_normal_y->setInput (data_ny + 1, normals->width, normals->height, element_stride_normal, row_stride_normal);

integral_image_normal_z.reset (new pcl::IntegralImage2D<float, 1> (false));
integral_image_normal_z = pcl::make_shared<pcl::IntegralImage2D<float, 1>> (false);
const float *data_nz = reinterpret_cast<const float*> (&normals->points[0]);
integral_image_normal_z->setInput (data_nz + 2, normals->width, normals->height, element_stride_normal, row_stride_normal);
}
@@ -410,7 +411,7 @@ void pcl::RFFaceDetectorTrainer::detectFaces()

if (face_heat_map_)
{
face_heat_map_.reset (new pcl::PointCloud<pcl::PointXYZI>);
face_heat_map_ = pcl::make_shared<pcl::PointCloud<pcl::PointXYZI>> ();
face_heat_map_->resize (cloud->points.size ());
face_heat_map_->height = 1;
face_heat_map_->width = static_cast<unsigned int>(cloud->points.size ());
4 changes: 3 additions & 1 deletion recognition/src/ransac_based/obj_rec_ransac.cpp
Original file line number Diff line number Diff line change
@@ -40,6 +40,8 @@
#include <pcl/common/random.h>
#include <pcl/recognition/ransac_based/obj_rec_ransac.h>

#include <pcl/make_shared.h>

using namespace std;
using namespace pcl::common;

@@ -77,7 +79,7 @@ pcl::recognition::ObjRecRANSAC::recognize (const PointCloudIn& scene, const Poin
scene_octree_proj_.build(scene_octree_, abs_zdist_thresh_, abs_zdist_thresh_);

// Needed only if icp hypotheses refinement is to be performed
scene_octree_points_ = PointCloudIn::Ptr (new PointCloudIn ());
scene_octree_points_ = pcl::make_shared<PointCloudIn>();
// First, get the scene octree points
scene_octree_.getFullLeavesPoints (*scene_octree_points_);