Skip to content
Snippets Groups Projects
Commit 402729e0 authored by PierreGtch's avatar PierreGtch
Browse files

Buffer::add() change parameters order for consistency

parent 66198eff
No related branches found
No related tags found
1 merge request!290Resolve "ProcessorLoopClosureBase class"
Pipeline #3657 passed
......@@ -68,7 +68,7 @@ public:
/**\brief Add a pack to the buffer
*
*/
void add(const T& _element, const TimeStamp& _time_stamp); //const Scalar& _time_tolerance);
void add(const TimeStamp& _time_stamp, const T& _element); //const Scalar& _time_tolerance);
/** \brief returns the container with elements of the buffer
*
......@@ -400,7 +400,7 @@ T Buffer<T>::selectFirstBefore(const TimeStamp& _time_stamp, const Scalar& _time
}
template <typename T>
void Buffer<T>::add(const T& _element, const TimeStamp& _time_stamp)
void Buffer<T>::add(const TimeStamp& _time_stamp, const T& _element)
{
container_.emplace(_time_stamp, _element);
}
......
......@@ -54,14 +54,14 @@ void ProcessorBase::keyFrameCallback(FrameBasePtr _keyframe_ptr, const Scalar& _
{
WOLF_DEBUG("P", isMotion() ? "M " : "T ", getName(), ": KF", _keyframe_ptr->id(), " callback received with ts = ", _keyframe_ptr->getTimeStamp());
if (_keyframe_ptr != nullptr)
buffer_pack_kf_.add(_keyframe_ptr,_time_tol_other);
buffer_pack_kf_.add(_keyframe_ptr, _time_tol_other);
}
void ProcessorBase::captureCallback(CaptureBasePtr _capture_ptr)
{
WOLF_DEBUG("P", isMotion() ? "M " : "T ", getName(), ": Capture", _capture_ptr->id(), " callback received with ts = ", _capture_ptr->getTimeStamp());
if (_capture_ptr != nullptr)
buffer_capture_.add(_capture_ptr, _capture_ptr->getTimeStamp());
buffer_capture_.add(_capture_ptr->getTimeStamp(), _capture_ptr);
}
void ProcessorBase::remove()
......@@ -104,8 +104,7 @@ void BufferPackKeyFrame::add(const FrameBasePtr& _key_frame, const Scalar& _time
{
TimeStamp time_stamp = _key_frame->getTimeStamp();
PackKeyFramePtr kfpack = std::make_shared<PackKeyFrame>(_key_frame, _time_tolerance);
//Buffer<PackKeyFramePtr>::add(kfpack, time_stamp);
Buffer::add(kfpack, time_stamp);
Buffer::add(time_stamp, kfpack);
}
PackKeyFramePtr BufferPackKeyFrame::selectPack(const TimeStamp& _time_stamp, const Scalar& _time_tolerance)
......
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