Browse Source

AP_NavEKF2: Add flow sensor body position offset to data buffer

master
priseborough 8 years ago committed by Andrew Tridgell
parent
commit
397033b7c3
  1. 2
      libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp
  2. 1
      libraries/AP_NavEKF2/AP_NavEKF2_core.h

2
libraries/AP_NavEKF2/AP_NavEKF2_Measurements.cpp

@ -142,6 +142,8 @@ void NavEKF2_core::writeOptFlowMeas(uint8_t &rawFlowQuality, Vector2f &rawFlowRa @@ -142,6 +142,8 @@ void NavEKF2_core::writeOptFlowMeas(uint8_t &rawFlowQuality, Vector2f &rawFlowRa
// write uncorrected flow rate measurements that will be used by the focal length scale factor estimator
// note correction for different axis and sign conventions used by the px4flow sensor
ofDataNew.flowRadXY = - rawFlowRates; // raw (non motion compensated) optical flow angular rate about the X axis (rad/sec)
// write the flow sensor position in body frame
ofDataNew.body_offset = posOffset;
// write flow rate measurements corrected for body rates
ofDataNew.flowRadXYcomp.x = ofDataNew.flowRadXY.x + omegaAcrossFlowTime.x;
ofDataNew.flowRadXYcomp.y = ofDataNew.flowRadXY.y + omegaAcrossFlowTime.y;

1
libraries/AP_NavEKF2/AP_NavEKF2_core.h

@ -402,6 +402,7 @@ private: @@ -402,6 +402,7 @@ private:
Vector2f flowRadXY; // 0..1
Vector2f flowRadXYcomp; // 2..3
uint32_t time_ms; // 4
Vector3f body_offset; // 5..7
};
// update the navigation filter status

Loading…
Cancel
Save