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

Last change on this file since 425 was 377, checked in by Sanahuja Guillaume, 4 years ago

ugv update

File size: 2.8 KB
Line 
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}
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 UAV_H
14#define UAV_H
15
16#include <Object.h>
17
18namespace flair {
19 namespace filter {
20 class Ahrs;
21 class UavMultiplex;
22 }
23 namespace actuator {
24 class Bldc;
25 }
26 namespace sensor {
27 class UsRangeFinder;
28 class BatteryMonitor;
29 class Imu;
30 class Camera;
31 class NmeaGps;
32 class PressureSensor;
33 }
34}
35
36namespace flair {
37namespace meta {
38class MetaUsRangeFinder;
39
40/*! \class Uav
41*
42* \brief Base class to construct sensors/actuators depending on uav type.
43* The Object is created with
44* the FrameworkManager as parent. FrameworkManager must be created before.
45* Only one instance of this class is allowed by program.
46*/
47class Uav : public core::Object {
48public:
49
50 Uav(std::string name,
51 filter::UavMultiplex *multiplex = NULL);
52 ~Uav();
53
54 virtual void StartSensors(void)=0;
55 void UseDefaultPlot(void);
56 actuator::Bldc *GetBldc(void) const;
57 filter::UavMultiplex *GetUavMultiplex(void) const;
58 sensor::Imu *GetImu(void) const;
59 filter::Ahrs *GetAhrs(void) const;
60 MetaUsRangeFinder *GetMetaUsRangeFinder(void) const;
61 sensor::UsRangeFinder *GetUsRangeFinder(void) const;
62 sensor::BatteryMonitor *GetBatteryMonitor(void) const;
63 sensor::Camera *GetVerticalCamera(void) const;
64 sensor::Camera *GetHorizontalCamera(void) const;
65 sensor::NmeaGps *GetGps(void) const;
66 sensor::PressureSensor *GetPressureSensor(void) const;
67 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
68 virtual bool isReadyToFly(void) const { return true;}
69 virtual std::string GetType(void) const=0;
70
71protected:
72 void SetBldc(const actuator::Bldc *bldc);
73 void SetMultiplex(const filter::UavMultiplex *multiplex);
74 void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs)
75 void SetUsRangeFinder(const sensor::UsRangeFinder *us);
76 void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
77 void SetVerticalCamera(const sensor::Camera *verticalCamera);
78 void SetHorizontalCamera(const sensor::Camera *verticalCamera);
79 void SetGps(const sensor::NmeaGps *gps);
80 void SetPressureSensor(const sensor::PressureSensor *pressureSensor);
81
82private:
83 sensor::Imu *imu;
84 sensor::NmeaGps *gps;
85 filter::Ahrs *ahrs;
86 actuator::Bldc *bldc;
87 filter::UavMultiplex *multiplex;
88 sensor::UsRangeFinder *us;
89 MetaUsRangeFinder *meta_us;
90 sensor::BatteryMonitor *battery;
91 sensor::Camera *verticalCamera,*horizontalCamera;
92 sensor::PressureSensor *pressureSensor;
93};
94
95/*!
96* \brief get Uav
97*
98* \return the Uav
99*/
100Uav *GetUav(void);
101
102} // end namespace meta
103} // end namespace flair
104#endif // UAV_H
Note: See TracBrowser for help on using the repository browser.