diff --git a/src/processor_base.cpp b/src/processor_base.cpp index 4e15a70fe6d309c3c642a6ae977fe14bf17eebe4..beb4018b1931a7d0d99deca4155408c40c49d396 100644 --- a/src/processor_base.cpp +++ b/src/processor_base.cpp @@ -28,10 +28,8 @@ bool ProcessorBase::permittedKeyFrame() return getProblem()->permitKeyFrame(shared_from_this()); } -void ProcessorBase::makeFrame(CaptureBasePtr _capture_ptr, FrameKeyType _type) +FrameBasePtr ProcessorBase::makeFrame(CaptureBasePtr _capture_ptr, FrameKeyType _type) { - std::cout << __FILE__ << ":" << __FUNCTION__ << "():" << __LINE__ << std::endl; - // We need to create the new free Frame to hold what will become the last Capture FrameBasePtr new_frame_ptr = getProblem()->createFrame(_type, _capture_ptr->getTimeStamp()); @@ -41,7 +39,16 @@ void ProcessorBase::makeFrame(CaptureBasePtr _capture_ptr, FrameKeyType _type) // Keyframe callback in order to let the other processors to establish their constraints getProblem()->keyFrameCallback(_capture_ptr->getFramePtr(), shared_from_this(), time_tolerance_); - std::cout << __FILE__ << ":" << __FUNCTION__ << "():" << __LINE__ << std::endl; + return new_frame_ptr; +} + +FrameBasePtr ProcessorBase::makeFrame(CaptureBasePtr _capture_ptr, const Eigen::VectorXs& _state, FrameKeyType _type) +{ + // We need to create the new free Frame to hold what will become the last Capture + FrameBasePtr new_frame_ptr = getProblem()->createFrame(_type, _state, _capture_ptr->getTimeStamp()); + + new_frame_ptr->addCapture(_capture_ptr); // Add incoming Capture to the new Frame + return new_frame_ptr; } void ProcessorBase::remove() diff --git a/src/processor_base.h b/src/processor_base.h index 7fdce5893a09ac336d4f8c0bfb7d3e0e549bacc0..5900ed583fba3d5911e85d736933704ee330d628 100644 --- a/src/processor_base.h +++ b/src/processor_base.h @@ -54,7 +54,8 @@ class ProcessorBase : public NodeBase, public std::enable_shared_from_this<Proce /**\brief make a Frame with the provided Capture */ - virtual void makeFrame(CaptureBasePtr _capture_ptr, FrameKeyType _type = NON_KEY_FRAME); + FrameBasePtr makeFrame(CaptureBasePtr _capture_ptr, FrameKeyType _type = NON_KEY_FRAME); + FrameBasePtr makeFrame(CaptureBasePtr _capture_ptr, const Eigen::VectorXs& _state, FrameKeyType _type = NON_KEY_FRAME); virtual bool keyFrameCallback(FrameBasePtr _keyframe_ptr, const Scalar& _time_tolerance) = 0; diff --git a/src/processor_motion.h b/src/processor_motion.h index 7f06324fdae05bb162057b005a8c89c48063ec61..861c0ffa05626134bad352a2c35cce86d1eeff7c 100644 --- a/src/processor_motion.h +++ b/src/processor_motion.h @@ -178,7 +178,7 @@ class ProcessorMotion : public ProcessorBase // void reset(CaptureMotion2* _capture_ptr); - FrameBasePtr makeFrame(CaptureBasePtr _capture_ptr, const Eigen::VectorXs& _state, FrameKeyType _type); +// FrameBasePtr makeFrame(CaptureBasePtr _capture_ptr, const Eigen::VectorXs& _state, FrameKeyType _type = NON_KEY_FRAME); MotionBuffer& getBuffer(); @@ -658,14 +658,14 @@ inline void ProcessorMotion::splitBuffer(const TimeStamp& _t_split, MotionBuffer last_ptr_->getBuffer().split(_t_split, _oldest_part); } -inline FrameBasePtr ProcessorMotion::makeFrame(CaptureBasePtr _capture_ptr, const Eigen::VectorXs& _state, FrameKeyType _type) -{ - // We need to create the new free Frame to hold what will become the last Capture - FrameBasePtr new_frame_ptr = getProblem()->createFrame(_type, _state, _capture_ptr->getTimeStamp()); - - new_frame_ptr->addCapture(_capture_ptr); // Add incoming Capture to the new Frame - return new_frame_ptr; -} +//FrameBasePtr ProcessorMotion::makeFrame(CaptureBasePtr _capture_ptr, const Eigen::VectorXs& _state, FrameKeyType _type) +//{ +// // We need to create the new free Frame to hold what will become the last Capture +// FrameBasePtr new_frame_ptr = getProblem()->createFrame(_type, _state, _capture_ptr->getTimeStamp()); +// +// new_frame_ptr->addCapture(_capture_ptr); // Add incoming Capture to the new Frame +// return new_frame_ptr; +//} inline void ProcessorMotion::resetDerived() {