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 
18 namespace flair {
19 namespace core {
20 class FrameworkManager;
21 }
22 namespace filter {
23 class Ahrs;
24 class UavMultiplex;
25 }
26 namespace actuator {
27 class Bldc;
28 }
29 namespace sensor {
30 class UsRangeFinder;
31 class BatteryMonitor;
32 class VrpnClient;
33 class Imu;
34 class Camera;
35 }
36 }
37 
38 namespace flair {
39 namespace meta {
40 class MetaUsRangeFinder;
41 class MetaVrpnObject;
42 
47 class Uav : public core::Object {
48 public:
49  /*
50  typedef enum {
51  None,
52  Auto,//rt serial if hds x4 ou x8, auto ip sinon
53  AutoIP,
54  UserDefinedIP,
55  AutoSerialPort,
56  } VRPNType_t;
57 */
58  // uav_name: for optitrack
59  Uav(core::FrameworkManager *parent, std::string name,
60  filter::UavMultiplex *multiplex = NULL);
61  ~Uav();
62  void SetupVRPN(std::string optitrack_address, std::string name);
63  // vrpn serial: broken, need to add serial port in uav specific code
64  // void SetupVRPNSerial(core::SerialPort *vrpn_port,std::string name,int
65  // VRPNSerialObjectId);
66  virtual void SetupVRPNAutoIP(std::string name);
67 
68  virtual void StartSensors(void);
69  void UseDefaultPlot(void);
70  actuator::Bldc *GetBldc(void) const;
71  filter::UavMultiplex *GetUavMultiplex(void) const;
72  sensor::Imu *GetImu(void) const;
73  filter::Ahrs *GetAhrs(void) const;
74  MetaUsRangeFinder *GetMetaUsRangeFinder(void) const;
75  sensor::UsRangeFinder *GetUsRangeFinder(void) const;
76  sensor::BatteryMonitor *GetBatteryMonitor(void) const;
77  sensor::VrpnClient *GetVrpnClient(void) const;
78  meta::MetaVrpnObject *GetVrpnObject(void) const;
79  sensor::Camera *GetVerticalCamera(void) const;
80 
81 protected:
82  void SetBldc(const actuator::Bldc *bldc);
83  void SetMultiplex(const filter::UavMultiplex *multiplex);
84  void SetAhrs(const filter::Ahrs *ahrs);
85  void SetUsRangeFinder(const sensor::UsRangeFinder *us);
86  void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
87  void SetVerticalCamera(const sensor::Camera *verticalCamera);
88 
89 private:
90  sensor::Imu *imu;
91  filter::Ahrs *ahrs;
92  actuator::Bldc *bldc;
93  filter::UavMultiplex *multiplex;
95  MetaUsRangeFinder *meta_us;
96  sensor::VrpnClient *vrpnclient;
97  MetaVrpnObject *uav_vrpn;
98  sensor::BatteryMonitor *battery;
99  sensor::Camera *verticalCamera;
100 };
101 } // end namespace meta
102 } // end namespace flair
103 #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:43
Abstract class for AHRS.
Definition: Ahrs.h:48
Class defining uav multiplexing.
Definition: UavMultiplex.h:38
Main class of the Framework library.
Definition: FrameworkManager.h:45
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.
Definition: Uav.h:47
Base class for brushless motors drivers.
Definition: Bldc.h:38
Classe haut niveau intégrant un objet VRPN.
Definition: MetaVrpnObject.h:47
Class to connect to a Vrpn server.
Definition: VrpnClient.h:39