diff --git a/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h b/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h index 536547d818..2c77b9c4f8 100644 --- a/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h +++ b/libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h @@ -6,6 +6,7 @@ namespace Empty { class DigitalSource; class GPIO; class I2CDriver; + class OpticalFlow; class PrivateMember; class RCInput; class RCOutput; diff --git a/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h b/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h index 4d79468766..12742bce84 100644 --- a/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h +++ b/libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h @@ -17,6 +17,7 @@ #include "Semaphores.h" #include "Scheduler.h" #include "Util.h" +#include "OpticalFlow.h" #include "PrivateMember.h" #endif // __AP_HAL_EMPTY_PRIVATE_H__ diff --git a/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp b/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp index 3d76b03d96..a42c006c2a 100644 --- a/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp +++ b/libraries/AP_HAL_Empty/HAL_Empty_Class.cpp @@ -22,6 +22,7 @@ static RCInput rcinDriver; static RCOutput rcoutDriver; static Scheduler schedulerInstance; static Util utilInstance; +static OpticalFlow opticalFlowDriver; HAL_Empty::HAL_Empty() : AP_HAL::HAL( @@ -41,8 +42,9 @@ HAL_Empty::HAL_Empty() : &rcinDriver, &rcoutDriver, &schedulerInstance, - &utilInstance), - _member(new PrivateMember(123)) + &utilInstance, + &opticalFlowDriver), + _member(new EmptyPrivateMember(123)) {} void HAL_Empty::run(int argc, char* const argv[], Callbacks* callbacks) const diff --git a/libraries/AP_HAL_Empty/OpticalFlow.h b/libraries/AP_HAL_Empty/OpticalFlow.h new file mode 100644 index 0000000000..d6f4d4aea8 --- /dev/null +++ b/libraries/AP_HAL_Empty/OpticalFlow.h @@ -0,0 +1,24 @@ +/* + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ +#ifndef __AP_HAL_EMPTY_OPTICALFLOW_H__ +#define __AP_HAL_EMPTY_OPTICALFLOW_H__ + +class Empty::OpticalFlow : public AP_HAL::OpticalFlow { +public: + void init(AP_HAL::OpticalFlow::Gyro_Cb) {return;}; + bool read(Data_Frame& frame) {return false;}; +}; + +#endif