source: flair-src/trunk/lib/FlairMeta/src/Uav.h@ 157

Last change on this file since 157 was 157, checked in by Sanahuja Guillaume, 5 years ago

iadded isready to iodevice:
avoid problem of imu not ready in ardrone2

File size: 2.5 KB
RevLine 
[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
19namespace 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;
32 }
[7]33}
34
35namespace flair {
36namespace meta {
[15]37class MetaUsRangeFinder;
[7]38
[15]39/*! \class Uav
40*
[122]41* \brief Base class to construct sensors/actuators depending on uav type.
42* The Object is created with
43* the FrameworkManager as parent. FrameworkManager must be created before.
44* Only one instance of this class is allowed by program.
[7]45*/
[15]46class Uav : public core::Object {
47public:
[122]48
49 Uav(std::string name,
[15]50 filter::UavMultiplex *multiplex = NULL);
51 ~Uav();
[7]52
[122]53 virtual void StartSensors(void)=0;
[15]54 void UseDefaultPlot(void);
55 actuator::Bldc *GetBldc(void) const;
56 filter::UavMultiplex *GetUavMultiplex(void) const;
57 sensor::Imu *GetImu(void) const;
58 filter::Ahrs *GetAhrs(void) const;
59 MetaUsRangeFinder *GetMetaUsRangeFinder(void) const;
60 sensor::UsRangeFinder *GetUsRangeFinder(void) const;
61 sensor::BatteryMonitor *GetBatteryMonitor(void) const;
62 sensor::Camera *GetVerticalCamera(void) const;
[121]63 sensor::Camera *GetHorizontalCamera(void) const;
[122]64 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
[157]65 virtual bool isReadyToFly(void) const { return true;}
[7]66
[15]67protected:
68 void SetBldc(const actuator::Bldc *bldc);
69 void SetMultiplex(const filter::UavMultiplex *multiplex);
70 void SetAhrs(const filter::Ahrs *ahrs);
71 void SetUsRangeFinder(const sensor::UsRangeFinder *us);
72 void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
73 void SetVerticalCamera(const sensor::Camera *verticalCamera);
[121]74 void SetHorizontalCamera(const sensor::Camera *verticalCamera);
[7]75
[15]76private:
77 sensor::Imu *imu;
78 filter::Ahrs *ahrs;
79 actuator::Bldc *bldc;
80 filter::UavMultiplex *multiplex;
81 sensor::UsRangeFinder *us;
82 MetaUsRangeFinder *meta_us;
83 sensor::BatteryMonitor *battery;
[121]84 sensor::Camera *verticalCamera,*horizontalCamera;
[15]85};
[122]86
87/*!
88* \brief get Uav
89*
90* \return the Uav
91*/
92Uav *GetUav(void);
93
[7]94} // end namespace meta
95} // end namespace flair
96#endif // HDSUAV_H
Note: See TracBrowser for help on using the repository browser.