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 UAV_H
14 #define UAV_H
15 
16 #include <Object.h>
17 #include <VrpnClient.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  class NEDPosition;
33  class PressureSensor;
34  }
35 }
36 
37 namespace flair {
38 namespace meta {
39 class MetaUsRangeFinder;
40 
48 class Uav : public core::Object {
49 public:
50 
51  Uav(std::string name,
52  filter::UavMultiplex *multiplex = NULL);
53  ~Uav();
54 
55  virtual void StartSensors(void)=0;
56  void UseDefaultPlot(void);
57  actuator::Bldc *GetBldc(void) const;
58  filter::UavMultiplex *GetUavMultiplex(void) const;
59  sensor::Imu *GetImu(void) const;
60  filter::Ahrs *GetAhrs(void) const;
61  MetaUsRangeFinder *GetMetaUsRangeFinder(void) const;
62  sensor::UsRangeFinder *GetUsRangeFinder(void) const;
63  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
64  sensor::Camera *GetVerticalCamera(void) const;
65  sensor::Camera *GetHorizontalCamera(void) const;
66  sensor::NEDPosition *GetExteriorNEDPosition(void) const;
67  sensor::NEDPosition *GetInteriorNEDPosition(void) const;
68  void SetInteriorNEDPosition(const sensor::NEDPosition *nedPosition);//TODO: should be protected as the others
69  sensor::PressureSensor *GetPressureSensor(void) const;
70  virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
71  virtual sensor::VrpnClient::ConnectionType_t GetDefaultVrpnConnectionType(void) const{return sensor::VrpnClient::ConnectionType_t::Vrpn;}
72  virtual bool isReadyToFly(void) const { return true;}
73  virtual std::string GetType(void) const=0;
74 
75 protected:
76  void SetBldc(const actuator::Bldc *bldc);
77  void SetMultiplex(const filter::UavMultiplex *multiplex);
78  void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs)
79  void SetUsRangeFinder(const sensor::UsRangeFinder *us);
80  void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
81  void SetVerticalCamera(const sensor::Camera *verticalCamera);
82  void SetHorizontalCamera(const sensor::Camera *verticalCamera);
83  void SetExteriorNEDPosition(const sensor::NEDPosition *nedPosition);
84  void SetPressureSensor(const sensor::PressureSensor *pressureSensor);
85 
86 private:
87  sensor::Imu *imu;
88  sensor::NEDPosition *extNEDPosition,*intNEDPosition;
89  filter::Ahrs *ahrs;
90  actuator::Bldc *bldc;
91  filter::UavMultiplex *multiplex;
93  MetaUsRangeFinder *meta_us;
94  sensor::BatteryMonitor *battery;
95  sensor::Camera *verticalCamera,*horizontalCamera;
96  sensor::PressureSensor *pressureSensor;
97 };
98 
104 Uav *GetUav(void);
105 
106 } // end namespace meta
107 } // end namespace flair
108 #endif // UAV_H
Base class for Camera.
Definition: Camera.h:38
Base class for all Framework's classes.
Definition: Object.h:84
namespace of the flair Framework
Definition: Ahrs.h:19
Base class for PressureSensor.
Definition: PressureSensor.h:40
Base class for UsRangeFinder.
Definition: UsRangeFinder.h:40
Class to connect to a Vrpn server.
Base class for Imu.
Definition: Imu.h:44
abstract class for a NED position sensor.
Definition: NEDPosition.h:40
Abstract class for AHRS.
Definition: Ahrs.h:44
Uav * GetUav(void)
get Uav
Class defining uav multiplexing.
Definition: UavMultiplex.h:36
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:34
Base class to construct sensors/actuators depending on uav type. The Object is created with the Frame...
Definition: Uav.h:48
Base class for brushless motors drivers.
Definition: Bldc.h:36