diff --git a/include/core/feature/feature_base.h b/include/core/feature/feature_base.h index a49d4147c8ed9a377ef5573bf7dc581a5f77b9e8..ab5d5f5a21469ef4e0c6a3bac138f11fb53295f3 100644 --- a/include/core/feature/feature_base.h +++ b/include/core/feature/feature_base.h @@ -10,6 +10,7 @@ class FactorBase; //Wolf includes #include "core/common/wolf.h" #include "core/common/node_base.h" +#include "core/state_block/state_composite.h" //std includes @@ -59,9 +60,9 @@ class FeatureBase : public NodeBase, public std::enable_shared_from_this<Feature UncertaintyType _uncertainty_type = UNCERTAINTY_IS_COVARIANCE); FeatureBase(const std::string& _type, + const StateStructure& _structure, const VectorComposite& _measurement, const MatrixComposite& _meas_uncertainty, - const StateStructure& _structure, UncertaintyType _uncertainty_type = UNCERTAINTY_IS_COVARIANCE); virtual ~FeatureBase(); @@ -154,19 +155,6 @@ inline unsigned int FeatureBase::getHits() const return constrained_by_list_.size(); } -inline FeatureBase::FeatureBase (const std::string& _type, - const VectorComposite& _measurement, - const MatrixComposite& _meas_uncertainty, - const StateStructure& _structure, - UncertaintyType _uncertainty_type) : - FeatureBase(_type, - _measurement.vector(_structure), - _meas_uncertainty.matrix(_structure,_structure), - _uncertainty_type) -{ - // -} - inline const FactorBasePtrList& FeatureBase::getConstrainedByList() const { return constrained_by_list_; diff --git a/include/core/feature/feature_motion.h b/include/core/feature/feature_motion.h index ae588e29a7a6ad8de83b601b87af7c41903d33c9..85aa2f86e5b148e168943cc2588287e1b1da7478 100644 --- a/include/core/feature/feature_motion.h +++ b/include/core/feature/feature_motion.h @@ -19,11 +19,18 @@ WOLF_PTR_TYPEDEFS(FeatureMotion); class FeatureMotion : public FeatureBase { public: - FeatureMotion(const std::string& _type, - const VectorXd& _delta_preint, - const MatrixXd _delta_preint_cov, - const VectorXd& _calib_preint, - const MatrixXd& _jacobian_calib); + FeatureMotion(const std::string& _type, + const VectorXd& _delta_preint, + const MatrixXd _delta_preint_cov, + const VectorXd& _calib_preint, + const MatrixXd& _jacobian_calib); + FeatureMotion(const std::string& _type, + const StateStructure& _structure, + const StateStructure& _structure_calib, + const VectorComposite& _delta_preint, + const MatrixComposite _delta_preint_cov, + const VectorComposite& _calib_preint, + const MatrixComposite& _jacobian_calib); virtual ~FeatureMotion(); const Eigen::VectorXd& getDeltaPreint() const; ///< A new name for getMeasurement() diff --git a/src/feature/feature_base.cpp b/src/feature/feature_base.cpp index d3aa372b7ecdae23e6d09382f12e7fd22ff7df58..a6180bfb5f7892dfbf987995dbfa5e31bf001ff3 100644 --- a/src/feature/feature_base.cpp +++ b/src/feature/feature_base.cpp @@ -32,6 +32,19 @@ FeatureBase::FeatureBase(const std::string& _type, const Eigen::VectorXd& _measu // std::cout << "constructed +f" << id() << std::endl; } +FeatureBase::FeatureBase (const std::string& _type, + const StateStructure& _structure, + const VectorComposite& _measurement, + const MatrixComposite& _meas_uncertainty, + UncertaintyType _uncertainty_type) + : FeatureBase(_type, + _measurement.vector(_structure), + _meas_uncertainty.matrix(_structure, _structure), + _uncertainty_type) +{ + // +} + FeatureBase::~FeatureBase() { // std::cout << "destructed -f" << id() << std::endl; diff --git a/src/feature/feature_motion.cpp b/src/feature/feature_motion.cpp index d0b988b79efd5b8e376c6c244a7154933479538f..1de38cde06f12e01dfbff8b720b4020d926f5a2f 100644 --- a/src/feature/feature_motion.cpp +++ b/src/feature/feature_motion.cpp @@ -22,6 +22,23 @@ FeatureMotion::FeatureMotion(const std::string& _type, // } +FeatureMotion::FeatureMotion(const std::string& _type, + const StateStructure& _structure, + const StateStructure& _structure_calib, + const VectorComposite& _delta_preint, + const MatrixComposite _delta_preint_cov, + const VectorComposite& _calib_preint, + const MatrixComposite& _jacobian_calib) : + FeatureMotion(_type, + _delta_preint.vector(_structure), + _delta_preint_cov.matrix(_structure, _structure), + _calib_preint.vector(_structure_calib), + _jacobian_calib.matrix(_structure, _structure_calib)) +{ + // +} + + FeatureMotion::~FeatureMotion() { // diff --git a/src/processor/processor_diff_drive.cpp b/src/processor/processor_diff_drive.cpp index 61f756905464aa6be55cac123af2bddc353dce81..dcc3cc6cd5906de234a2b5eb263267903dcf5c9a 100644 --- a/src/processor/processor_diff_drive.cpp +++ b/src/processor/processor_diff_drive.cpp @@ -159,10 +159,12 @@ FeatureBasePtr ProcessorDiffDrive::emplaceFeature(CaptureMotionPtr _capture_moti { auto key_feature_ptr = FeatureBase::emplace<FeatureMotion>(_capture_motion, "ProcessorDiffDrive", - _capture_motion->getBuffer().back().delta_integr_.vector("PO"), - _capture_motion->getBuffer().back().delta_integr_cov_.matrix("PO","PO"), - _capture_motion->getCalibrationPreint().vector("I"), - _capture_motion->getBuffer().back().jacobian_calib_.matrix("PO","I")); + "PO", + "I", + _capture_motion->getBuffer().back().delta_integr_, + _capture_motion->getBuffer().back().delta_integr_cov_, + _capture_motion->getCalibrationPreint(), + _capture_motion->getBuffer().back().jacobian_calib_); return key_feature_ptr; }