Skip to content
Snippets Groups Projects
Commit 9f46d784 authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

changed documentation and added WOLF_DEBUGs

parent 0056f469
No related branches found
No related tags found
1 merge request!274Resolve "Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions"
...@@ -121,8 +121,8 @@ class ProcessorTrackerFeature : public ProcessorTracker ...@@ -121,8 +121,8 @@ class ProcessorTrackerFeature : public ProcessorTracker
* *
* IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead. * IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead.
* Then, they will be already linked to the _capture. * Then, they will be already linked to the _capture.
* If you detect all the features at once in preprocess(), you should either emplace them (`FeatureBase::emplace()`) and remove the not returned features in _features_out (`FeatureBase::remove()`), * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the
* or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). * features that are returned in _features_out (`FeatureBase::link(_capture)`).
* *
* \return the number of features tracked * \return the number of features tracked
*/ */
...@@ -168,8 +168,8 @@ class ProcessorTrackerFeature : public ProcessorTracker ...@@ -168,8 +168,8 @@ class ProcessorTrackerFeature : public ProcessorTracker
* *
* IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead. * IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead.
* Then, they will be already linked to the _capture. * Then, they will be already linked to the _capture.
* If you detect all the features at once in preprocess(), you should either emplace them (`FeatureBase::emplace()`) and remove the not returned features in _features_out (`FeatureBase::remove()`), * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the
* or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). * features that are returned in _features_out (`FeatureBase::link(_capture)`).
* *
* The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_, * The function is called in ProcessorTrackerFeature::processNew() to set the member new_features_last_,
* the list of newly detected features of the capture last_ptr_. * the list of newly detected features of the capture last_ptr_.
......
...@@ -112,8 +112,8 @@ class ProcessorTrackerLandmark : public ProcessorTracker ...@@ -112,8 +112,8 @@ class ProcessorTrackerLandmark : public ProcessorTracker
* *
* IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead. * IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead.
* Then, they will be already linked to the _capture. * Then, they will be already linked to the _capture.
* If you detect all the features at once in `preprocess()`, you should either emplace them (`FeatureBase::emplace()`) and remove the not returned features in _features_out (`FeatureBase::remove()`), * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the
* or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). * features that are returned in _features_out (`FeatureBase::link(_capture)`).
* *
* \return the number of landmarks found * \return the number of landmarks found
*/ */
...@@ -150,8 +150,8 @@ class ProcessorTrackerLandmark : public ProcessorTracker ...@@ -150,8 +150,8 @@ class ProcessorTrackerLandmark : public ProcessorTracker
* *
* IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead. * IMPORTANT: The features in _features_out should be emplaced. Don't use `make_shared`, use `FeatureBase::emplace` instead.
* Then, they will be already linked to the _capture. * Then, they will be already linked to the _capture.
* If you detect all the features at once in `preprocess()`, you should either emplace them (`FeatureBase::emplace()`) and remove the not returned features in _features_out (`FeatureBase::remove()`), * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the
* or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). * features that are returned in _features_out (`FeatureBase::link(_capture)`).
* *
* The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_, * The function is called in ProcessorTrackerLandmark::processNew() to set the member new_features_last_,
* the list of newly detected features of the capture last_ptr_. * the list of newly detected features of the capture last_ptr_.
......
...@@ -54,7 +54,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) ...@@ -54,7 +54,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
PackKeyFramePtr pack = buffer_pack_kf_.selectPack( incoming_ptr_, params_tracker_->time_tolerance); PackKeyFramePtr pack = buffer_pack_kf_.selectPack( incoming_ptr_, params_tracker_->time_tolerance);
buffer_pack_kf_.removeUpTo( pack->key_frame->getTimeStamp() ); buffer_pack_kf_.removeUpTo( pack->key_frame->getTimeStamp() );
WOLF_DEBUG( "PT ", getName(), ": KF" , pack->key_frame->id() , " callback unpacked with ts= " , pack->key_frame->getTimeStamp().get() ); WOLF_DEBUG( "PT ", getName(), " FIRST_TIME_WITH_PACK: KF" , pack->key_frame->id() , " callback unpacked with ts= " , pack->key_frame->getTimeStamp() );
// Append incoming to KF // Append incoming to KF
// pack->key_frame->addCapture(incoming_ptr_); // pack->key_frame->addCapture(incoming_ptr_);
...@@ -75,6 +75,8 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) ...@@ -75,6 +75,8 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
} }
case FIRST_TIME_WITHOUT_PACK : case FIRST_TIME_WITHOUT_PACK :
{ {
WOLF_DEBUG( "PT ", getName(), " FIRST_TIME_WITHOUT_PACK" );
FrameBasePtr kfrm = getProblem()->emplaceFrame(KEY, incoming_ptr_->getTimeStamp()); FrameBasePtr kfrm = getProblem()->emplaceFrame(KEY, incoming_ptr_->getTimeStamp());
incoming_ptr_->link(kfrm); incoming_ptr_->link(kfrm);
...@@ -97,10 +99,12 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) ...@@ -97,10 +99,12 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
{ {
// No-break case only for debug. Next case will be executed too. // No-break case only for debug. Next case will be executed too.
PackKeyFramePtr pack = buffer_pack_kf_.selectPack( incoming_ptr_, params_tracker_->time_tolerance); PackKeyFramePtr pack = buffer_pack_kf_.selectPack( incoming_ptr_, params_tracker_->time_tolerance);
WOLF_DEBUG( "PT ", getName(), ": KF" , pack->key_frame->id() , " callback unpacked with ts= " , pack->key_frame->getTimeStamp().get() ); WOLF_DEBUG( "PT ", getName(), " SECOND_TIME_WITH_PACK: KF" , pack->key_frame->id() , " callback unpacked with ts= " , pack->key_frame->getTimeStamp() );
} // @suppress("No break at end of case") } // @suppress("No break at end of case")
case SECOND_TIME_WITHOUT_PACK : case SECOND_TIME_WITHOUT_PACK :
{ {
WOLF_DEBUG( "PT ", getName(), " SECOND_TIME_WITHOUT_PACK" );
FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, incoming_ptr_->getTimeStamp()); FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, incoming_ptr_->getTimeStamp());
incoming_ptr_->link(frm); incoming_ptr_->link(frm);
...@@ -126,7 +130,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) ...@@ -126,7 +130,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
PackKeyFramePtr pack = buffer_pack_kf_.selectPack( last_ptr_ , params_tracker_->time_tolerance); PackKeyFramePtr pack = buffer_pack_kf_.selectPack( last_ptr_ , params_tracker_->time_tolerance);
buffer_pack_kf_.removeUpTo( pack->key_frame->getTimeStamp() ); buffer_pack_kf_.removeUpTo( pack->key_frame->getTimeStamp() );
WOLF_DEBUG( "PT ", getName(), ": KF" , pack->key_frame->id() , " callback unpacked with ts= " , pack->key_frame->getTimeStamp().get() ); WOLF_DEBUG( "PT ", getName(), " RUNNING_WITH_PACK: KF" , pack->key_frame->id() , " callback unpacked with ts= " , pack->key_frame->getTimeStamp() );
processKnown(); processKnown();
...@@ -155,6 +159,8 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) ...@@ -155,6 +159,8 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr)
} }
case RUNNING_WITHOUT_PACK : case RUNNING_WITHOUT_PACK :
{ {
WOLF_DEBUG( "PT ", getName(), " RUNNING_WITHOUT_PACK" );
processKnown(); processKnown();
if (voteForKeyFrame() && permittedKeyFrame()) if (voteForKeyFrame() && permittedKeyFrame())
......
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