[10] | 1 | // %flair:license{
|
---|
[15] | 2 | // This file is part of the Flair framework distributed under the
|
---|
| 3 | // CECILL-C License, Version 1.0.
|
---|
[10] | 4 | // %flair:license}
|
---|
[7] | 5 | /*!
|
---|
| 6 | * \file Uav.h
|
---|
| 7 | * \brief Base class to construct sensors/actuators depending on uav type
|
---|
| 8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 9 | * \date 2014/01/22
|
---|
| 10 | * \version 3.4
|
---|
| 11 | */
|
---|
| 12 |
|
---|
| 13 | #ifndef HDSUAV_H
|
---|
| 14 | #define HDSUAV_H
|
---|
| 15 |
|
---|
| 16 | #include <Object.h>
|
---|
[157] | 17 | #include <UsRangeFinder.h>
|
---|
[7] | 18 |
|
---|
| 19 | namespace flair {
|
---|
[122] | 20 | namespace filter {
|
---|
| 21 | class Ahrs;
|
---|
| 22 | class UavMultiplex;
|
---|
| 23 | }
|
---|
| 24 | namespace actuator {
|
---|
| 25 | class Bldc;
|
---|
| 26 | }
|
---|
| 27 | namespace sensor {
|
---|
| 28 | class UsRangeFinder;
|
---|
| 29 | class BatteryMonitor;
|
---|
| 30 | class Imu;
|
---|
| 31 | class Camera;
|
---|
[185] | 32 | class NmeaGps;
|
---|
[122] | 33 | }
|
---|
[7] | 34 | }
|
---|
| 35 |
|
---|
| 36 | namespace flair {
|
---|
| 37 | namespace meta {
|
---|
[15] | 38 | class MetaUsRangeFinder;
|
---|
[7] | 39 |
|
---|
[15] | 40 | /*! \class Uav
|
---|
| 41 | *
|
---|
[122] | 42 | * \brief Base class to construct sensors/actuators depending on uav type.
|
---|
| 43 | * The Object is created with
|
---|
| 44 | * the FrameworkManager as parent. FrameworkManager must be created before.
|
---|
| 45 | * Only one instance of this class is allowed by program.
|
---|
[7] | 46 | */
|
---|
[15] | 47 | class Uav : public core::Object {
|
---|
| 48 | public:
|
---|
[122] | 49 |
|
---|
| 50 | Uav(std::string name,
|
---|
[15] | 51 | filter::UavMultiplex *multiplex = NULL);
|
---|
| 52 | ~Uav();
|
---|
[7] | 53 |
|
---|
[122] | 54 | virtual void StartSensors(void)=0;
|
---|
[15] | 55 | void UseDefaultPlot(void);
|
---|
| 56 | actuator::Bldc *GetBldc(void) const;
|
---|
| 57 | filter::UavMultiplex *GetUavMultiplex(void) const;
|
---|
| 58 | sensor::Imu *GetImu(void) const;
|
---|
| 59 | filter::Ahrs *GetAhrs(void) const;
|
---|
| 60 | MetaUsRangeFinder *GetMetaUsRangeFinder(void) const;
|
---|
| 61 | sensor::UsRangeFinder *GetUsRangeFinder(void) const;
|
---|
| 62 | sensor::BatteryMonitor *GetBatteryMonitor(void) const;
|
---|
| 63 | sensor::Camera *GetVerticalCamera(void) const;
|
---|
[121] | 64 | sensor::Camera *GetHorizontalCamera(void) const;
|
---|
[185] | 65 | sensor::NmeaGps *GetGps(void) const;
|
---|
[122] | 66 | virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
|
---|
[157] | 67 | virtual bool isReadyToFly(void) const { return true;}
|
---|
[165] | 68 | virtual std::string GetType(void) const=0;
|
---|
[7] | 69 |
|
---|
[15] | 70 | protected:
|
---|
| 71 | void SetBldc(const actuator::Bldc *bldc);
|
---|
| 72 | void SetMultiplex(const filter::UavMultiplex *multiplex);
|
---|
[173] | 73 | void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs)
|
---|
[15] | 74 | void SetUsRangeFinder(const sensor::UsRangeFinder *us);
|
---|
| 75 | void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
|
---|
| 76 | void SetVerticalCamera(const sensor::Camera *verticalCamera);
|
---|
[121] | 77 | void SetHorizontalCamera(const sensor::Camera *verticalCamera);
|
---|
[185] | 78 | void SetGps(const sensor::NmeaGps *gps);
|
---|
[7] | 79 |
|
---|
[15] | 80 | private:
|
---|
| 81 | sensor::Imu *imu;
|
---|
[185] | 82 | sensor::NmeaGps *gps;
|
---|
[15] | 83 | filter::Ahrs *ahrs;
|
---|
| 84 | actuator::Bldc *bldc;
|
---|
| 85 | filter::UavMultiplex *multiplex;
|
---|
| 86 | sensor::UsRangeFinder *us;
|
---|
| 87 | MetaUsRangeFinder *meta_us;
|
---|
| 88 | sensor::BatteryMonitor *battery;
|
---|
[121] | 89 | sensor::Camera *verticalCamera,*horizontalCamera;
|
---|
[15] | 90 | };
|
---|
[122] | 91 |
|
---|
| 92 | /*!
|
---|
| 93 | * \brief get Uav
|
---|
| 94 | *
|
---|
| 95 | * \return the Uav
|
---|
| 96 | */
|
---|
| 97 | Uav *GetUav(void);
|
---|
| 98 |
|
---|
[7] | 99 | } // end namespace meta
|
---|
| 100 | } // end namespace flair
|
---|
| 101 | #endif // HDSUAV_H
|
---|