diff --git a/demos/hello_wolf/processor_range_bearing.h b/demos/hello_wolf/processor_range_bearing.h index bdcefb3a7141627523a6f2111307fc776abbadbb..f086da9071e4956e3c7ef1ab2d59bff81326f594 100644 --- a/demos/hello_wolf/processor_range_bearing.h +++ b/demos/hello_wolf/processor_range_bearing.h @@ -33,7 +33,7 @@ struct ParamsProcessorRangeBearing : public ParamsProcessorBase } std::string print() const { - return "\n" + ParamsProcessorBase::print(); + return ParamsProcessorBase::print(); } }; diff --git a/demos/hello_wolf/sensor_range_bearing.h b/demos/hello_wolf/sensor_range_bearing.h index 59c217fe0f3f9f5f70973dca8a2ef4b060a6696a..70684f77951f2681d8c2741d3c5c5b09fc503a12 100644 --- a/demos/hello_wolf/sensor_range_bearing.h +++ b/demos/hello_wolf/sensor_range_bearing.h @@ -31,7 +31,7 @@ struct ParamsSensorRangeBearing : public ParamsSensorBase } std::string print() const { - return "" + ParamsSensorBase::print() + "\n" + return ParamsSensorBase::print() + "\n" + "noise_range_metres_std: " + std::to_string(noise_range_metres_std) + "\n" + "noise_bearing_degrees_std: " + std::to_string(noise_bearing_degrees_std) + "\n"; } diff --git a/include/core/common/params_base.h b/include/core/common/params_base.h index 80f6516415e28ddce47ab272415604014ffb0a66..b9a4886c290fb9c1dcb4889d55b6d1523c42df78 100644 --- a/include/core/common/params_base.h +++ b/include/core/common/params_base.h @@ -13,10 +13,7 @@ namespace wolf { } virtual ~ParamsBase() = default; - std::string print() const - { - return ""; - } + virtual std::string print() const = 0; }; } #endif diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h index ffdc78fe090da95f3e47b37303cbef1d0a9b2e8e..f6b5cc5fbd56730457b7f6d7d8d72a14481c6708 100644 --- a/include/core/processor/processor_base.h +++ b/include/core/processor/processor_base.h @@ -242,11 +242,10 @@ struct ParamsProcessorBase : public ParamsBase bool voting_aux_active; ///< Whether this processor is allowed to vote for an Auxiliary Frame or not bool apply_loss_function; ///< Whether this processor emplaces factors with loss function or not - std::string print() const + std::string print() const override { - return ParamsBase::print() + "\n" - + "voting_active: " + std::to_string(voting_active) + "\n" + "voting_aux_active: " + std::to_string(voting_aux_active) + "\n" + return "voting_active: " + std::to_string(voting_active) + "\n" + "time_tolerance: " + std::to_string(time_tolerance) + "\n" + "apply_loss_function: " + std::to_string(apply_loss_function) + "\n"; } diff --git a/include/core/processor/processor_diff_drive.h b/include/core/processor/processor_diff_drive.h index 6fb9eb40f5923a5ca3526e64bc8abaa3da2397df..b1917f7080c5ae06e4491ed3626aea7ca80a6601 100644 --- a/include/core/processor/processor_diff_drive.h +++ b/include/core/processor/processor_diff_drive.h @@ -24,7 +24,7 @@ struct ParamsProcessorDiffDrive : public ParamsProcessorOdom2d } std::string print() const { - return "\n" + ParamsProcessorOdom2d::print(); + return ParamsProcessorOdom2d::print(); } }; diff --git a/include/core/processor/processor_motion.h b/include/core/processor/processor_motion.h index 6a0f15a90885f5438c18c2cf01ed714c488ba599..7804114d0d1d96ad8652eb44d5eb4a010dfd8add 100644 --- a/include/core/processor/processor_motion.h +++ b/include/core/processor/processor_motion.h @@ -43,7 +43,7 @@ struct ParamsProcessorMotion : public ParamsProcessorBase } std::string print() const { - return "\n" + ParamsProcessorBase::print() + "\n" + return ParamsProcessorBase::print() + "\n" + "max_time_span: " + std::to_string(max_time_span) + "\n" + "max_buff_length: " + std::to_string(max_buff_length) + "\n" + "dist_traveled: " + std::to_string(dist_traveled) + "\n" diff --git a/include/core/processor/processor_odom_2d.h b/include/core/processor/processor_odom_2d.h index de3aebb4a811e954a27f4ac24c22dd277d9142fd..b61b4ba6ea35f9b1719c7658eb376ce3818bf8fb 100644 --- a/include/core/processor/processor_odom_2d.h +++ b/include/core/processor/processor_odom_2d.h @@ -33,7 +33,7 @@ struct ParamsProcessorOdom2d : public ParamsProcessorMotion std::string print() const { - return "\n" + ParamsProcessorMotion::print() + "\n" + return ParamsProcessorMotion::print() + "\n" + "cov_det: " + std::to_string(cov_det) + "\n"; } }; diff --git a/include/core/processor/processor_odom_3d.h b/include/core/processor/processor_odom_3d.h index 0ff94590e542afe465676b7332d23ad5064ee56e..c6ca8dbaf266775b80df30fd9135a0b0bc5754f4 100644 --- a/include/core/processor/processor_odom_3d.h +++ b/include/core/processor/processor_odom_3d.h @@ -29,7 +29,7 @@ struct ParamsProcessorOdom3d : public ParamsProcessorMotion } std::string print() const { - return "\n" + ParamsProcessorMotion::print(); + return ParamsProcessorMotion::print(); } }; diff --git a/include/core/sensor/sensor_base.h b/include/core/sensor/sensor_base.h index bf9556bababfc52dbf40b6b9d5deec586f953e02..4c27ecb6e45bcd2ff44ea5a20d22705d6c024b6d 100644 --- a/include/core/sensor/sensor_base.h +++ b/include/core/sensor/sensor_base.h @@ -76,7 +76,7 @@ struct ParamsSensorBase: public ParamsBase std::string prefix = "sensor/"; ~ParamsSensorBase() override = default; using ParamsBase::ParamsBase; - std::string print() const + std::string print() const override { return ""; } diff --git a/include/core/sensor/sensor_diff_drive.h b/include/core/sensor/sensor_diff_drive.h index 8238139c3a2bf85238a9d4bacc7ac02994e987dd..cb08a2dd0ccb7967158aa2d9319d9b1fe210670b 100644 --- a/include/core/sensor/sensor_diff_drive.h +++ b/include/core/sensor/sensor_diff_drive.h @@ -39,7 +39,7 @@ struct ParamsSensorDiffDrive : public ParamsSensorBase } std::string print() const { - return "\n" + ParamsSensorBase::print() + "\n" + return ParamsSensorBase::print() + "\n" + "radius_left: " + std::to_string(radius_left) + "\n" + "radius_right: " + std::to_string(radius_right) + "\n" + "wheel_separation: " + std::to_string(wheel_separation) + "\n" diff --git a/include/core/sensor/sensor_odom_2d.h b/include/core/sensor/sensor_odom_2d.h index b2a989a6fe2ef55092429d38b0a75698b1627be0..5f2fc1a717b7c58f985ede8845ea2de01dc17fcb 100644 --- a/include/core/sensor/sensor_odom_2d.h +++ b/include/core/sensor/sensor_odom_2d.h @@ -25,9 +25,9 @@ struct ParamsSensorOdom2d : public ParamsSensorBase k_disp_to_disp = _server.getParam<double>(prefix + _unique_name + "/k_disp_to_disp"); k_rot_to_rot = _server.getParam<double>(prefix + _unique_name + "/k_rot_to_rot"); } - std::string print() const + std::string print() const override { - return "\n" + ParamsSensorBase::print() + "\n" + return ParamsSensorBase::print() + "\n" + "k_disp_to_disp: " + std::to_string(k_disp_to_disp) + "\n" + "k_rot_to_rot: " + std::to_string(k_rot_to_rot) + "\n"; } diff --git a/include/core/sensor/sensor_odom_3d.h b/include/core/sensor/sensor_odom_3d.h index 37ec082f59543e3ad19cc2bea9370abee1e03c23..ab0e8b46872c21015b02ffcb9d521dbd77e2a606 100644 --- a/include/core/sensor/sensor_odom_3d.h +++ b/include/core/sensor/sensor_odom_3d.h @@ -36,9 +36,9 @@ struct ParamsSensorOdom3d : public ParamsSensorBase min_disp_var = _server.getParam<double>(prefix + _unique_name + "/min_disp_var"); min_rot_var = _server.getParam<double>(prefix + _unique_name + "/min_rot_var"); } - std::string print() const + std::string print() const override { - return "\n" + ParamsSensorBase::print() + "\n" + return ParamsSensorBase::print() + "\n" + "k_disp_to_disp: " + std::to_string(k_disp_to_disp) + "\n" + "k_disp_to_rot: " + std::to_string(k_disp_to_rot) + "\n" + "k_rot_to_rot: " + std::to_string(k_rot_to_rot) + "\n" diff --git a/include/core/solver/solver_manager.h b/include/core/solver/solver_manager.h index 26ac49efb135108b2292f1f65bc75929e67bc5a5..53fc181cb072d8eaf3e4ca4977dcef25c9ac6198 100644 --- a/include/core/solver/solver_manager.h +++ b/include/core/solver/solver_manager.h @@ -202,6 +202,10 @@ struct ParamsSolver: public ParamsBase period = _server.getParam<double>(prefix + "period"); verbose = (SolverManager::ReportVerbosity)_server.getParam<int>(prefix + "verbose"); } + std::string print() const override + { + return "period: " + std::to_string(period) + "\n"; + } ~ParamsSolver() override = default; }; diff --git a/include/core/tree_manager/tree_manager_base.h b/include/core/tree_manager/tree_manager_base.h index 2ffef15edf2e8a719581f76bbd957836ba6dc051..9fd06f2f0d78e82ee1eda5800c10707b4c84b759 100644 --- a/include/core/tree_manager/tree_manager_base.h +++ b/include/core/tree_manager/tree_manager_base.h @@ -55,9 +55,9 @@ struct ParamsTreeManagerBase : public ParamsBase ~ParamsTreeManagerBase() override = default; - std::string print() const + std::string print() const override { - return ParamsBase::print() + "\n"; + return ""; } }; diff --git a/include/core/tree_manager/tree_manager_sliding_window.h b/include/core/tree_manager/tree_manager_sliding_window.h index ce44fe003a8dfa58bb9a938e804af3e26fe576df..86bc095f47220e8c82f94c9952eafbe9133cdc96 100644 --- a/include/core/tree_manager/tree_manager_sliding_window.h +++ b/include/core/tree_manager/tree_manager_sliding_window.h @@ -21,7 +21,7 @@ struct ParamsTreeManagerSlidingWindow : public ParamsTreeManagerBase } std::string print() const { - return "\n" + ParamsTreeManagerBase::print() + "\n" + return ParamsTreeManagerBase::print() + "\n" + "n_frames: " + std::to_string(n_frames) + "\n" + "fix_first_frame: " + std::to_string(fix_first_frame) + "\n" + "viral_remove_empty_parent: " + std::to_string(viral_remove_empty_parent) + "\n"; diff --git a/include/core/tree_manager/tree_manager_sliding_window_dual_rate.h b/include/core/tree_manager/tree_manager_sliding_window_dual_rate.h index e9fcbd1332fd2d4eca3f7afa04c2aee167ad1980..3d455f89049e94181c762a8a9ef794474f94fd5c 100644 --- a/include/core/tree_manager/tree_manager_sliding_window_dual_rate.h +++ b/include/core/tree_manager/tree_manager_sliding_window_dual_rate.h @@ -21,7 +21,7 @@ struct ParamsTreeManagerSlidingWindowDualRate : public ParamsTreeManagerSlidingW } std::string print() const { - return "\n" + ParamsTreeManagerBase::print() + "\n" + return ParamsTreeManagerBase::print() + "\n" + "n_frames_recent: " + std::to_string(n_frames_recent) + "\n" + "rate_old_frames: " + std::to_string(rate_old_frames) + "\n"; } diff --git a/test/dummy/tree_manager_dummy.h b/test/dummy/tree_manager_dummy.h index 662c7d15677173fc302c02b10b1f660297753daf..1e7e70f2ee476404cb96b070e72f280c7a570a6e 100644 --- a/test/dummy/tree_manager_dummy.h +++ b/test/dummy/tree_manager_dummy.h @@ -20,7 +20,7 @@ struct ParamsTreeManagerDummy : public ParamsTreeManagerBase bool toy_param; - std::string print() const + std::string print() const override { return ParamsTreeManagerBase::print() + "\n" + "toy_param: " + std::to_string(toy_param) + "\n";