From a44ec22793cffbf5fb7014c17c30dd03a8a212d9 Mon Sep 17 00:00:00 2001 From: jcasals <jcasals@iri.upc.edu> Date: Wed, 10 Jun 2020 11:07:05 +0200 Subject: [PATCH] Fix modernize-use-override warnings --- include/vision/capture/capture_image.h | 2 +- include/vision/factor/factor_ahp.h | 4 ++-- include/vision/factor/factor_epipolar.h | 4 ++-- include/vision/factor/factor_pixel_hp.h | 4 ++-- include/vision/factor/factor_trifocal.h | 4 ++-- include/vision/feature/feature_point_image.h | 2 +- include/vision/landmark/landmark_ahp.h | 4 ++-- include/vision/landmark/landmark_hp.h | 4 ++-- include/vision/landmark/landmark_point_3d.h | 2 +- .../processor/processor_bundle_adjustment.h | 20 ++++++++-------- .../processor_tracker_feature_image.h | 14 +++++------ .../processor_tracker_feature_trifocal.h | 24 +++++++++---------- .../processor_tracker_landmark_image.h | 14 +++++------ include/vision/sensor/sensor_camera.h | 4 ++-- test/gtest_factor_pixel_hp.cpp | 4 ++-- test/gtest_factor_trifocal.cpp | 6 ++--- 16 files changed, 58 insertions(+), 58 deletions(-) diff --git a/include/vision/capture/capture_image.h b/include/vision/capture/capture_image.h index 71dd7c939..c8a7f0d6b 100644 --- a/include/vision/capture/capture_image.h +++ b/include/vision/capture/capture_image.h @@ -37,7 +37,7 @@ class CaptureImage : public CaptureBase public: CaptureImage(const TimeStamp& _ts, SensorCameraPtr _camera_ptr, cv::Mat _data_cv); - virtual ~CaptureImage(); + ~CaptureImage() override; const cv::Mat& getImage() const; void setDescriptors(const cv::Mat &_descriptors); diff --git a/include/vision/factor/factor_ahp.h b/include/vision/factor/factor_ahp.h index b1a588900..ad23d04da 100644 --- a/include/vision/factor/factor_ahp.h +++ b/include/vision/factor/factor_ahp.h @@ -31,9 +31,9 @@ class FactorAhp : public FactorAutodiff<FactorAhp, 2, 3, 4, 3, 4, 4> bool _apply_loss_function, FactorStatus _status = FAC_ACTIVE); - virtual ~FactorAhp() = default; + ~FactorAhp() override = default; - virtual std::string getTopology() const override + std::string getTopology() const override { return std::string("LMK"); } diff --git a/include/vision/factor/factor_epipolar.h b/include/vision/factor/factor_epipolar.h index f6654884d..01bd843ce 100644 --- a/include/vision/factor/factor_epipolar.h +++ b/include/vision/factor/factor_epipolar.h @@ -19,9 +19,9 @@ class FactorEpipolar : public FactorAutodiff<FactorEpipolar, 1, 3, 4, 3, 4, 3, 4 bool _apply_loss_function, FactorStatus _status = FAC_ACTIVE); - virtual ~FactorEpipolar() = default; + ~FactorEpipolar() override = default; - virtual std::string getTopology() const override + std::string getTopology() const override { return std::string("GEOM"); } diff --git a/include/vision/factor/factor_pixel_hp.h b/include/vision/factor/factor_pixel_hp.h index 13f3d0cff..1980db7ad 100644 --- a/include/vision/factor/factor_pixel_hp.h +++ b/include/vision/factor/factor_pixel_hp.h @@ -30,9 +30,9 @@ class FactorPixelHp : public FactorAutodiff<FactorPixelHp, 2, 3, 4, 3, 4, 4> bool _apply_loss_function, FactorStatus _status = FAC_ACTIVE); - virtual ~FactorPixelHp() = default; + ~FactorPixelHp() override = default; - virtual std::string getTopology() const override + std::string getTopology() const override { return std::string("LMK"); } diff --git a/include/vision/factor/factor_trifocal.h b/include/vision/factor/factor_trifocal.h index 2c5a3f3ee..c3c762aac 100644 --- a/include/vision/factor/factor_trifocal.h +++ b/include/vision/factor/factor_trifocal.h @@ -31,9 +31,9 @@ class FactorTrifocal : public FactorAutodiff<FactorTrifocal, 3, 3, 4, 3, 4, 3, 4 /** \brief Class Destructor */ - virtual ~FactorTrifocal(); + ~FactorTrifocal() override; - virtual std::string getTopology() const override + std::string getTopology() const override { return std::string("GEOM"); } diff --git a/include/vision/feature/feature_point_image.h b/include/vision/feature/feature_point_image.h index b668b27b8..88ee24b19 100644 --- a/include/vision/feature/feature_point_image.h +++ b/include/vision/feature/feature_point_image.h @@ -56,7 +56,7 @@ class FeaturePointImage : public FeatureBase measurement_(1) = double(_keypoint.pt.y); } - virtual ~FeaturePointImage(); + ~FeaturePointImage() override; const cv::KeyPoint& getKeypoint() const; void setKeypoint(const cv::KeyPoint& _kp); diff --git a/include/vision/landmark/landmark_ahp.h b/include/vision/landmark/landmark_ahp.h index d6dd452bf..0fc10ebce 100644 --- a/include/vision/landmark/landmark_ahp.h +++ b/include/vision/landmark/landmark_ahp.h @@ -25,7 +25,7 @@ class LandmarkAhp : public LandmarkBase public: LandmarkAhp(Eigen::Vector4d _position_homogeneous, FrameBasePtr _anchor_frame, SensorBasePtr _anchor_sensor, cv::Mat _2d_descriptor); - virtual ~LandmarkAhp(); + ~LandmarkAhp() override; const cv::Mat& getCvDescriptor() const; void setCvDescriptor(const cv::Mat& _descriptor); @@ -39,7 +39,7 @@ class LandmarkAhp : public LandmarkBase Eigen::Vector3d getPointInAnchorSensor() const; Eigen::Vector3d point() const; - YAML::Node saveToYaml() const; + YAML::Node saveToYaml() const override; /** \brief Creator for Factory<LandmarkBase, YAML::Node> * Caution: This creator does not set the landmark's anchor frame and sensor. diff --git a/include/vision/landmark/landmark_hp.h b/include/vision/landmark/landmark_hp.h index 37c623304..eab9b9ea6 100644 --- a/include/vision/landmark/landmark_hp.h +++ b/include/vision/landmark/landmark_hp.h @@ -24,14 +24,14 @@ class LandmarkHp : public LandmarkBase public: LandmarkHp(Eigen::Vector4d _position_homogeneous, SensorBasePtr _sensor_, cv::Mat _2d_descriptor); - virtual ~LandmarkHp(); + ~LandmarkHp() override; const cv::Mat& getCvDescriptor() const; void setCvDescriptor(const cv::Mat& _descriptor); Eigen::Vector3d point() const; - YAML::Node saveToYaml() const; + YAML::Node saveToYaml() const override; /** \brief Creator for Factory<LandmarkBase, YAML::Node> * Caution: This creator does not set the landmark's sensor. diff --git a/include/vision/landmark/landmark_point_3d.h b/include/vision/landmark/landmark_point_3d.h index 1a5d5d1a6..45e9058c9 100644 --- a/include/vision/landmark/landmark_point_3d.h +++ b/include/vision/landmark/landmark_point_3d.h @@ -20,7 +20,7 @@ class LandmarkPoint3d : public LandmarkBase public: LandmarkPoint3d(Eigen::Vector3d _position, cv::Mat _2d_descriptor); - virtual ~LandmarkPoint3d(); + ~LandmarkPoint3d() override; const Eigen::Vector3d point() const; diff --git a/include/vision/processor/processor_bundle_adjustment.h b/include/vision/processor/processor_bundle_adjustment.h index 3e71775fe..4fa2bf52c 100644 --- a/include/vision/processor/processor_bundle_adjustment.h +++ b/include/vision/processor/processor_bundle_adjustment.h @@ -84,14 +84,14 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature ProcessorBundleAdjustment(ParamsProcessorBundleAdjustmentPtr _params_bundle_adjustment); /** \brief Class destructor */ - virtual ~ProcessorBundleAdjustment() + ~ProcessorBundleAdjustment() override { // } public: - virtual void configure(SensorBasePtr _sensor) override; + void configure(SensorBasePtr _sensor) override; /** Pre-process incoming Capture * @@ -104,7 +104,7 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * - initializing counters, flags, or any derived variables * - initializing algorithms needed for processing the derived data */ - virtual void preProcess() override; + void preProcess() override; /** Post-process * @@ -116,7 +116,7 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * - resetting and/or clearing variables and/or algorithms at the end of processing * - drawing / printing / logging the results of the processing */ - virtual void postProcess() override; + void postProcess() override; /** \brief Track provided features in \b _capture * \param _features_in input list of features in \b last to track @@ -126,7 +126,7 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * * \return the number of features tracked */ - virtual unsigned int trackFeatures(const FeatureBasePtrList& _features_in, + unsigned int trackFeatures(const FeatureBasePtrList& _features_in, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out, FeatureMatchMap& _feature_correspondences) override; @@ -136,7 +136,7 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * \param _incoming_feature input/output feature in incoming capture to be corrected * \return false if the the process discards the correspondence with origin's feature */ - virtual bool correctFeatureDrift(const FeatureBasePtr _origin_feature, const FeatureBasePtr _last_feature, FeatureBasePtr _incoming_feature) override; + bool correctFeatureDrift(const FeatureBasePtr _origin_feature, const FeatureBasePtr _last_feature, FeatureBasePtr _incoming_feature) override; /** \brief Vote for KeyFrame generation * @@ -145,7 +145,7 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * * WARNING! This function only votes! It does not create KeyFrames! */ - virtual bool voteForKeyFrame() const override; + bool voteForKeyFrame() const override; bool isInlier(const cv::KeyPoint& _kp_incoming, const cv::KeyPoint& _kp_last) const; @@ -167,7 +167,7 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_, * the list of newly detected features of the capture last_ptr_. */ - virtual unsigned int detectNewFeatures(const int& _max_new_features, + unsigned int detectNewFeatures(const int& _max_new_features, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out) override; @@ -179,13 +179,13 @@ class ProcessorBundleAdjustment : public ProcessorTrackerFeature * * This function emplaces a factor of the appropriate type for the derived processor. */ - virtual FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) override; + FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) override; virtual LandmarkBasePtr emplaceLandmark(FeatureBasePtr _feature_ptr); /** \brief Establish factors between features in Captures \b last and \b origin */ - virtual void establishFactors() override; + void establishFactors() override; void setParams(const ParamsProcessorBundleAdjustmentPtr _params); diff --git a/include/vision/processor/processor_tracker_feature_image.h b/include/vision/processor/processor_tracker_feature_image.h index 26f7d70a7..3666244d4 100644 --- a/include/vision/processor/processor_tracker_feature_image.h +++ b/include/vision/processor/processor_tracker_feature_image.h @@ -63,9 +63,9 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature std::list<cv::Point> tracker_target_; ProcessorTrackerFeatureImage(ParamsProcessorTrackerFeatureImagePtr _params_image); - virtual ~ProcessorTrackerFeatureImage(); + ~ProcessorTrackerFeatureImage() override; - virtual void configure(SensorBasePtr _sensor) override ; + void configure(SensorBasePtr _sensor) override ; protected: @@ -101,7 +101,7 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature * * \return the number of features tracked */ - virtual unsigned int trackFeatures(const FeatureBasePtrList& _features_in, + unsigned int trackFeatures(const FeatureBasePtrList& _features_in, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out, FeatureMatchMap& _feature_correspondences) override; @@ -111,7 +111,7 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature * \param _incoming_feature input/output feature in incoming capture to be corrected * \return false if the the process discards the correspondence with origin's feature */ - virtual bool correctFeatureDrift(const FeatureBasePtr _origin_feature, + bool correctFeatureDrift(const FeatureBasePtr _origin_feature, const FeatureBasePtr _last_feature, FeatureBasePtr _incoming_feature) override; @@ -122,7 +122,7 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature * * WARNING! This function only votes! It does not create KeyFrames! */ - virtual bool voteForKeyFrame() const override; + bool voteForKeyFrame() const override; /** \brief Detect new Features * \param _max_features maximum number of features detected (-1: unlimited. 0: none) @@ -140,7 +140,7 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_, * the list of newly detected features of the capture last_ptr_. */ - virtual unsigned int detectNewFeatures(const int& _max_new_features, + unsigned int detectNewFeatures(const int& _max_new_features, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out) override; @@ -152,7 +152,7 @@ class ProcessorTrackerFeatureImage : public ProcessorTrackerFeature * * This function emplaces a factor of the appropriate type for the derived processor. */ - virtual FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) override; + FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) override; private: diff --git a/include/vision/processor/processor_tracker_feature_trifocal.h b/include/vision/processor/processor_tracker_feature_trifocal.h index 7164fd809..9c3f86e80 100644 --- a/include/vision/processor/processor_tracker_feature_trifocal.h +++ b/include/vision/processor/processor_tracker_feature_trifocal.h @@ -80,8 +80,8 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature /** \brief Class Destructor */ - virtual ~ProcessorTrackerFeatureTrifocal(); - virtual void configure(SensorBasePtr _sensor) override; + ~ProcessorTrackerFeatureTrifocal() override; + void configure(SensorBasePtr _sensor) override; /** \brief Track provided features in \b _capture * \param _features_in input list of features in \b last to track @@ -91,7 +91,7 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature * * \return the number of features tracked */ - virtual unsigned int trackFeatures(const FeatureBasePtrList& _features_in, + unsigned int trackFeatures(const FeatureBasePtrList& _features_in, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out, FeatureMatchMap& _feature_correspondences) override; @@ -101,7 +101,7 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature * \param _incoming_feature input/output feature in incoming capture to be corrected * \return false if the the process discards the correspondence with origin's feature */ - virtual bool correctFeatureDrift(const FeatureBasePtr _origin_feature, const FeatureBasePtr _last_feature, FeatureBasePtr _incoming_feature) override; + bool correctFeatureDrift(const FeatureBasePtr _origin_feature, const FeatureBasePtr _last_feature, FeatureBasePtr _incoming_feature) override; /** \brief Vote for KeyFrame generation * @@ -110,7 +110,7 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature * * WARNING! This function only votes! It does not create KeyFrames! */ - virtual bool voteForKeyFrame() const override; + bool voteForKeyFrame() const override; /** \brief Detect new Features * \param _max_features maximum number of features detected (-1: unlimited. 0: none) @@ -123,7 +123,7 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_, * the list of newly detected features of the capture last_ptr_. */ - virtual unsigned int detectNewFeatures(const int& _max_new_features, + unsigned int detectNewFeatures(const int& _max_new_features, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out) override; @@ -133,33 +133,33 @@ class ProcessorTrackerFeatureTrifocal : public ProcessorTrackerFeature * * This function emplaces a factor of the appropriate type for the derived processor. */ - virtual FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) override; + FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, FeatureBasePtr _feature_other_ptr) override; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** \brief advance pointers * */ - virtual void advanceDerived() override; + void advanceDerived() override; /** \brief reset pointers and match lists at KF creation * */ - virtual void resetDerived() override; + void resetDerived() override; /** \brief Pre-process: check if all captures (prev-origin, origin, last) are initialized to allow factors creation * */ - virtual void preProcess() override; + void preProcess() override; /** \brief Post-process * */ - virtual void postProcess() override; + void postProcess() override; /** \brief Establish factors between features in Captures \b last and \b origin */ - virtual void establishFactors() override; + void establishFactors() override; CaptureBasePtr getPrevOrigin(); diff --git a/include/vision/processor/processor_tracker_landmark_image.h b/include/vision/processor/processor_tracker_landmark_image.h index 6ac70e957..ae3f6083f 100644 --- a/include/vision/processor/processor_tracker_landmark_image.h +++ b/include/vision/processor/processor_tracker_landmark_image.h @@ -79,9 +79,9 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark FeatureBasePtrList feat_lmk_found_; ProcessorTrackerLandmarkImage(ParamsProcessorTrackerLandmarkImagePtr _params_tracker_landmark_image); - virtual ~ProcessorTrackerLandmarkImage(); + ~ProcessorTrackerLandmarkImage() override; - virtual void configure(SensorBasePtr _sensor) override; + void configure(SensorBasePtr _sensor) override; protected: @@ -117,7 +117,7 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark * * \return the number of landmarks found */ - virtual unsigned int findLandmarks(const LandmarkBasePtrList& _landmarks_in, + unsigned int findLandmarks(const LandmarkBasePtrList& _landmarks_in, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out, LandmarkMatchMap& _feature_landmark_correspondences) override; @@ -129,7 +129,7 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark * * WARNING! This function only votes! It does not create KeyFrames! */ - virtual bool voteForKeyFrame() const override; + bool voteForKeyFrame() const override; /** \brief Detect new Features * \param _max_features maximum number of features detected (-1: unlimited. 0: none) @@ -147,13 +147,13 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark * The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_, * the list of newly detected features of the capture last_ptr_. */ - virtual unsigned int detectNewFeatures(const int& _max_new_features, + unsigned int detectNewFeatures(const int& _max_new_features, const CaptureBasePtr& _capture, FeatureBasePtrList& _features_out) override; /** \brief Emplaces one landmark */ - virtual LandmarkBasePtr emplaceLandmark(FeatureBasePtr _feature_ptr) override; + LandmarkBasePtr emplaceLandmark(FeatureBasePtr _feature_ptr) override; public: static ProcessorBasePtr create(const std::string& _unique_name, const ParamsProcessorBasePtr _params); @@ -162,7 +162,7 @@ class ProcessorTrackerLandmarkImage : public ProcessorTrackerLandmark * \param _feature_ptr pointer to the Feature to constrain * \param _landmark_ptr LandmarkBase pointer to the Landmark constrained. */ - virtual FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, LandmarkBasePtr _landmark_ptr) override; + FactorBasePtr emplaceFactor(FeatureBasePtr _feature_ptr, LandmarkBasePtr _landmark_ptr) override; //Other functions private: diff --git a/include/vision/sensor/sensor_camera.h b/include/vision/sensor/sensor_camera.h index 8b9039b82..7ee6529d3 100644 --- a/include/vision/sensor/sensor_camera.h +++ b/include/vision/sensor/sensor_camera.h @@ -40,7 +40,7 @@ struct ParamsSensorCamera : public ParamsSensorBase + "pinhole: " + converter<std::string>::convert(pinhole_model_rectified) + "\n" + "distortion: " + converter<std::string>::convert(distortion) + "\n"; } - virtual ~ParamsSensorCamera() = default; + ~ParamsSensorCamera() override = default; }; WOLF_PTR_TYPEDEFS(SensorCamera); @@ -53,7 +53,7 @@ class SensorCamera : public SensorBase SensorCamera(const Eigen::VectorXd & _extrinsics, const ParamsSensorCamera& _intrinsics); SensorCamera(const Eigen::VectorXd & _extrinsics, ParamsSensorCameraPtr _intrinsics_ptr); - virtual ~SensorCamera(); + ~SensorCamera() override; Eigen::VectorXd getDistortionVector() { return distortion_; } Eigen::VectorXd getCorrectionVector() { return correction_; } diff --git a/test/gtest_factor_pixel_hp.cpp b/test/gtest_factor_pixel_hp.cpp index 1fb23ab21..6246b8683 100644 --- a/test/gtest_factor_pixel_hp.cpp +++ b/test/gtest_factor_pixel_hp.cpp @@ -57,12 +57,12 @@ class FactorPixelHpTest : public testing::Test{ double pixel_noise_std; - virtual ~FactorPixelHpTest() + ~FactorPixelHpTest() override { std::cout << "destructor\n"; } - virtual void SetUp() override + void SetUp() override { // configuration /* diff --git a/test/gtest_factor_trifocal.cpp b/test/gtest_factor_trifocal.cpp index ba1fb43dc..418fba909 100644 --- a/test/gtest_factor_trifocal.cpp +++ b/test/gtest_factor_trifocal.cpp @@ -33,12 +33,12 @@ class FactorTrifocalTest : public testing::Test{ double pixel_noise_std; - virtual ~FactorTrifocalTest() + ~FactorTrifocalTest() override { std::cout << "destructor\n"; } - virtual void SetUp() override + void SetUp() override { std::string wolf_root = _WOLF_VISION_ROOT_DIR; @@ -694,7 +694,7 @@ class FactorTrifocalMultiPointTest : public FactorTrifocalTest std::vector<FeatureBasePtr> fv1, fv2, fv3; std::vector<FactorTrifocalPtr> cv123; - virtual void SetUp() override + void SetUp() override { FactorTrifocalTest::SetUp(); -- GitLab