diff --git a/include/vision/capture/capture_image.h b/include/vision/capture/capture_image.h index 71dd7c9392cffdb127ae12cc2acc1b4f9efb568e..c8a7f0d6b8d4abf0dec83a6f0ebaec4684dae7f6 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 b1a58890015ec8f7688307d5eb64359743d9b67c..ad23d04da1690759bb034f0235bd3be701aa1d52 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 f6654884dca7183e1264934ee7d95ca90aaea83a..01bd843cec516297ccec73990d7a95d3f175c46a 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 13f3d0cff4241218dd3f4d0e814cda409b741bfc..1980db7ad53ea619d68ad95e0b05e0dc01839b46 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 2c5a3f3ee7cea9096e756e98ad69bc16633876b6..c3c762aac9b0bf946a9e4a3e1c63e7c6227f2295 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 b668b27b8de6967df985468f37c1e18d9b7795aa..88ee24b19cb1a40e9fc6f66f7007e5e70dec3863 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 d6dd452bfe09968a2734fd5d2fb523a008c5113a..0fc10ebcea28766c6199d188d969bd73d0b8d55a 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 37c623304608be3a01ad64c583692f7f78a58632..eab9b9ea653d3407034c72e2c18600239ade38c0 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 1a5d5d1a640956f74258fb913d28b1e6ca3fe5e5..45e9058c9f1fb068195f30e71140011cc82c822b 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 3e71775fed8bc01d3dc0fc083f3c39eaa3a3b933..4fa2bf52c00660403cf690ef90e9a91e1326d9f4 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 26f7d70a7265080e86b905e304eab47810950a2a..3666244d467421c5444ff8c39a3a025c664264dc 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 7164fd8098f8df57e86207073d269fa06b3bf343..9c3f86e80edf324bc5a84047d6bb590a8ce0aa37 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 6ac70e9574a4c1da0c435b921a17c471dfda7e86..ae3f6083f69082b8ee4bd3589cd1a3576114f583 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 8b9039b82e6c9f5883438e3d9f33a6459e57fa0c..7ee6529d355355928a2d439602b35dbffceacd59 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 1fb23ab2198132a226a7a36fcbbd98fded0acb94..6246b8683f3f2f070bfc7841992b371a22d9b651 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 ba1fb43dc727bfdefd5fe3c4fac1231e06243116..418fba90985df939863b37f37e91c28b0746ab5b 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();