Skip to content

Commit 4a389e1

Browse files
authored
Part H of transition to support modernize-use-default-member-init (#5899)
* Part H of transition to support modernize-use-default-member-init * Updated per inspection * Corrected formatting complaints * Addressed CI clang-tidy issues * Fixed another CI clang-tidy complaint * Fixed yet more CI clang-tidy issues * Made changes per review * Fixed some typos * Addressed more review changes * Fixed new clang-tidy CI complaints * Fixed clang-format CI complaint * Fixed another piecemeal clang-format complaint * Made more changes per review * Fixed missed review comment
1 parent eccdbe8 commit 4a389e1

File tree

66 files changed

+352
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+352
-536
lines changed

.clang-tidy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Checks: >
1212
modernize-return-braced-init-list,
1313
modernize-shrink-to-fit,
1414
modernize-use-auto,
15+
modernize-use-bool-literals,
16+
modernize-use-default-member-init,
1517
modernize-use-emplace,
1618
modernize-use-equals-default,
1719
modernize-use-equals-delete,

features/include/pcl/features/cvfh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ namespace pcl
212212
/** \brief Values describing the viewpoint ("pinhole" camera model assumed).
213213
* By default, the viewpoint is set to 0,0,0.
214214
*/
215-
float vpx_{0}, vpy_{0}, vpz_{0};
215+
float vpx_{0.0f}, vpy_{0.0f}, vpz_{0.0f};
216216

217217
/** \brief Size of the voxels after voxel gridding. IMPORTANT: Must match the voxel
218218
* size of the training data or the normalize_bins_ flag must be set to true.

features/include/pcl/features/impl/esf.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,18 @@ pcl::ESFEstimation<PointInT, PointOutT>::computeESF (
6666
wt_d2.reserve (sample_size * 3);
6767
wt_d3.reserve (sample_size);
6868

69-
float h_in[binsize] = {0};
70-
float h_out[binsize] = {0};
71-
float h_mix[binsize] = {0};
72-
float h_mix_ratio[binsize] = {0};
73-
74-
float h_a3_in[binsize] = {0};
75-
float h_a3_out[binsize] = {0};
76-
float h_a3_mix[binsize] = {0};
77-
78-
float h_d3_in[binsize] = {0};
79-
float h_d3_out[binsize] = {0};
80-
float h_d3_mix[binsize] = {0};
69+
float h_in[binsize] = {0.0f};
70+
float h_out[binsize] = {0.0f};
71+
float h_mix[binsize] = {0.0f};
72+
float h_mix_ratio[binsize] = {0.0f};
73+
74+
float h_a3_in[binsize] = {0.0f};
75+
float h_a3_out[binsize] = {0.0f};
76+
float h_a3_mix[binsize] = {0.0f};
77+
78+
float h_d3_in[binsize] = {0.0f};
79+
float h_d3_out[binsize] = {0.0f};
80+
float h_d3_mix[binsize] = {0.0f};
8181

8282
float ratio=0.0;
8383
float pih = static_cast<float>(M_PI) / 2.0f;

io/include/pcl/io/ensenso_grabber.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,13 +443,13 @@ namespace pcl
443443
boost::signals2::signal<sig_cb_ensenso_point_cloud_images>* point_cloud_images_signal_;
444444

445445
/** @brief Whether an Ensenso device is opened or not */
446-
bool device_open_;
446+
bool device_open_{false};
447447

448448
/** @brief Whether an TCP port is opened or not */
449-
bool tcp_open_;
449+
bool tcp_open_{false};
450450

451451
/** @brief Whether an Ensenso device is running or not */
452-
bool running_;
452+
bool running_{false};
453453

454454
/** @brief Point cloud capture/processing frequency */
455455
pcl::EventFrequency frequency_;

io/include/pcl/io/openni2/openni2_device.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -315,16 +315,16 @@ namespace pcl
315315
mutable std::vector<OpenNI2VideoMode> color_video_modes_;
316316
mutable std::vector<OpenNI2VideoMode> depth_video_modes_;
317317

318-
bool ir_video_started_;
319-
bool color_video_started_;
320-
bool depth_video_started_;
318+
bool ir_video_started_{false};
319+
bool color_video_started_{false};
320+
bool depth_video_started_{false};
321321

322322
/** \brief distance between the projector and the IR camera in meters*/
323-
float baseline_;
323+
float baseline_{0.0f};
324324
/** the value for shadow (occluded pixels) */
325-
std::uint64_t shadow_value_;
325+
std::uint64_t shadow_value_{0};
326326
/** the value for pixels without a valid disparity measurement */
327-
std::uint64_t no_sample_value_;
327+
std::uint64_t no_sample_value_{0};
328328
};
329329

