mirror of https://github.com/ArduPilot/ardupilot
AP_OpticalFlow: fix example when OpticalFlow compiled out
This commit is contained in:
parent
5a421c7eb3
commit
d86c1c6fd1
|
@ -31,7 +31,9 @@ public:
|
|||
};
|
||||
|
||||
static DummyVehicle vehicle;
|
||||
#if AP_OPTICALFLOW_ENABLED
|
||||
static OpticalFlow optflow;
|
||||
#endif
|
||||
|
||||
void setup()
|
||||
{
|
||||
|
@ -39,12 +41,16 @@ void setup()
|
|||
|
||||
hal.scheduler->delay(1000);
|
||||
|
||||
#if AP_OPTICALFLOW_ENABLED
|
||||
// flowSensor initialization
|
||||
optflow.init(-1);
|
||||
|
||||
if (!optflow.healthy()) {
|
||||
hal.console->printf("Failed to initialise PX4Flow ");
|
||||
hal.console->printf("Failed to initialise OpticalFlow");
|
||||
}
|
||||
#else
|
||||
hal.console->printf("OpticalFlow compiled out");
|
||||
#endif
|
||||
|
||||
hal.scheduler->delay(1000);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue