diff --git a/demos/hello_wolf/hello_wolf.cpp b/demos/hello_wolf/hello_wolf.cpp index 63bb828ae09e29940b94aa7df96412336882c134..42d6242d3bfb0618f3e9fafef6fefc4ebf35a477 100644 --- a/demos/hello_wolf/hello_wolf.cpp +++ b/demos/hello_wolf/hello_wolf.cpp @@ -150,7 +150,7 @@ int main() params_prc_odo["keyframe_vote"]["max_time_span"] = 999; params_prc_odo["keyframe_vote"]["max_dist_traveled"] = 0.95; // Will make KFs automatically every 1m displacement params_prc_odo["keyframe_vote"]["max_angle_turned"] = 999; - params_prc_odo["keyframe_vote"]["cov_det"] = 999; + params_prc_odo["keyframe_vote"]["max_cov_det"] = 999; params_prc_odo["keyframe_vote"]["max_buff_length"] = 999; params_prc_odo["state_provider"] = true; params_prc_odo["state_provider_order"] = 1; diff --git a/demos/hello_wolf/yaml/processor_odom_2d.yaml b/demos/hello_wolf/yaml/processor_odom_2d.yaml index 6d9e0e8867ea8bef83d321c215e21dc9e9a983e3..84e7788781c415468037df01eb014de3d75f29c9 100644 --- a/demos/hello_wolf/yaml/processor_odom_2d.yaml +++ b/demos/hello_wolf/yaml/processor_odom_2d.yaml @@ -8,7 +8,7 @@ keyframe_vote: max_dist_traveled: 0.95 max_angle_turned: 999 max_buff_length: 999 - cov_det: 999 + max_cov_det: 999 apply_loss_function: true state_provider: true diff --git a/include/core/processor/processor_odom_2d.h b/include/core/processor/processor_odom_2d.h index db05b1425a220be78593cec062493849c72b004a..3746ff05623d6d2b6f5b522e226356221bc65200 100644 --- a/include/core/processor/processor_odom_2d.h +++ b/include/core/processor/processor_odom_2d.h @@ -34,12 +34,12 @@ class ProcessorOdom2d : public ProcessorMotion public: ProcessorOdom2d(const YAML::Node& _params); ~ProcessorOdom2d() override; - void configure(SensorBasePtr _sensor) override{}; + void configure(SensorBasePtr _sensor) override {}; // Factory method for high level API WOLF_PROCESSOR_CREATE(ProcessorOdom2d); - double getCovDet() const; + double getMaxCovDet() const; bool voteForKeyFrame() const override; protected: @@ -101,9 +101,9 @@ inline VectorXd ProcessorOdom2d::getCalibration(const CaptureBaseConstPtr _captu inline void ProcessorOdom2d::setCalibration(const CaptureBasePtr _capture, const VectorXd& _calibration) {} -inline double ProcessorOdom2d::getCovDet() const +inline double ProcessorOdom2d::getMaxCovDet() const { - return params_["keyframe_vote"]["cov_det"].as<double>(); + return params_["keyframe_vote"]["max_cov_det"].as<double>(); } } // namespace wolf diff --git a/schema/processor/ProcessorOdom2d.schema b/schema/processor/ProcessorOdom2d.schema index 418be70864d091e6acad817881dbdc015693d2a9..41b76cdc7ef8cda01e31728116828e97921b2339 100644 --- a/schema/processor/ProcessorOdom2d.schema +++ b/schema/processor/ProcessorOdom2d.schema @@ -1,7 +1,7 @@ follow: ProcessorMotion.schema keyframe_vote: - cov_det: + max_cov_det: _mandatory: $voting_active _type: double _doc: The determinant threshold of the covariance matrix of the integrated delta, to vote for a keyframe. \ No newline at end of file diff --git a/src/processor/processor_odom_2d.cpp b/src/processor/processor_odom_2d.cpp index f9e10a83fe7e470ae757e764207597c2271e393c..5e90e721e3bbbb2cef60a8c85c8e567fe73bf6f2 100644 --- a/src/processor/processor_odom_2d.cpp +++ b/src/processor/processor_odom_2d.cpp @@ -138,7 +138,7 @@ bool ProcessorOdom2d::voteForKeyFrame() const return true; } // Uncertainty criterion - if (getBuffer().back().delta_integr_cov_.determinant() > getCovDet()) + if (getBuffer().back().delta_integr_cov_.determinant() > getMaxCovDet()) { WOLF_DEBUG("PM", id(), " ", getType(), " votes per state covariance"); return true; diff --git a/test/gtest_processor_motion.cpp b/test/gtest_processor_motion.cpp index 29be8cd23c8dc2f705cc7e75af1ca0cc13f0eff2..7f35029461321f75a04b7533dae2a1110bcc6690 100644 --- a/test/gtest_processor_motion.cpp +++ b/test/gtest_processor_motion.cpp @@ -82,7 +82,7 @@ class ProcessorMotion_test : public testing::Test params["keyframe_vote"]["max_dist_traveled"] = 100; params["keyframe_vote"]["max_angle_turned"] = 6.28; params["keyframe_vote"]["max_time_span"] = 2.5 * dt; // force KF at every third process() - params["keyframe_vote"]["cov_det"] = 100; + params["keyframe_vote"]["max_cov_det"] = 100; params["unmeasured_perturbation_std"] = 0.001; // install processor diff --git a/test/yaml/processor_diff_drive.yaml b/test/yaml/processor_diff_drive.yaml index bea2900eb4b8bf9c3f4b01c066292c6e32347933..e4eff792b83ff56926990e9f1d6507c3ff2d2a9d 100644 --- a/test/yaml/processor_diff_drive.yaml +++ b/test/yaml/processor_diff_drive.yaml @@ -11,7 +11,7 @@ keyframe_vote: max_buff_length: 99 # motion deltas max_dist_traveled: 99 # meters max_angle_turned: 99 # radians (1 rad approx 57 deg, approx 60 deg) - cov_det: 99 + max_cov_det: 99 unmeasured_perturbation_std: 0.001 diff --git a/test/yaml/processor_odom_2d.yaml b/test/yaml/processor_odom_2d.yaml index e379b4ed779c8a045f8c084ab5c3149ef889cb9c..bdd02893d41c1978a5484fdcfe4bae95c20a8181 100644 --- a/test/yaml/processor_odom_2d.yaml +++ b/test/yaml/processor_odom_2d.yaml @@ -11,7 +11,7 @@ keyframe_vote: max_buff_length: 100 # motion deltas max_dist_traveled: 100 # meters max_angle_turned: 1.963495 # radians (1 rad approx 57 deg, approx 60 deg) - cov_det: 100 # determinant of covariance threshold + max_cov_det: 100 # determinant of covariance threshold unmeasured_perturbation_std: 0.001 diff --git a/test/yaml/processor_odom_2d_inactive.yaml b/test/yaml/processor_odom_2d_inactive.yaml index 7dee0ea14c5d7ad11f572b0231383ceef77a1b19..2864aef8e6db94367064766eda4b6dabb54105f2 100644 --- a/test/yaml/processor_odom_2d_inactive.yaml +++ b/test/yaml/processor_odom_2d_inactive.yaml @@ -11,7 +11,7 @@ keyframe_vote: max_buff_length: 100 #10 # motion deltas max_dist_traveled: 100 #0.5 # meters max_angle_turned: 0.1 # radians (1 rad approx 57 deg, approx 60 deg) - cov_det: 100 #1 # determinant of covariance threshold + max_cov_det: 100 #1 # determinant of covariance threshold unmeasured_perturbation_std: 0.001 diff --git a/yaml_templates/processor/ProcessorDiffDrive.yaml b/yaml_templates/processor/ProcessorDiffDrive.yaml index 12587124f674a75826fff74f963ef845377fbe7d..b9f5c23c9af70f19e9c2cddae213a383845f0ebe 100644 --- a/yaml_templates/processor/ProcessorDiffDrive.yaml +++ b/yaml_templates/processor/ProcessorDiffDrive.yaml @@ -8,7 +8,7 @@ keyframe_vote: max_buff_length: 0 # MANDATORY if $voting_active - DOC Maximum size of the buffer of motions. - TYPE unsigned int max_dist_traveled: 0.0 # MANDATORY if $voting_active - DOC Distance traveled threshold to create a new frame [m]. - TYPE double max_angle_turned: 0.0 # MANDATORY if $voting_active - DOC Angle turned threshold to create a new frame [rad]. - TYPE double - cov_det: 0.0 # MANDATORY if $voting_active - DOC The determinant threshold of the covariance matrix of the integrated delta, to vote for a keyframe. - TYPE double + max_cov_det: 0.0 # MANDATORY if $voting_active - DOC The determinant threshold of the covariance matrix of the integrated delta, to vote for a keyframe. - TYPE double apply_loss_function: false # DOC If the factors created by the processor have loss function. - TYPE bool state_provider: false # DOC If the processor is used by the problem as provider of state. - TYPE bool state_provider_order: 0.0 # MANDATORY if $state_provider - DOC The order number of this processor when problem gets the state (only used if state_provider = true). Two processors cannot have the same priority (if so, when installing the second is increased). - TYPE double diff --git a/yaml_templates/processor/ProcessorOdom2d.yaml b/yaml_templates/processor/ProcessorOdom2d.yaml index 12587124f674a75826fff74f963ef845377fbe7d..b9f5c23c9af70f19e9c2cddae213a383845f0ebe 100644 --- a/yaml_templates/processor/ProcessorOdom2d.yaml +++ b/yaml_templates/processor/ProcessorOdom2d.yaml @@ -8,7 +8,7 @@ keyframe_vote: max_buff_length: 0 # MANDATORY if $voting_active - DOC Maximum size of the buffer of motions. - TYPE unsigned int max_dist_traveled: 0.0 # MANDATORY if $voting_active - DOC Distance traveled threshold to create a new frame [m]. - TYPE double max_angle_turned: 0.0 # MANDATORY if $voting_active - DOC Angle turned threshold to create a new frame [rad]. - TYPE double - cov_det: 0.0 # MANDATORY if $voting_active - DOC The determinant threshold of the covariance matrix of the integrated delta, to vote for a keyframe. - TYPE double + max_cov_det: 0.0 # MANDATORY if $voting_active - DOC The determinant threshold of the covariance matrix of the integrated delta, to vote for a keyframe. - TYPE double apply_loss_function: false # DOC If the factors created by the processor have loss function. - TYPE bool state_provider: false # DOC If the processor is used by the problem as provider of state. - TYPE bool state_provider_order: 0.0 # MANDATORY if $state_provider - DOC The order number of this processor when problem gets the state (only used if state_provider = true). Two processors cannot have the same priority (if so, when installing the second is increased). - TYPE double