Skip to content
Snippets Groups Projects
Commit c4a45324 authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Merge branch 'makeFrame' into 'master'

Transfer ProcessorMotion::makeFrame() to ProcessorBase::makeFrame()

Function makeFrame was shadowed in ProcessorMotion and was creating many warnings.

This MR solves this, although a proper organization of the makeFrame functionality might require extra re-thinking.

See merge request !95
parents 336ab3cf 9833b373
No related branches found
No related tags found
1 merge request!95Transfer ProcessorMotion::makeFrame() to ProcessorBase::makeFrame()
......@@ -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()
......
......@@ -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;
......
......@@ -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()
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment