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

Merge branch '254-problem-getcurrentstateandstamp-x-requires-x-of-the-proper-size' into 'devel'

Resolve "Problem::getCurrentStateAndStamp(x) requires x of the proper size"

Closes #254

See merge request !321
parents f064b9bf 60ca451e
No related branches found
No related tags found
1 merge request!321Resolve "Problem::getCurrentStateAndStamp(x) requires x of the proper size"
Pipeline #4316 passed
...@@ -515,6 +515,13 @@ inline Eigen::VectorXs ProcessorMotion::getCurrentState() ...@@ -515,6 +515,13 @@ inline Eigen::VectorXs ProcessorMotion::getCurrentState()
inline void ProcessorMotion::getCurrentState(Eigen::VectorXs& _x) inline void ProcessorMotion::getCurrentState(Eigen::VectorXs& _x)
{ {
// ensure integrity
assert(origin_ptr_ && "Trying to access origin_ptr_ but it is nullptr!");
// ensure proper size of the provided reference
_x.resize( getProblem()->getFrameStructureSize() );
// do get timestamp and state corrected by possible self-calibrations
Scalar Dt = getCurrentTimeStamp() - origin_ptr_->getTimeStamp(); Scalar Dt = getCurrentTimeStamp() - origin_ptr_->getTimeStamp();
statePlusDelta(origin_ptr_->getFrame()->getState(), last_ptr_->getDeltaCorrected(origin_ptr_->getCalibration()), Dt, _x); statePlusDelta(origin_ptr_->getFrame()->getState(), last_ptr_->getDeltaCorrected(origin_ptr_->getCalibration()), Dt, _x);
} }
......
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