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

fixed bootstrapping

parent 263cb1e1
No related branches found
No related tags found
1 merge request!49Draft: Resolve "Adapt to new sensor constructors in core"
...@@ -318,8 +318,15 @@ void ProcessorImu3d::bootstrap() ...@@ -318,8 +318,15 @@ void ProcessorImu3d::bootstrap()
// ALL TIMES: // ALL TIMES:
// To all frames not processed yet: // To all frames not processed yet:
// Fix zero velocity, initialize zero PO, and add zero 3D relative pose factors // Fix zero velocity, initialize zero PO, and add zero 3D relative pose factors
while (bootstrap_last_frame_ != getProblem()->getLastFrame()) while (bootstrap_last_frame_ != getProblem()->getLastFrame() and getProblem()->getLastFrame())
{ {
// first frame
if (not bootstrap_last_frame_)
bootstrap_last_frame_ = first_capture->getFrame();
else
// next
bootstrap_last_frame_ = bootstrap_last_frame_->getNextFrame();
// emplace missing states // emplace missing states
getProblem()->emplaceStatesToFrame(bootstrap_last_frame_, getProblem()->stateZero(getStateKeys())); getProblem()->emplaceStatesToFrame(bootstrap_last_frame_, getProblem()->stateZero(getStateKeys()));
...@@ -328,7 +335,8 @@ void ProcessorImu3d::bootstrap() ...@@ -328,7 +335,8 @@ void ProcessorImu3d::bootstrap()
bootstrap_last_frame_->getV()->fix(); bootstrap_last_frame_->getV()->fix();
// Initialize state as same as first frame // Initialize state as same as first frame
bootstrap_last_frame_->setState(first_capture->getFrame()->getState("PO")); if (first_capture->getFrame() != bootstrap_last_frame_)
bootstrap_last_frame_->setState(first_capture->getFrame()->getState("PO"));
// Factor zero-relative pose // Factor zero-relative pose
if (bootstrap_last_frame_->getPreviousFrame()) if (bootstrap_last_frame_->getPreviousFrame())
...@@ -348,13 +356,10 @@ void ProcessorImu3d::bootstrap() ...@@ -348,13 +356,10 @@ void ProcessorImu3d::bootstrap()
false, false,
TOP_MOTION); TOP_MOTION);
} }
// next
bootstrap_last_frame_ = bootstrap_last_frame_->getNextFrame();
} }
// ONLY AFTER bootstrap_averaging_length_ seconds: // ONLY AFTER bootstrap_averaging_length_ seconds:
// Orientation initialization aligning with g // To all problem: Orientation initialization aligning with g
if (t_current - first_capture->getTimeStamp() >= bootstrap_averaging_length_) if (t_current - first_capture->getTimeStamp() >= bootstrap_averaging_length_)
{ {
// get initial IMU frame 's' expressed in local world frame 'l' // get initial IMU frame 's' expressed in local world frame 'l'
......
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