mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-18 14:48:28 -04:00
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;
|
static DummyVehicle vehicle;
|
||||||
|
#if AP_OPTICALFLOW_ENABLED
|
||||||
static OpticalFlow optflow;
|
static OpticalFlow optflow;
|
||||||
|
#endif
|
||||||
|
|
||||||
void setup()
|
void setup()
|
||||||
{
|
{
|
||||||
@ -39,12 +41,16 @@ void setup()
|
|||||||
|
|
||||||
hal.scheduler->delay(1000);
|
hal.scheduler->delay(1000);
|
||||||
|
|
||||||
|
#if AP_OPTICALFLOW_ENABLED
|
||||||
// flowSensor initialization
|
// flowSensor initialization
|
||||||
optflow.init(-1);
|
optflow.init(-1);
|
||||||
|
|
||||||
if (!optflow.healthy()) {
|
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);
|
hal.scheduler->delay(1000);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user