source: flair-src/trunk/demos/CircleFollower/uav/src/CircleFollower.h@ 376

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

up

File size: 1.9 KB
Line 
1// created: 2011/05/01
2// filename: CircleFollower.h
3//
4// author: Guillaume Sanahuja
5// Copyright Heudiasyc UMR UTC/CNRS 7253
6//
7// version: $Id: $
8//
9// purpose: demo cercle avec optitrack
10//
11//
12/*********************************************************************/
13
14#ifndef CIRCLEFOLLOWER_H
15#define CIRCLEFOLLOWER_H
16
17#include <UavStateMachine.h>
18
19namespace flair {
20 namespace gui {
21 class PushButton;
22 }
23 namespace filter {
24 class TrajectoryGenerator2DCircle;
25 }
26 namespace meta {
27 class MetaVrpnObject;
28 }
29 namespace sensor {
30 class TargetController;
31 }
32}
33
34class CircleFollower : public flair::meta::UavStateMachine {
35 public:
36 CircleFollower(flair::sensor::TargetController *controller);
37 ~CircleFollower();
38
39 private:
40
41 enum class BehaviourMode_t {
42 Default,
43 PositionHold,
44 Circle
45 };
46
47 BehaviourMode_t behaviourMode;
48 bool vrpnLost;
49
50 void VrpnPositionHold(void);//flight mode
51 void StartCircle(void);
52 void StopCircle(void);
53 void ExtraSecurityCheck(void);
54 void ExtraCheckPushButton(void);
55 void ExtraCheckJoystick(void);
56 const flair::core::AhrsData *GetOrientation(void) const;
57 void AltitudeValues(float &z,float &dz) const;
58 void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
59 flair::core::AhrsData *GetReferenceOrientation(void);
60 void SignalEvent(Event_t event);
61
62 flair::filter::Pid *uX, *uY;
63
64 flair::core::Vector2Df posHold;
65 float yawHold;
66
67 flair::gui::PushButton *startCircle,*stopCircle,*positionHold;
68 flair::meta::MetaVrpnObject *targetVrpn,*uavVrpn;
69 flair::filter::TrajectoryGenerator2DCircle *circle;
70 flair::core::AhrsData *customReferenceOrientation,*customOrientation;
71};
72
73#endif // CIRCLEFOLLOWER_H
Note: See TracBrowser for help on using the repository browser.