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

Last change on this file since 464 was 431, checked in by Sanahuja Guillaume, 3 years ago

add vrpn connection type per uav

File size: 3.0 KB
RevLine 
[10]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[10]4// %flair:license}
[7]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
[377]13#ifndef UAV_H
14#define UAV_H
[7]15
16#include <Object.h>
[431]17#include <VrpnClient.h>
[7]18
19namespace flair {
[122]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;
[185]32 class NmeaGps;
[215]33 class PressureSensor;
[122]34 }
[7]35}
36
37namespace flair {
38namespace meta {
[15]39class MetaUsRangeFinder;
[7]40
[15]41/*! \class Uav
42*
[122]43* \brief Base class to construct sensors/actuators depending on uav type.
44* The Object is created with
45* the FrameworkManager as parent. FrameworkManager must be created before.
46* Only one instance of this class is allowed by program.
[7]47*/
[15]48class Uav : public core::Object {
49public:
[122]50
51 Uav(std::string name,
[15]52 filter::UavMultiplex *multiplex = NULL);
53 ~Uav();
[7]54
[122]55 virtual void StartSensors(void)=0;
[15]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;
[121]65 sensor::Camera *GetHorizontalCamera(void) const;
[185]66 sensor::NmeaGps *GetGps(void) const;
[215]67 sensor::PressureSensor *GetPressureSensor(void) const;
[122]68 virtual std::string GetDefaultVrpnAddress(void) const{return "127.0.0.1:3883";}
[431]69 virtual sensor::VrpnClient::ConnectionType_t GetDefaultVrpnConnectionType(void) const{return sensor::VrpnClient::ConnectionType_t::Vrpn;}
[157]70 virtual bool isReadyToFly(void) const { return true;}
[165]71 virtual std::string GetType(void) const=0;
[7]72
[15]73protected:
74 void SetBldc(const actuator::Bldc *bldc);
75 void SetMultiplex(const filter::UavMultiplex *multiplex);
[173]76 void SetAhrs(const filter::Ahrs *ahrs);//also sets imu (retrieved from the ahrs)
[15]77 void SetUsRangeFinder(const sensor::UsRangeFinder *us);
78 void SetBatteryMonitor(const sensor::BatteryMonitor *battery);
79 void SetVerticalCamera(const sensor::Camera *verticalCamera);
[121]80 void SetHorizontalCamera(const sensor::Camera *verticalCamera);
[185]81 void SetGps(const sensor::NmeaGps *gps);
[215]82 void SetPressureSensor(const sensor::PressureSensor *pressureSensor);
[7]83
[15]84private:
85 sensor::Imu *imu;
[185]86 sensor::NmeaGps *gps;
[15]87 filter::Ahrs *ahrs;
88 actuator::Bldc *bldc;
89 filter::UavMultiplex *multiplex;
90 sensor::UsRangeFinder *us;
91 MetaUsRangeFinder *meta_us;
92 sensor::BatteryMonitor *battery;
[121]93 sensor::Camera *verticalCamera,*horizontalCamera;
[215]94 sensor::PressureSensor *pressureSensor;
[15]95};
[122]96
97/*!
98* \brief get Uav
99*
100* \return the Uav
101*/
102Uav *GetUav(void);
103
[7]104} // end namespace meta
105} // end namespace flair
[377]106#endif // UAV_H
Note: See TracBrowser for help on using the repository browser.