Browse Source

AP_HAL_Empty: add support for OpticalFlow

Void driver
master
Julien BERAUD 9 years ago committed by Andrew Tridgell
parent
commit
d14f4104ea
  1. 1
      libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h
  2. 1
      libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h
  3. 6
      libraries/AP_HAL_Empty/HAL_Empty_Class.cpp
  4. 24
      libraries/AP_HAL_Empty/OpticalFlow.h

1
libraries/AP_HAL_Empty/AP_HAL_Empty_Namespace.h

@ -6,6 +6,7 @@ namespace Empty {
class DigitalSource; class DigitalSource;
class GPIO; class GPIO;
class I2CDriver; class I2CDriver;
class OpticalFlow;
class PrivateMember; class PrivateMember;
class RCInput; class RCInput;
class RCOutput; class RCOutput;

1
libraries/AP_HAL_Empty/AP_HAL_Empty_Private.h

@ -17,6 +17,7 @@
#include "Semaphores.h" #include "Semaphores.h"
#include "Scheduler.h" #include "Scheduler.h"
#include "Util.h" #include "Util.h"
#include "OpticalFlow.h"
#include "PrivateMember.h" #include "PrivateMember.h"
#endif // __AP_HAL_EMPTY_PRIVATE_H__ #endif // __AP_HAL_EMPTY_PRIVATE_H__

6
libraries/AP_HAL_Empty/HAL_Empty_Class.cpp

@ -22,6 +22,7 @@ static RCInput rcinDriver;
static RCOutput rcoutDriver; static RCOutput rcoutDriver;
static Scheduler schedulerInstance; static Scheduler schedulerInstance;
static Util utilInstance; static Util utilInstance;
static OpticalFlow opticalFlowDriver;
HAL_Empty::HAL_Empty() : HAL_Empty::HAL_Empty() :
AP_HAL::HAL( AP_HAL::HAL(
@ -41,8 +42,9 @@ HAL_Empty::HAL_Empty() :
&rcinDriver, &rcinDriver,
&rcoutDriver, &rcoutDriver,
&schedulerInstance, &schedulerInstance,
&utilInstance), &utilInstance,
_member(new PrivateMember(123)) &opticalFlowDriver),
_member(new EmptyPrivateMember(123))
{} {}
void HAL_Empty::run(int argc, char* const argv[], Callbacks* callbacks) const void HAL_Empty::run(int argc, char* const argv[], Callbacks* callbacks) const

24
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 <http://www.gnu.org/licenses/>.
*/
#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
Loading…
Cancel
Save