diff --git a/src/processor_motion.cpp b/src/processor_motion.cpp index 3760d89dfdd341379056a22582c97b5e488da04a..bc3734a9b847b9a47d1e375b60737e67ffdbee39 100644 --- a/src/processor_motion.cpp +++ b/src/processor_motion.cpp @@ -286,7 +286,7 @@ void ProcessorMotion::process(CaptureBasePtr _incoming_ptr) void ProcessorMotion::getState(const TimeStamp& _ts, Eigen::VectorXs& _x) { CaptureMotionPtr capture_motion; - if (_ts >= origin_ptr_->getTimeStamp()) + if (origin_ptr_ && _ts >= origin_ptr_->getTimeStamp()) // timestamp found in the current processor buffer capture_motion = last_ptr_; else @@ -302,8 +302,12 @@ void ProcessorMotion::getState(const TimeStamp& _ts, Eigen::VectorXs& _x) statePlusDelta(state_0, delta, dt, _x); } else + { // We could not find any CaptureMotion for the time stamp requested - std::runtime_error("Could not find any Capture for the time stamp requested"); + WOLF_ERROR("Could not find any Capture for the time stamp requested. "); + WOLF_TRACE("Did you forget to call Problem::setPrior() in your application?") + throw std::runtime_error("Could not find any Capture for the time stamp requested. Did you forget to call Problem::setPrior() in your application?"); + } } CaptureMotionPtr ProcessorMotion::findCaptureContainingTimeStamp(const TimeStamp& _ts) const