1 | /*!
|
---|
2 | * \file Uav.h
|
---|
3 | * \brief Base class to construct sensors/actuators depending on uav type
|
---|
4 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
5 | * \date 2014/01/22
|
---|
6 | * \version 3.4
|
---|
7 | */
|
---|
8 |
|
---|
9 | #ifndef HDSUAV_H
|
---|
10 | #define HDSUAV_H
|
---|
11 |
|
---|
12 | #include <Object.h>
|
---|
13 |
|
---|
14 | namespace flair {
|
---|
15 | namespace core {
|
---|
16 | class FrameworkManager;
|
---|
17 | }
|
---|
18 | namespace filter {
|
---|
19 | class Ahrs;
|
---|
20 | class UavMultiplex;
|
---|
21 | }
|
---|
22 | namespace actuator {
|
---|
23 | class Bldc;
|
---|
24 | }
|
---|
25 | namespace sensor {
|
---|
26 | class UsRangeFinder;
|
---|
27 | class BatteryMonitor;
|
---|
28 | class VrpnClient;
|
---|
29 | class Imu;
|
---|
30 | class Camera;
|
---|
31 | }
|
---|
32 | }
|
---|
33 |
|
---|
34 | namespace flair {
|
---|
35 | namespace meta {
|
---|
36 | class MetaUsRangeFinder;
|
---|
37 | class MetaVrpnObject;
|
---|
38 |
|
---|
39 | /*! \class Uav
|
---|
40 | *
|
---|
41 | * \brief Base class to construct sensors/actuators depending on uav type
|
---|
42 | */
|
---|
43 | class Uav: public core::Object {
|
---|
44 | public:
|
---|
45 | /*
|
---|
46 | typedef enum {
|
---|
47 | None,
|
---|
48 | Auto,//rt serial if hds x4 ou x8, auto ip sinon
|
---|
49 | AutoIP,
|
---|
50 | UserDefinedIP,
|
---|
51 | AutoSerialPort,
|
---|
52 | } VRPNType_t;
|
---|
53 | */
|
---|
54 | //uav_name: for optitrack
|
---|
55 | Uav(core::FrameworkManager* parent,std::string name,filter::UavMultiplex *multiplex=NULL);
|
---|
56 | ~Uav();
|
---|
57 | void SetupVRPN(std::string optitrack_address,std::string name);
|
---|
58 | //vrpn serial: broken, need to add serial port in uav specific code
|
---|
59 | //void SetupVRPNSerial(core::SerialPort *vrpn_port,std::string name,int VRPNSerialObjectId);
|
---|
60 | virtual void SetupVRPNAutoIP(std::string name);
|
---|
61 |
|
---|
62 | virtual void StartSensors(void);
|
---|
63 | void UseDefaultPlot(void);
|
---|
64 | actuator::Bldc* GetBldc(void) const;
|
---|
65 | filter::UavMultiplex* GetUavMultiplex(void) const;
|
---|
66 | sensor::Imu* GetImu(void) const;
|
---|
67 | filter::Ahrs* GetAhrs(void) const;
|
---|
68 | MetaUsRangeFinder* GetMetaUsRangeFinder(void) const;
|
---|
69 | sensor::UsRangeFinder* GetUsRangeFinder(void) const;
|
---|
70 | sensor::BatteryMonitor* GetBatteryMonitor(void) const;
|
---|
71 | sensor::VrpnClient* GetVrpnClient(void) const;
|
---|
72 | meta::MetaVrpnObject* GetVrpnObject(void) const;
|
---|
73 | sensor::Camera* GetVerticalCamera(void) const;
|
---|
74 |
|
---|
75 | protected:
|
---|
76 | void SetBldc(const actuator::Bldc *bldc);
|
---|
77 | void SetMultiplex(const filter::UavMultiplex *multiplex);
|
---|
78 | void SetAhrs(const filter::Ahrs *ahrs);
|
---|
79 | void SetUsRangeFinder(const sensor::UsRangeFinder *us);
|
---|
80 | void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
|
---|
81 | void SetVerticalCamera(const sensor::Camera *verticalCamera);
|
---|
82 |
|
---|
83 | private:
|
---|
84 | sensor::Imu* imu;
|
---|
85 | filter::Ahrs* ahrs;
|
---|
86 | actuator::Bldc* bldc;
|
---|
87 | filter::UavMultiplex *multiplex;
|
---|
88 | sensor::UsRangeFinder* us;
|
---|
89 | MetaUsRangeFinder* meta_us;
|
---|
90 | sensor::VrpnClient *vrpnclient;
|
---|
91 | MetaVrpnObject* uav_vrpn;
|
---|
92 | sensor::BatteryMonitor* battery;
|
---|
93 | sensor::Camera* verticalCamera;
|
---|
94 | };
|
---|
95 | } // end namespace meta
|
---|
96 | } // end namespace flair
|
---|
97 | #endif // HDSUAV_H
|
---|