diff --git a/hello_wolf/processor_range_bearing.h b/hello_wolf/processor_range_bearing.h index 527efd1f60afc7f1f688b795dbe0bf7fd4546628..65e87f56e76718036e44d73031329e98c361afe4 100644 --- a/hello_wolf/processor_range_bearing.h +++ b/hello_wolf/processor_range_bearing.h @@ -31,7 +31,7 @@ struct ProcessorParamsRangeBearing : public ProcessorParamsBase { // } - std::string print() + std::string print() const { return "\n" + ProcessorParamsBase::print(); } diff --git a/hello_wolf/sensor_range_bearing.h b/hello_wolf/sensor_range_bearing.h index b7788c27ffb4a06cdbc440ec091553d5b216440a..2e9bcf214d0ea586a6cf3466846ed41ef50f3096 100644 --- a/hello_wolf/sensor_range_bearing.h +++ b/hello_wolf/sensor_range_bearing.h @@ -29,7 +29,7 @@ struct IntrinsicsRangeBearing : public IntrinsicsBase noise_range_metres_std = _server.getParam<Scalar>(_unique_name + "/noise_range_metres_std"); noise_bearing_degrees_std = _server.getParam<Scalar>(_unique_name + "/noise_bearing_degrees_std"); } - std::string print() + std::string print() const { return "" + IntrinsicsBase::print() + "\n" + "noise_range_metres_std: " + std::to_string(noise_range_metres_std) + "\n" diff --git a/include/core/common/params_base.h b/include/core/common/params_base.h index 767ece49d1daa5e55496ba22d71f8cb34c8b8b7d..5295bc0ac17f941503a8f28e462962290a9ee82b 100644 --- a/include/core/common/params_base.h +++ b/include/core/common/params_base.h @@ -13,7 +13,7 @@ namespace wolf { } virtual ~ParamsBase() = default; - std::string print() + std::string print() const { return ""; } diff --git a/include/core/processor/processor_base.h b/include/core/processor/processor_base.h index 1eee919dea9af66f6bcaf2257c0e7ae58d5ba81b..d57846275c3550cfc208cfb849abdf676ce9d9fc 100644 --- a/include/core/processor/processor_base.h +++ b/include/core/processor/processor_base.h @@ -180,7 +180,7 @@ class BufferPackKeyFrame : public Buffer<PackKeyFramePtr> /**\brief Print buffer information * */ - void print(); + void print() const; /**\brief Alias funct * @@ -224,7 +224,7 @@ struct ProcessorParamsBase : public ParamsBase bool voting_aux_active = false; ///< Whether this processor is allowed to vote for an Auxiliary Frame or not - std::string print() + std::string print() const { return ParamsBase::print() + "\n" + "voting_active: " + std::to_string(voting_active) + "\n" diff --git a/include/core/processor/processor_diff_drive.h b/include/core/processor/processor_diff_drive.h index d4aa5a792ef4d571a057824099d4430696088c86..1192230afa33cbb5814f6fc599e1df17c8290b9b 100644 --- a/include/core/processor/processor_diff_drive.h +++ b/include/core/processor/processor_diff_drive.h @@ -22,7 +22,7 @@ struct ProcessorParamsDiffDrive : public ProcessorParamsOdom2D ProcessorParamsOdom2D(_unique_name, _server) { } - std::string print() + std::string print() const { return "\n" + ProcessorParamsOdom2D::print(); } diff --git a/include/core/processor/processor_motion.h b/include/core/processor/processor_motion.h index 1cd51d36ee2526ee0072dcbbeb31081ab4c69793..41fc77be5711986fadee3e4d16996826d2938373 100644 --- a/include/core/processor/processor_motion.h +++ b/include/core/processor/processor_motion.h @@ -40,7 +40,7 @@ struct ProcessorParamsMotion : public ProcessorParamsBase angle_turned = _server.getParam<Scalar>(_unique_name + "/keyframe_vote/angle_turned"); unmeasured_perturbation_std = _server.getParam<Scalar>(_unique_name + "/unmeasured_perturbation_std"); } - std::string print() + std::string print() const { return "\n" + ProcessorParamsBase::print() + "\n" + "max_time_span: " + std::to_string(max_time_span) + "\n" diff --git a/include/core/processor/processor_odom_2D.h b/include/core/processor/processor_odom_2D.h index 8fca11b3e5913e683a9cfde766ad1e072ef5c32e..2957ec7de8cd0647a45fc1f72c15629b9f42a089 100644 --- a/include/core/processor/processor_odom_2D.h +++ b/include/core/processor/processor_odom_2D.h @@ -30,7 +30,7 @@ struct ProcessorParamsOdom2D : public ProcessorParamsMotion cov_det = _server.getParam<Scalar>(_unique_name + "/keyframe_vote/cov_det"); } - std::string print() + std::string print() const { return "\n" + ProcessorParamsMotion::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 bd1e3cf013135ac90bfcb9dec749b9b64a63ce07..1512b996e89a5e5d5c7c6bc294d1dfa495219d41 100644 --- a/include/core/processor/processor_odom_3D.h +++ b/include/core/processor/processor_odom_3D.h @@ -27,7 +27,7 @@ struct ProcessorParamsOdom3D : public ProcessorParamsMotion { // } - std::string print() + std::string print() const { return "\n" + ProcessorParamsMotion::print(); } diff --git a/include/core/processor/processor_tracker.h b/include/core/processor/processor_tracker.h index dc59acee329e3dbe09ba03e25cb1c385347bf8ff..a1e64518606e559ab6c80c4f8b669850e2f46b7f 100644 --- a/include/core/processor/processor_tracker.h +++ b/include/core/processor/processor_tracker.h @@ -27,7 +27,7 @@ struct ProcessorParamsTracker : public ProcessorParamsBase min_features_for_keyframe = _server.getParam<unsigned int>(_unique_name + "/min_features_for_keyframe"); max_new_features = _server.getParam<int>(_unique_name + "/max_new_features"); } - std::string print() + std::string print() const { return ProcessorParamsBase::print() + "\n" + "min_features_for_keyframe: " + std::to_string(min_features_for_keyframe) + "\n" @@ -230,7 +230,7 @@ class ProcessorTracker : public ProcessorBase FeatureBasePtrList& getNewFeaturesListLast(); - std::string print(){ + std::string print() const { return this->params_tracker_->print(); } diff --git a/include/core/sensor/sensor_base.h b/include/core/sensor/sensor_base.h index e9945a9b4ae269b0829651ebf85ed331f1dcaec1..67e0c032d4d21ac4a5d3c5af17383b3b09610871 100644 --- a/include/core/sensor/sensor_base.h +++ b/include/core/sensor/sensor_base.h @@ -74,7 +74,7 @@ struct IntrinsicsBase: public ParamsBase { virtual ~IntrinsicsBase() = default; using ParamsBase::ParamsBase; - std::string print() + std::string print() const { return ""; } diff --git a/include/core/sensor/sensor_diff_drive.h b/include/core/sensor/sensor_diff_drive.h index a36356ed87a3c793a4a8464e4b2a43c16e65043c..79d1c769a842d267b32dbffe4fdaa58580358476 100644 --- a/include/core/sensor/sensor_diff_drive.h +++ b/include/core/sensor/sensor_diff_drive.h @@ -36,6 +36,7 @@ struct IntrinsicsDiffDrive : public IntrinsicsBase radians_per_tick = 2.0 * M_PI / ticks_per_wheel_revolution; } std::string print() + std::string print() const { return "\n" + IntrinsicsBase::print() + "\n" + "radius_left: " + std::to_string(radius_left) + "\n" diff --git a/include/core/sensor/sensor_odom_2D.h b/include/core/sensor/sensor_odom_2D.h index 83b776add9b4bba4c1994f047d06dedd3e8e5c1f..463a9c3d95053f3753c3b59b2769cfb669b9a0e7 100644 --- a/include/core/sensor/sensor_odom_2D.h +++ b/include/core/sensor/sensor_odom_2D.h @@ -25,7 +25,7 @@ struct IntrinsicsOdom2D : public IntrinsicsBase k_disp_to_disp = _server.getParam<Scalar>(_unique_name + "/k_disp_to_disp"); k_rot_to_rot = _server.getParam<Scalar>(_unique_name + "/k_rot_to_rot"); } - std::string print() + std::string print() const { return "\n" + IntrinsicsBase::print() + "\n" + "k_disp_to_disp: " + std::to_string(k_disp_to_disp) + "\n" diff --git a/include/core/sensor/sensor_odom_3D.h b/include/core/sensor/sensor_odom_3D.h index 1a727d613d8564c02d02f16abcf63410c96289b2..3e141b93916455d280990d2aed3d27d54d156835 100644 --- a/include/core/sensor/sensor_odom_3D.h +++ b/include/core/sensor/sensor_odom_3D.h @@ -36,7 +36,7 @@ struct IntrinsicsOdom3D : public IntrinsicsBase min_disp_var = _server.getParam<Scalar>(_unique_name + "/min_disp_var"); min_rot_var = _server.getParam<Scalar>(_unique_name + "/min_rot_var"); } - std::string print() + std::string print() const { return "\n" + IntrinsicsBase::print() + "\n" + "k_disp_to_disp: " + std::to_string(k_disp_to_disp) + "\n" diff --git a/src/processor/processor_base.cpp b/src/processor/processor_base.cpp index 1e8b098df1dd882ff16756c3f3345080637a43e0..c89ece40f29e39d36d167cf79c4bf852348f69b6 100644 --- a/src/processor/processor_base.cpp +++ b/src/processor/processor_base.cpp @@ -181,7 +181,7 @@ PackKeyFramePtr BufferPackKeyFrame::selectFirstPackBefore(const CaptureBasePtr _ return selectFirstPackBefore(_capture->getTimeStamp(), _time_tolerance); } -void BufferPackKeyFrame::print(void) +void BufferPackKeyFrame::print(void) const { std::cout << "[ "; for (auto iter : container_)