Skip to content
Snippets Groups Projects
Commit d12251cb authored by Jeremie Deray's avatar Jeremie Deray
Browse files

add ProcessorMotion processIncomingCapture

Conflicts:
	src/processor_motion.cpp
parent d4522d49
No related branches found
No related tags found
1 merge request!127Add ProcessorMotion::processIncomingCapture & Miscellaneous
......@@ -67,8 +67,10 @@ void ProcessorMotion::process(CaptureBasePtr _incoming_ptr)
// std::cout << "PM: RUNNING" << std::endl;
}
incoming_ptr_ = processIncomingCapture(_incoming_ptr);
incoming_ptr_ = std::static_pointer_cast<CaptureMotion>(_incoming_ptr);
/// @todo Anything else to do ?
if (incoming_ptr_ == nullptr) return;
preProcess();
......@@ -92,7 +94,7 @@ void ProcessorMotion::process(CaptureBasePtr _incoming_ptr)
FeatureBasePtr key_feature_ptr = emplaceFeature(last_ptr_, key_frame_ptr);
// create motion constraint and link it to parent feature and other frame (which is origin's frame)
auto ctr_ptr = emplaceConstraint(key_feature_ptr, origin_ptr_->getFramePtr());
/*auto ctr_ptr =*/ emplaceConstraint(key_feature_ptr, origin_ptr_->getFramePtr());
// new capture
CaptureMotionPtr new_capture_ptr = std::make_shared<CaptureMotion>(key_frame_ptr->getTimeStamp(),
......@@ -372,6 +374,11 @@ void ProcessorMotion::reintegrateBuffer(CaptureMotionPtr _capture_ptr)
}
}
CaptureMotionPtr ProcessorMotion::processIncomingCapture(CaptureBasePtr& _incoming_ptr)
{
return std::static_pointer_cast<CaptureMotion>(_incoming_ptr);
}
CaptureMotionPtr ProcessorMotion::getCaptureMotionContainingTimeStamp(const TimeStamp& _ts)
{
// We need to search in previous keyframes for the capture containing a motion buffer with the queried time stamp
......
......@@ -269,6 +269,13 @@ class ProcessorMotion : public ProcessorBase
*/
virtual void postProcess() { };
/**
* @brief Process the incoming CaptureBase an return a CaptureMotion.
* If not overloaded, the base class calls static_pointer_cast<CaptureMotion>(incoming)
* @return CaptureMotion.
*/
virtual CaptureMotionPtr processIncomingCapture(CaptureBasePtr& _incoming_ptr);
// These are the pure virtual functions doing the mathematics
protected:
......
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