// The raw measurements need to be optical flow rates in radians/second, however they are currently output by the sensor as pixels over an internal sampling period
// A modified PX4flow firmware has been used which effectivly sets the range used to calculate the velocity internally within the px4flow sensor to unity
// so that the velocity outputs are in radians/sec
// This filter uses a different definition of optical flow rates to the sensor with a positive optical flow rate produced by a negative sensor rotation about that axis,
// hence the need to swap axes and signs.
// The raw measurements need to be optical flow rates in radians/second averaged across the time since the last update
// The PX4Flow sensor outputs flow rates with the following axis and sign conventions:
// A positive X rate is produced by a positive velocity over ground in the X direction
// A positive Y rate is produced by a positive velocity over ground in the Y direction
// This filter uses a different definition of optical flow rates to the sensor with a positive optical flow rate produced by a
// negative rotation about that axis. For example a positive rotation of the flight vehicle about its X (roll) axis would produce a negative X flow rate
flowMeaTime_ms=msecFlowMeas;
if(rawFlowQuality>150){
flowQuality=rawFlowQuality;
// recall vehicle states at mid sample time for flow observations allowing for delays