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

bug fixes

parent 3f4118a7
No related branches found
No related tags found
1 merge request!274Resolve "Emplace API inconsistent with ProcessorTrackerFeature/Landmark functions"
......@@ -138,7 +138,7 @@ void FactorBase::setStatus(FactorStatus _status)
void FactorBase::link(FeatureBasePtr _ftr_ptr)
{
if (this->getFeature() != _ftr_ptr)
if (this->getFeature() && this->getFeature() != _ftr_ptr)
unlink();
if(_ftr_ptr)
......
......@@ -46,9 +46,10 @@ void TrackMatrix::newTrack(FeatureBasePtr _ftr)
void TrackMatrix::add(const SizeStd& _track_id, const FeatureBasePtr& _ftr)
{
assert( tracks_.count(_track_id) != 0 && "Provided track ID does not exist. Use newTrack() instead.");
assert(( tracks_.count(_track_id) != 0 || _track_id == track_id_count_) && "Provided track ID does not exist. Use newTrack() instead.");
assert( _ftr->getCapture() != nullptr && "adding a feature not linked to any capture");
_ftr->setTrackId(_track_id);
tracks_[_track_id].emplace(_ftr->getCapture()->getTimeStamp(), _ftr);
snapshots_[_ftr->getCapture()->id()].emplace(_track_id, _ftr); // will create new snapshot if _cap_id is not present
}
......
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