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

Remove origin_frame from CaptureMotion

parent e7ad2e38
No related branches found
No related tags found
1 merge request!318CaptureMotion: replace origin_frame_ptr_ by capture_origin_ptr_.
Pipeline #4262 passed
...@@ -97,8 +97,6 @@ class CaptureMotion : public CaptureBase ...@@ -97,8 +97,6 @@ class CaptureMotion : public CaptureBase
virtual VectorXs correctDelta(const VectorXs& _delta, const VectorXs& _delta_error) const; virtual VectorXs correctDelta(const VectorXs& _delta, const VectorXs& _delta_error) const;
// Origin frame and capture // Origin frame and capture
FrameBasePtr getOriginFrame();
void setOriginFrame(FrameBasePtr _frame_ptr);
CaptureBasePtr getOriginCapture(); CaptureBasePtr getOriginCapture();
void setOriginCapture(CaptureBasePtr _origin_capture); void setOriginCapture(CaptureBasePtr _origin_capture);
...@@ -108,7 +106,6 @@ class CaptureMotion : public CaptureBase ...@@ -108,7 +106,6 @@ class CaptureMotion : public CaptureBase
Eigen::MatrixXs data_cov_; ///< Motion data covariance Eigen::MatrixXs data_cov_; ///< Motion data covariance
Eigen::VectorXs calib_preint_; ///< Calibration parameters used during pre-integration Eigen::VectorXs calib_preint_; ///< Calibration parameters used during pre-integration
MotionBuffer buffer_; ///< Buffer of motions between this Capture and the next one. MotionBuffer buffer_; ///< Buffer of motions between this Capture and the next one.
// FrameBaseWPtr origin_frame_ptr_; ///< Pointer to the origin frame of the motion
CaptureBaseWPtr origin_capture_; ///< Pointer to the origin capture of the motion CaptureBaseWPtr origin_capture_; ///< Pointer to the origin capture of the motion
}; };
...@@ -161,18 +158,6 @@ inline Eigen::VectorXs CaptureMotion::correctDelta(const VectorXs& _delta, const ...@@ -161,18 +158,6 @@ inline Eigen::VectorXs CaptureMotion::correctDelta(const VectorXs& _delta, const
return _delta + _delta_error; return _delta + _delta_error;
} }
inline FrameBasePtr CaptureMotion::getOriginFrame()
{
return getOriginCapture()->getFrame();
}
inline void CaptureMotion::setOriginFrame(FrameBasePtr _frame_ptr)
{
auto sensor = getSensor();
if (_frame_ptr && sensor)
origin_capture_ = _frame_ptr->getCaptureOf(sensor);
}
inline wolf::CaptureBasePtr CaptureMotion::getOriginCapture() inline wolf::CaptureBasePtr CaptureMotion::getOriginCapture()
{ {
return origin_capture_.lock(); return origin_capture_.lock();
......
...@@ -348,8 +348,8 @@ bool ProcessorMotion::getState(const TimeStamp& _ts, Eigen::VectorXs& _x) ...@@ -348,8 +348,8 @@ bool ProcessorMotion::getState(const TimeStamp& _ts, Eigen::VectorXs& _x)
if (capture_motion) // We found a CaptureMotion whose buffer contains the time stamp if (capture_motion) // We found a CaptureMotion whose buffer contains the time stamp
{ {
// Get origin state and calibration // Get origin state and calibration
VectorXs state_0 = capture_motion->getOriginFrame()->getState();
CaptureBasePtr cap_orig = capture_motion->getOriginCapture(); CaptureBasePtr cap_orig = capture_motion->getOriginCapture();
VectorXs state_0 = cap_orig->getFrame()->getState();
VectorXs calib = cap_orig->getCalibration(); VectorXs calib = cap_orig->getCalibration();
// Get delta and correct it with new calibration params // Get delta and correct it with new calibration params
......
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