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

Rename simpleCheckTimeTolerance() -> checkTimeTolerance()

parent 10666c8a
No related branches found
No related tags found
3 merge requests!436Release to start wolf public,!433After 2nd RA-L submission,!431Resolve "Add time_tolerance field in Frame and remove PackKeyFrame"
......@@ -159,7 +159,7 @@ public:
* Check if the time distance between two time stamps is smaller than
* the time tolerance.
*/
static bool simpleCheckTimeTolerance(const TimeStamp& _time_stamp1, const TimeStamp& _time_stamp2, const double& _time_tolerance);
static bool checkTimeTolerance(const TimeStamp& _time_stamp1, const TimeStamp& _time_stamp2, const double& _time_tolerance);
/**\brief Check time tolerance
*
......@@ -449,13 +449,13 @@ typename Buffer<T>::Iterator Buffer<T>::selectIterator(const TimeStamp& _time_st
bool prev_exists = (post != container_.begin());
bool post_exists = (post != container_.end());
bool post_ok = post_exists && simpleCheckTimeTolerance(post->first, _time_stamp, _time_tolerance);
bool post_ok = post_exists && checkTimeTolerance(post->first, _time_stamp, _time_tolerance);
if (prev_exists)
{
Buffer<T>::Iterator prev = std::prev(post);
bool prev_ok = simpleCheckTimeTolerance(prev->first, _time_stamp, _time_tolerance);
bool prev_ok = checkTimeTolerance(prev->first, _time_stamp, _time_tolerance);
if (prev_ok && !post_ok)
return prev;
......@@ -507,7 +507,7 @@ T Buffer<T>::selectFirstBefore(const TimeStamp& _time_stamp, const double& _time
return container_.begin()->second;
// Return first element if despite being newer, it is within the time tolerance
if (simpleCheckTimeTolerance(container_.begin()->first, _time_stamp, _time_tolerance))
if (checkTimeTolerance(container_.begin()->first, _time_stamp, _time_tolerance))
return container_.begin()->second;
// otherwise return nullptr (no element before the provided ts or within the tolerance was found)
......@@ -528,7 +528,7 @@ T Buffer<T>::selectLastAfter(const TimeStamp& _time_stamp, const double& _time_t
return container_.rbegin()->second;
// Return last element if despite being older, it is within the time tolerance
if (simpleCheckTimeTolerance(container_.rbegin()->first, _time_stamp, _time_tolerance))
if (checkTimeTolerance(container_.rbegin()->first, _time_stamp, _time_tolerance))
return container_.rbegin()->second;
// otherwise return nullptr (no element after the provided ts or within the tolerance was found)
......@@ -614,7 +614,7 @@ inline bool Buffer<T>::doubleCheckTimeTolerance(const TimeStamp& _time_stamp1,
}
template <typename T>
inline bool Buffer<T>::simpleCheckTimeTolerance(const TimeStamp& _time_stamp1,
inline bool Buffer<T>::checkTimeTolerance(const TimeStamp& _time_stamp1,
const TimeStamp& _time_stamp2,
const double& _time_tolerance)
{
......
......@@ -308,7 +308,7 @@ inline FeatureBasePtrList& ProcessorTracker::getNewFeaturesListIncoming()
inline bool ProcessorTracker::checkTimeTolerance(const TimeStamp& _ts1, const TimeStamp& _ts2)
{
return (std::fabs(_ts2 - _ts2) < params_tracker_->time_tolerance);
return buffer_frame_.checkTimeTolerance(_ts1, _ts2, params_tracker_->time_tolerance);
}
inline bool ProcessorTracker::checkTimeTolerance(const CaptureBasePtr _cap, const TimeStamp& _ts)
......
......@@ -930,7 +930,7 @@ FrameBasePtr ProcessorMotion::computeProcessingStep()
if (keyframe_from_callback)
{
if (buffer_frame_.simpleCheckTimeTolerance(keyframe_from_callback->getTimeStamp(),
if (buffer_frame_.checkTimeTolerance(keyframe_from_callback->getTimeStamp(),
incoming_ptr_->getTimeStamp(),
params_motion_->time_tolerance))
{
......@@ -966,7 +966,7 @@ FrameBasePtr ProcessorMotion::computeProcessingStep()
if (keyframe_from_callback)
{
if (buffer_frame_.simpleCheckTimeTolerance(keyframe_from_callback->getTimeStamp(),
if (buffer_frame_.checkTimeTolerance(keyframe_from_callback->getTimeStamp(),
origin_ptr_->getTimeStamp(),
params_motion_->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