330330
PCL_EXPORTS std::ostream& operator<< (std::ostream& stream, const OpenNI2Device& device);

io/include/pcl/io/openni2_grabber.h

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,9 @@ namespace pcl
421421
convertToXYZIPointCloud (const pcl::io::openni2::IRImage::Ptr &image,
422422
const pcl::io::openni2::DepthImage::Ptr &depth_image);
423423

424-
std::vector<std::uint8_t> color_resize_buffer_;
425-
std::vector<std::uint16_t> depth_resize_buffer_;
426-
std::vector<std::uint16_t> ir_resize_buffer_;
424+
std::vector<std::uint8_t> color_resize_buffer_{};
425+
std::vector<std::uint16_t> depth_resize_buffer_{};
426+
std::vector<std::uint16_t> ir_resize_buffer_{};
427427

428428
// Stream callbacks /////////////////////////////////////////////////////
429429
void
@@ -444,25 +444,25 @@ namespace pcl
444444

445445
std::string rgb_frame_id_;
446446
std::string depth_frame_id_;
447-
unsigned image_width_;
448-
unsigned image_height_;
449-
unsigned depth_width_;
450-
unsigned depth_height_;
451-
452-
bool image_required_;
453-
bool depth_required_;
454-
bool ir_required_;
455-
bool sync_required_;
456-
457-
boost::signals2::signal<sig_cb_openni_image>* image_signal_;
458-
boost::signals2::signal<sig_cb_openni_depth_image>* depth_image_signal_;
459-
boost::signals2::signal<sig_cb_openni_ir_image>* ir_image_signal_;
460-
boost::signals2::signal<sig_cb_openni_image_depth_image>* image_depth_image_signal_;
461-
boost::signals2::signal<sig_cb_openni_ir_depth_image>* ir_depth_image_signal_;
462-
boost::signals2::signal<sig_cb_openni_point_cloud>* point_cloud_signal_;
463-
boost::signals2::signal<sig_cb_openni_point_cloud_i>* point_cloud_i_signal_;
464-
boost::signals2::signal<sig_cb_openni_point_cloud_rgb>* point_cloud_rgb_signal_;
465-
boost::signals2::signal<sig_cb_openni_point_cloud_rgba>* point_cloud_rgba_signal_;
447+
unsigned image_width_{0};
448+
unsigned image_height_{0};
449+
unsigned depth_width_{0};
450+
unsigned depth_height_{0};
451+
452+
bool image_required_{false};
453+
bool depth_required_{false};
454+
bool ir_required_{false};
455+
bool sync_required_{false};
456+
457+
boost::signals2::signal<sig_cb_openni_image>* image_signal_{};
458+
boost::signals2::signal<sig_cb_openni_depth_image>* depth_image_signal_{};
459+
boost::signals2::signal<sig_cb_openni_ir_image>* ir_image_signal_{};
460+
boost::signals2::signal<sig_cb_openni_image_depth_image>* image_depth_image_signal_{};
461+
boost::signals2::signal<sig_cb_openni_ir_depth_image>* ir_depth_image_signal_{};
462+
boost::signals2::signal<sig_cb_openni_point_cloud>* point_cloud_signal_{};
463+
boost::signals2::signal<sig_cb_openni_point_cloud_i>* point_cloud_i_signal_{};
464+
boost::signals2::signal<sig_cb_openni_point_cloud_rgb>* point_cloud_rgb_signal_{};
465+
boost::signals2::signal<sig_cb_openni_point_cloud_rgba>* point_cloud_rgba_signal_{};
466466

