mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 16:03:34 +08:00
clean up variable declaration
This commit is contained in:
committed by
Mathieu Bresciani
parent
f69361f742
commit
84134e5123
@@ -40,11 +40,10 @@ void OpticalFlowCheck::checkAndReport(const Context &context, Report &reporter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const bool exists = _vehicle_optical_flow_sub.advertised();
|
const bool exists = _vehicle_optical_flow_sub.advertised();
|
||||||
bool valid = false;
|
|
||||||
|
|
||||||
if (exists) {
|
if (exists) {
|
||||||
vehicle_optical_flow_s flow_sens;
|
vehicle_optical_flow_s flow_sens;
|
||||||
valid = _vehicle_optical_flow_sub.copy(&flow_sens) && (hrt_elapsed_time(&flow_sens.timestamp) < 1_s);
|
const bool valid = _vehicle_optical_flow_sub.copy(&flow_sens) && (hrt_elapsed_time(&flow_sens.timestamp) < 1_s);
|
||||||
reporter.setIsPresent(health_component_t::optical_flow);
|
reporter.setIsPresent(health_component_t::optical_flow);
|
||||||
|
|
||||||
if (!valid) {
|
if (!valid) {
|
||||||
|
|||||||
Reference in New Issue
Block a user