Skip to content
Snippets Groups Projects
Commit 8c09ad7c authored by Joan Solà Ortega's avatar Joan Solà Ortega
Browse files

Merge branch 'devel' into 343-problem-getstate-structure-doesn-t-care-about-structure

parents a41cad82 75a97e8d
No related branches found
No related tags found
1 merge request!379Resolve "Problem::getState(structure) doesn't care about structure"
Pipeline #5684 canceled
This commit is part of merge request !379. Comments created here will be created in the context of that merge request.
......@@ -34,7 +34,7 @@ PROJECT(wolf)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib)
SET(CMAKE_INSTALL_PREFIX /usr/local)
SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY TRUE)
SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY FALSE)
IF (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "DEBUG")
......
......@@ -290,8 +290,6 @@ inline double TimeStamp::operator -(const TimeStamp& ts) const
return double((long int)(time_stamp_nano_ - ts.time_stamp_nano_))*1e-9; // long int cast fix overflow in case of negative substraction result
}
//static const TimeStamp TimeStampInvalid() {return TimeStamp(-1.0);}
} // namespace wolf
#endif
......@@ -37,7 +37,7 @@ TimeStamp::TimeStamp(const TimeStamp& _ts) :
TimeStamp::TimeStamp(const double& _ts) :
time_stamp_nano_(_ts > 0 ? (unsigned long int)(_ts*1e9) : 0),
is_valid_(_ts > 0)
is_valid_(_ts >= 0)
{
//
}
......
......@@ -460,10 +460,17 @@ VectorComposite Problem::getState(const StateStructure& _structure) const
}
}
// check for empty blocks and fill them with the last KF, or with zeros in the worst case
// check for empty blocks and fill them with the last KF, with the prior, or with zeros in the worst case
VectorComposite state_last;
const auto& last_kf_or_aux = trajectory_ptr_->getLastKeyOrAuxFrame();
if (last_kf_or_aux) state_last = last_kf_or_aux->getState(structure);
if (last_kf_or_aux)
state_last = last_kf_or_aux->getState(structure);
else if (prior_options_ and prior_options_->mode != "nothing")
state_last = prior_options_->state;
for (const auto& ckey : structure)
{
......@@ -503,10 +510,17 @@ VectorComposite Problem::getState (const TimeStamp& _ts, const StateStructure& _
}
}
// check for empty blocks and fill them with the closest KF to ts, or with zeros in the worst case
// check for empty blocks and fill them with the closest KF to ts, with the prior, or with zeros in the worst case
VectorComposite state_last;
const auto& last_kf_or_aux = trajectory_ptr_->closestKeyOrAuxFrameToTimeStamp(_ts);
if (last_kf_or_aux) state_last = last_kf_or_aux->getState(structure);
if (last_kf_or_aux)
state_last = last_kf_or_aux->getState(structure);
else if (prior_options_ and prior_options_->mode != "nothing")
state_last = prior_options_->state;
for (const auto& ckey : structure)
{
......
......@@ -58,6 +58,24 @@ void ProcessorMotion::splitBuffer(const wolf::CaptureMotionPtr& _capture_source,
const FrameBasePtr& _keyframe_target,
const wolf::CaptureMotionPtr& _capture_target)
{
/** we are doing this:
*
* Before split:
*
* ts_split
* KF | F or KF
* * -----------------------*
* origin source
*
*
* After split:
*
* KF KF F or KF
* * ----------* -----------*
* origin target source
*
*/
// split the buffer
// and give the part of the buffer before the new keyframe to the capture for the KF callback
_capture_source->getBuffer().split(_ts_split, _capture_target->getBuffer());
......
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