There are 3 types of frames: regular, aux and key. The last 2 are estimated by the solver.
Auxiliary Frames were though for the problem of visual(-inertial) problem in which the recent past has to be populated with a lot of (estimated) frames in the problem. But after some time passed, only keep some (key) frames in the problem. Most of the machinery related with this frames is not implemented. Auxiliary frames are not used nowhere.
Before creating auxiliary frames (and currently), key-frame is used as equivalent to estimated frame and non-key as non-estimated.
Since !349 (merged) in wolf there is the TreeManager class. Now, only the sliding window is implemented. Sparsification algorithms should be able to fit in this TreeManager
The differentiation between auxiliary and key frames is mostly related with the management of the graph (tree). The solver, the problem, doesn't care about this I think.
I propose to remove all the (not working) code related with auxiliary frames. And change the meaning of key (so its name) to estimated.
@jsola this mainly involves you, what is your opinion?
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
"Estimated" and "NotEstimated" are quite long for the respective functions (setEstimated(), setNotEstimated(), isEstimated()...). @jsola do you have any alternative?
I don't think so. The issue you linked says "key" everywhere meaning "estimated". I think all three agreements listed before are still valid. The second requires a name for "estimated" and "not estimated".
I mean: now, all frames in Trajectory will be estimated, so what is the point of having a marker Estimated/NonEstimated?
If what you mean with setEstimated() is a method to:
Link the Frame which was in the Processor to the Trajectory
Set problem
Register its state blocks
then I would probably go for something like estimate() or addToProblem() or similar semantics, not necessarily setEstimated() which from the outside looks like a simple setter.
The non estimated frames are the ones that are floating (not linked to the WOLF tree), so I think that they are not REGULAR at all..
In the current implementation (since we removed the non-key frames from trajectory), we should rethink the names. There is only floating non-estimated frames and linked estimated frames. The second ones are the typical ones (actually I proposed to avoid floating frames, they are not useful, but anyway...). I would skip the KEY/NON-KEY nomenclature, enum and functionality. The only difference is if the frames is linked to the tree. If you don't want to estimate it, either you fix it or you remove it. Let's discuss it in a meeting...
As per Capture:move(), the condition isKey() has been replaced by getProblem() so that if a frame has no Problem then you cannot move it there. However, I do not fully understand these asserts, they seem to check the opposite than what we want?
voidCaptureBase::move(FrameBasePtr_frm_ptr){WOLF_WARN_COND(this->getFrame()==nullptr,"moving a capture not linked to any frame");WOLF_WARN_COND(_frm_ptr==nullptr,"moving a capture to a null FrameBasePtr");assert((this->getFrame()==nullptr||this->getFrame()->getProblem())&&"Forbidden: moving a capture already linked to a KF");assert((_frm_ptr==nullptr||!_frm_ptr->getProblem())&&"Forbidden: moving a capture to a non-estimated frame");// Unlinkif(this->getFrame()){// unlink from previous non-key framethis->getFrame()->removeCapture(shared_from_this());this->setFrame(nullptr);}// linklink(_frm_ptr);}
Because in ProcessorTracker this is how move is used:
// Capture last_ is added to the new keyframeFrameBasePtrlast_old_frame=last_ptr_->getFrame();last_ptr_->move(pack->key_frame);last_old_frame->remove();
OK so these asserts were actually completely wrong --- amazing how things worked, probably no-one was testing move() in any of the gtests -- but what about the demos?
Here a TEST of the move() function:
TEST(CaptureBase,move){ProblemPtrproblem=Problem::create("PO",2);autoKF=problem->emplaceFrame(0.0);// dummy F objectautoKC=CaptureBase::emplace<CaptureBase>(KF,"Dummy",0.0);autoF=std::make_shared<FrameBase>(0.0,nullptr);// dummy F objectautoC=CaptureBase::emplace<CaptureBase>(F,"Dummy",0.0);ASSERT_EQ(KF->getCaptureList().size(),1);ASSERT_EQ(F->getCaptureList().size(),1);C->move(KF);ASSERT_EQ(KF->getCaptureList().size(),2);ASSERT_EQ(F->getCaptureList().size(),0);}
which passes only if the asserts in move are written as:
assert((this->getFrame()==nullptr||!this->getFrame()->getProblem())&&"Forbidden: moving a capture already linked to a KF");assert((_frm_ptr==nullptr||_frm_ptr->getProblem())&&"Forbidden: moving a capture to a non-estimated frame");
voidCaptureBase::move(FrameBasePtr_frm_ptr){WOLF_WARN_COND(this->getFrame()==nullptr,"moving a capture not linked to any frame. Consider just linking it with link() instead of move()!");assert((this->getFrame()==nullptr||notthis->getFrame()->getProblem())&&"Forbidden: moving a capture already linked to a KF");assert((_frm_ptr!=nullptr)&&"Forbidden: moving a capture to a null frame");assert((_frm_ptr!=nullptr&&_frm_ptr->getProblem())&&"Forbidden: moving a capture to a non-estimated frame");// Unlinkif(this->getFrame()){// unlink from previous non-key framethis->getFrame()->removeCapture(shared_from_this());this->setFrame(nullptr);}// linklink(_frm_ptr);}