From b384ff5b4b16012b010bb4fddd338dd3fd8d3ce0 Mon Sep 17 00:00:00 2001 From: Ugo Pattacini Date: Sun, 11 Oct 2020 14:37:49 +0000 Subject: [PATCH] code cleanup --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d7bb852..401ca9a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -221,7 +221,7 @@ class GrasperModule : public RFModule, public rpc_IDL { vector objects_names{"mustard_bottle", "pudding_box"}; for (const auto& object_name:objects_names) { - objMoverPorts.push_back(make_pair(object_name, shared_ptr>(new BufferedPort()))); + objMoverPorts.push_back(make_pair(object_name, make_shared>())); objMoverPorts.back().second->open("/"+name+"/"+object_name+"/mover:o"); } @@ -231,7 +231,7 @@ class GrasperModule : public RFModule, public rpc_IDL { rpcPort.open("/"+name+"/rpc"); attach(rpcPort); - viewer = unique_ptr(new Viewer(10, 370, 350, 350)); + viewer = make_unique(10, 370, 350, 350); viewer->start(); return true; @@ -341,7 +341,7 @@ class GrasperModule : public RFModule, public rpc_IDL { const auto view_angle = 2. * std::atan((w / 2.) / fov_h) * (180. / M_PI); // aggregate image data in the point cloud of the whole scene - pc_scene = shared_ptr>(new yarp::sig::PointCloud); + pc_scene = make_shared>(); Vector x{0., 0., 0., 1.}; for (int v = 0; v < h; v++) { for (int u = 0; u < w; u++) { @@ -370,8 +370,8 @@ class GrasperModule : public RFModule, public rpc_IDL { //savePCL("/workspace/pc_scene.off", pc_scene); // segment out the table and the object - pc_table = shared_ptr>(new yarp::sig::PointCloud); - pc_object = shared_ptr>(new yarp::sig::PointCloud); + pc_table = make_shared>(); + pc_object = make_shared>(); table_height = Segmentation::RANSAC(pc_scene, pc_table, pc_object); if (isnan(table_height)) { yError() << "Segmentation failed!";