[292] | 1 | // created: 2019/01/09
|
---|
| 2 | // filename: App.h
|
---|
| 3 | //
|
---|
| 4 | // author: Guillaume Sanahuja
|
---|
| 5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: $
|
---|
| 8 | //
|
---|
[293] | 9 | // purpose: mixed reality demo, virtual uav side
|
---|
[292] | 10 | //
|
---|
| 11 | //
|
---|
| 12 | /*********************************************************************/
|
---|
| 13 |
|
---|
| 14 | #ifndef APP_H
|
---|
| 15 | #define APP_H
|
---|
| 16 |
|
---|
| 17 | #include <UavStateMachine.h>
|
---|
| 18 |
|
---|
| 19 | namespace flair {
|
---|
| 20 | namespace gui {
|
---|
| 21 | class PushButton;
|
---|
| 22 | }
|
---|
| 23 | namespace meta {
|
---|
| 24 | class MetaVrpnObject;
|
---|
| 25 | }
|
---|
| 26 | namespace sensor {
|
---|
| 27 | class TargetController;
|
---|
| 28 | }
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | class App : public flair::meta::UavStateMachine {
|
---|
| 32 | public:
|
---|
| 33 | App(flair::sensor::TargetController *controller);
|
---|
| 34 | ~App();
|
---|
| 35 |
|
---|
| 36 | private:
|
---|
| 37 |
|
---|
| 38 | enum class BehaviourMode_t {
|
---|
| 39 | Default,
|
---|
| 40 | PositionHold,
|
---|
| 41 | };
|
---|
| 42 |
|
---|
| 43 | BehaviourMode_t behaviourMode;
|
---|
| 44 | bool vrpnLost;
|
---|
| 45 |
|
---|
| 46 | void VrpnPositionHold(void);
|
---|
| 47 | void ExtraSecurityCheck(void);
|
---|
| 48 | void ExtraCheckPushButton(void);
|
---|
| 49 | void ExtraCheckJoystick(void);
|
---|
| 50 | const flair::core::AhrsData *GetOrientation(void) const;
|
---|
| 51 | void AltitudeValues(float &z,float &dz) const;
|
---|
| 52 | void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
|
---|
| 53 | flair::core::AhrsData *GetReferenceOrientation(void);
|
---|
| 54 | void SignalEvent(Event_t event);
|
---|
| 55 |
|
---|
| 56 | flair::filter::Pid *uX, *uY;
|
---|
| 57 |
|
---|
| 58 | flair::core::Vector2Df posHold;
|
---|
| 59 | float yawHold;
|
---|
| 60 |
|
---|
| 61 | flair::gui::PushButton *positionHold;
|
---|
| 62 | flair::meta::MetaVrpnObject *uavVrpn;
|
---|
| 63 | flair::core::AhrsData *customReferenceOrientation,*customOrientation;
|
---|
| 64 | };
|
---|
| 65 |
|
---|
| 66 | #endif // APP_H
|
---|