467467
struct modeComp
468468
{
@@ -483,14 +483,13 @@ namespace pcl
483483
// Mapping from config (enum) modes to native OpenNI modes
484484
std::map<int, pcl::io::openni2::OpenNI2VideoMode> config2oni_map_;
485485

486-
pcl::io::openni2::OpenNI2Device::CallbackHandle depth_callback_handle_;
487-
pcl::io::openni2::OpenNI2Device::CallbackHandle image_callback_handle_;
488-
pcl::io::openni2::OpenNI2Device::CallbackHandle ir_callback_handle_;
489-
bool running_;
486+
pcl::io::openni2::OpenNI2Device::CallbackHandle depth_callback_handle_{};
487+
pcl::io::openni2::OpenNI2Device::CallbackHandle image_callback_handle_{};
488+
pcl::io::openni2::OpenNI2Device::CallbackHandle ir_callback_handle_{};
489+
bool running_{false};
490490

491-
492-
CameraParameters rgb_parameters_;
493-
CameraParameters depth_parameters_;
491+
CameraParameters rgb_parameters_{std::numeric_limits<double>::quiet_NaN ()};
492+
CameraParameters depth_parameters_{std::numeric_limits<double>::quiet_NaN ()};
494493

495494
public:
496495
PCL_MAKE_ALIGNED_OPERATOR_NEW

io/include/pcl/io/real_sense_2_grabber.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,17 @@ namespace pcl
199199
/** \brief Repeat playback when reading from file */
200200
bool repeat_playback_;
201201
/** \brief controlling the state of the thread. */
202-
bool quit_;
202+
bool quit_{false};
203203
/** \brief Is the grabber running. */
204-
bool running_;
204+
bool running_{false};
205205
/** \brief Calculated FPS for the grabber. */
206-
float fps_;
206+
float fps_{0.0f};
207207
/** \brief Width for the depth and color sensor. Default 424*/
208-
std::uint32_t device_width_;
208+
std::uint32_t device_width_{424};
209209
/** \brief Height for the depth and color sensor. Default 240 */
210-
std::uint32_t device_height_;
210+
std::uint32_t device_height_{240};
211211
/** \brief Target FPS for the device. Default 30. */
212-
std::uint32_t target_fps_;
212+
std::uint32_t target_fps_{30};
213213
/** \brief Declare pointcloud object, for calculating pointclouds and texture mappings */
214214
rs2::pointcloud pc_;
215215
/** \brief Declare RealSense pipeline, encapsulating the actual device and sensors */

io/src/ensenso_grabber.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ ensensoExceptionHandling (const NxLibException& ex,
6262
}
6363

6464
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
65-
pcl::EnsensoGrabber::EnsensoGrabber () :
66-
device_open_ (false),
67-
tcp_open_ (false),
68-
running_ (false)
65+
pcl::EnsensoGrabber::EnsensoGrabber ()
6966
{
7067
point_cloud_signal_ = createSignal<sig_cb_ensenso_point_cloud> ();
7168
images_signal_ = createSignal<sig_cb_ensenso_images> ();

io/src/openni2/openni2_device.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ using namespace pcl::io::openni2;
4848
using openni::VideoMode;
4949
using std::vector;
5050

51-
pcl::io::openni2::OpenNI2Device::OpenNI2Device (const std::string& device_URI) :
52-
ir_video_started_(false),
53-
color_video_started_(false),
54-
depth_video_started_(false)
51+
pcl::io::openni2::OpenNI2Device::OpenNI2Device (const std::string& device_URI)
5552
{
5653
openni::Status status = openni::OpenNI::initialize ();
5754
if (status != openni::STATUS_OK)

io/src/openni2_grabber.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -73,24 +73,6 @@ namespace
7373

7474
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
7575
pcl::io::OpenNI2Grabber::OpenNI2Grabber (const std::string& device_id, const Mode& depth_mode, const Mode& image_mode)
76-
: color_resize_buffer_(0)
77-
, depth_resize_buffer_(0)
78-
, ir_resize_buffer_(0)
79-
, image_width_ ()
80-
, image_height_ ()
81-
, depth_width_ ()
82-
, depth_height_ ()
83-
, image_required_ (false)
84-
, depth_required_ (false)
85-
, ir_required_ (false)
86-
, sync_required_ (false)
87-
, image_signal_ (), depth_image_signal_ (), ir_image_signal_ (), image_depth_image_signal_ ()
88-
, ir_depth_image_signal_ (), point_cloud_signal_ (), point_cloud_i_signal_ ()
89-
, point_cloud_rgb_signal_ (), point_cloud_rgba_signal_ ()
90-
, depth_callback_handle_ (), image_callback_handle_ (), ir_callback_handle_ ()
91-
, running_ (false)
92-
, rgb_parameters_(std::numeric_limits<double>::quiet_NaN () )
93-
, depth_parameters_(std::numeric_limits<double>::quiet_NaN () )
9476
{
9577
// initialize driver
9678
updateModeMaps (); // registering mapping from PCL enum modes to openni::VideoMode and vice versa

0 commit comments

Comments
 (0)