diff --git a/include/core/processor/processor_tracker_feature.h b/include/core/processor/processor_tracker_feature.h index 1225ab73e4cb2c6b1d8f4f0f735f858d0741309f..a808a421da22a74ad417b6cdc38024f308ff59bf 100644 --- a/include/core/processor/processor_tracker_feature.h +++ b/include/core/processor/processor_tracker_feature.h @@ -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. * 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()`), - * or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). + * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the + * features that are returned in _features_out (`FeatureBase::link(_capture)`). * * \return the number of features tracked */ @@ -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. * 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()`), - * or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). + * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the + * 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 list of newly detected features of the capture last_ptr_. diff --git a/include/core/processor/processor_tracker_landmark.h b/include/core/processor/processor_tracker_landmark.h index f539a4cab26725b612f0b17a9b4fbe1af5d65cdd..c11adecc7b16a9c0c2d367200af6ee9a55d46c64 100644 --- a/include/core/processor/processor_tracker_landmark.h +++ b/include/core/processor/processor_tracker_landmark.h @@ -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. * 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()`), - * or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). + * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the + * features that are returned in _features_out (`FeatureBase::link(_capture)`). * * \return the number of landmarks found */ @@ -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. * 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()`), - * or create them (`make_shared()`) and link all the returned features in _features_out (`FeatureBase::link(_capture)`). + * If you detect all the features at once in preprocess(), you should create them (`make_shared()`) and only link the + * 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 list of newly detected features of the capture last_ptr_. diff --git a/src/processor/processor_tracker.cpp b/src/processor/processor_tracker.cpp index b1c67806c6ab4a7ff2a82f0c10a53ab6a3953adf..3cde80f33ac88d48ef30d56daf0a43a3ffe7c075 100644 --- a/src/processor/processor_tracker.cpp +++ b/src/processor/processor_tracker.cpp @@ -54,7 +54,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) PackKeyFramePtr pack = buffer_pack_kf_.selectPack( incoming_ptr_, params_tracker_->time_tolerance); 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 // pack->key_frame->addCapture(incoming_ptr_); @@ -75,6 +75,8 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) } case FIRST_TIME_WITHOUT_PACK : { + WOLF_DEBUG( "PT ", getName(), " FIRST_TIME_WITHOUT_PACK" ); + FrameBasePtr kfrm = getProblem()->emplaceFrame(KEY, incoming_ptr_->getTimeStamp()); incoming_ptr_->link(kfrm); @@ -97,10 +99,12 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) { // No-break case only for debug. Next case will be executed too. 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") case SECOND_TIME_WITHOUT_PACK : { + WOLF_DEBUG( "PT ", getName(), " SECOND_TIME_WITHOUT_PACK" ); + FrameBasePtr frm = getProblem()->emplaceFrame(NON_ESTIMATED, incoming_ptr_->getTimeStamp()); incoming_ptr_->link(frm); @@ -126,7 +130,7 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) PackKeyFramePtr pack = buffer_pack_kf_.selectPack( last_ptr_ , params_tracker_->time_tolerance); 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(); @@ -155,6 +159,8 @@ void ProcessorTracker::process(CaptureBasePtr const _incoming_ptr) } case RUNNING_WITHOUT_PACK : { + WOLF_DEBUG( "PT ", getName(), " RUNNING_WITHOUT_PACK" ); + processKnown(); if (voteForKeyFrame() && permittedKeyFrame())