Flair
Framework Libre Air
Uav.h
Go to the documentation of this file.
1 // %flair:license{
2 // This file is part of the Flair framework distributed under the
3 // CECILL-C License, Version 1.0.
4 // %flair:license}
13 #ifndef HDSUAV_H
14 #define HDSUAV_H
15 
16 #include <Object.h>
17 #include <UsRangeFinder.h>
18 
19 namespace flair {
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  }
33 }
34 
35 namespace flair {
36 namespace meta {
37 class MetaUsRangeFinder;
38 
46 class Uav : public core::Object {
47 public:
48 
49  Uav(std::string name,
50  filter::UavMultiplex *multiplex = NULL);
51  ~Uav();
52 
53  virtual void StartSensors(void)=0;
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;
63  sensor::Camera *GetHorizontalCamera(void) const;
64  virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
65  virtual bool isReadyToFly(void) const { return true;}
66  virtual std::string GetType(void) const=0;
67 
68 protected:
69  void SetBldc(const actuator::Bldc *bldc);
70  void SetMultiplex(const filter::UavMultiplex *multiplex);
71  void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs)
72  void SetUsRangeFinder(const sensor::UsRangeFinder *us);
73  void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
74  void SetVerticalCamera(const sensor::Camera *verticalCamera);
75  void SetHorizontalCamera(const sensor::Camera *verticalCamera);
76 
77 private:
78  sensor::Imu *imu;
79  filter::Ahrs *ahrs;
80  actuator::Bldc *bldc;
81  filter::UavMultiplex *multiplex;
83  MetaUsRangeFinder *meta_us;
84  sensor::BatteryMonitor *battery;
85  sensor::Camera *verticalCamera,*horizontalCamera;
86 };
87 
93 Uav *GetUav(void);
94 
95 } // end namespace meta
96 } // end namespace flair
97 #endif // HDSUAV_H
Base class for Camera.
Definition: Camera.h:39
Base class for all Framework's classes.
Definition: Object.h:77
namespace of the flair Framework
Definition: Ahrs.h:19
Base class for UsRangeFinder.
Definition: UsRangeFinder.h:40
Base class for Imu.
Definition: Imu.h:44
Base class for UsRangeFinder.
Abstract class for AHRS.
Definition: Ahrs.h:44
Uav * GetUav(void)
get Uav
Class defining uav multiplexing.
Definition: UavMultiplex.h:37
Classe haut niveau pour capteur à ultra son.
Definition: MetaUsRangeFinder.h:40
Base class for all Framework's classes.
Base class for battery monitor.
Definition: BatteryMonitor.h:35
Base class to construct sensors/actuators depending on uav type. The Object is created with the Frame...
Definition: Uav.h:46
Base class for brushless motors drivers.
Definition: Bldc.h:37