diff --git a/include/core/processor/is_motion.h b/include/core/processor/is_motion.h index c789946582abe964af8171526ec8b2a4af1b1603..dc0487046e5013626ebc02288a00915a7df58b24 100644 --- a/include/core/processor/is_motion.h +++ b/include/core/processor/is_motion.h @@ -30,12 +30,18 @@ class IsMotion virtual VectorComposite getState(const StateStructure& _structure = "") const = 0; virtual VectorComposite getState(const TimeStamp& _ts, const StateStructure& _structure = "") const = 0; + VectorComposite getOdometry ( ) const; + private: + void setOdometry(const VectorComposite& _zero_odom) {odometry_ = _zero_odom;} + + public: const StateStructure& getStateStructure ( ) { return state_structure_; }; void setStateStructure(std::string _state_structure) { state_structure_ = _state_structure; }; void addToProblem(ProblemPtr _prb_ptr, IsMotionPtr _motion_ptr); - + protected: StateStructure state_structure_; ///< The structure of the state vector (to retrieve state blocks from frames) + VectorComposite odometry_; }; @@ -45,6 +51,12 @@ inline IsMotion::IsMotion(const StateStructure& _structure) : // } + +inline wolf::VectorComposite IsMotion::getOdometry ( ) const +{ + return odometry_; +} + } ///// IMPLEMENTATION /////// diff --git a/src/processor/is_motion.cpp b/src/processor/is_motion.cpp index 1bfd06a5e9669f76ef48c49a559cade0dc7845f0..a17142e80bf69198674b29f0dc5f3bde955412a4 100644 --- a/src/processor/is_motion.cpp +++ b/src/processor/is_motion.cpp @@ -5,5 +5,6 @@ using namespace wolf; void IsMotion::addToProblem(ProblemPtr _prb_ptr, IsMotionPtr _motion_ptr) { + setOdometry(_prb_ptr->stateZero(state_structure_)); _prb_ptr->addProcessorIsMotion(_motion_ptr); }