Pr opt flow (#482)

* optical flow: fixed calculation of velocity of the flow sensor relative to
the IMU

- gyroXYZ holds a delta angle and first needs to converted to a gyro rate

Signed-off-by: Roman <bapstroman@gmail.com>

* optical flow: calculate height above the ground with respect to the flow
camera
- the flow camera can be offset from the IMU which needs to be considered

Signed-off-by: Roman <bapstroman@gmail.com>

* estimator interface: fixed comment regarding optical flow sample timestamp

- the timestamp on an optical flow sample corresponds to the trailing
edge of the flow integration period

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman Bapst
2018-07-16 11:41:35 +10:00
committed by Paul Riseborough
parent 4d59c834eb
commit ee85a29202
2 changed files with 15 additions and 5 deletions
+1 -1
View File
@@ -380,7 +380,7 @@ void EstimatorInterface::setOpticalFlowData(uint64_t time_usec, flow_message *fl
// If flow quality fails checks on ground, assume zero flow rate after body rate compensation
if ((delta_time_good && flow_quality_good && (flow_magnitude_good || relying_on_flow)) || !_control_status.flags.in_air) {
flowSample optflow_sample_new;
// calculate the system time-stamp for the leading edge of the flow data integration period
// calculate the system time-stamp for the trailing edge of the flow data integration period
optflow_sample_new.time_us = time_usec - _params.flow_delay_ms * 1000;
// copy the quality metric returned by the PX4Flow sensor