mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
clean up variable declaration
This commit is contained in:
parent
f69361f742
commit
84134e5123
@ -40,11 +40,10 @@ void OpticalFlowCheck::checkAndReport(const Context &context, Report &reporter)
|
||||
}
|
||||
|
||||
const bool exists = _vehicle_optical_flow_sub.advertised();
|
||||
bool valid = false;
|
||||
|
||||
if (exists) {
|
||||
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);
|
||||
|
||||
if (!valid) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user