[21] | 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 |
|
---|
[23] | 19 | namespace flair {
|
---|
[21] | 20 | namespace gui {
|
---|
| 21 | class PushButton;
|
---|
| 22 | }
|
---|
| 23 | namespace filter {
|
---|
| 24 | class TrajectoryGenerator2DCircle;
|
---|
| 25 | }
|
---|
| 26 | namespace meta {
|
---|
| 27 | class MetaVrpnObject;
|
---|
| 28 | }
|
---|
[38] | 29 | namespace sensor {
|
---|
| 30 | class TargetController;
|
---|
| 31 | }
|
---|
[21] | 32 | }
|
---|
| 33 |
|
---|
[23] | 34 | class CircleFollower : public flair::meta::UavStateMachine {
|
---|
[21] | 35 | public:
|
---|
[122] | 36 | CircleFollower(flair::sensor::TargetController *controller);
|
---|
[21] | 37 | ~CircleFollower();
|
---|
| 38 |
|
---|
| 39 | private:
|
---|
| 40 | enum class BehaviourMode_t {
|
---|
| 41 | Default,
|
---|
| 42 | PositionHold,
|
---|
| 43 | Circle
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 | BehaviourMode_t behaviourMode;
|
---|
| 47 | bool vrpnLost;
|
---|
| 48 |
|
---|
| 49 | void VrpnPositionHold(void);//flight mode
|
---|
| 50 | void StartCircle(void);
|
---|
| 51 | void StopCircle(void);
|
---|
| 52 | void ExtraSecurityCheck(void);
|
---|
| 53 | void ExtraCheckPushButton(void);
|
---|
| 54 | void ExtraCheckJoystick(void);
|
---|
[23] | 55 | const flair::core::AhrsData *GetOrientation(void) const;
|
---|
[167] | 56 | void AltitudeValues(float &z,float &dz) const;
|
---|
| 57 | void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
|
---|
[23] | 58 | flair::core::AhrsData *GetReferenceOrientation(void);
|
---|
[21] | 59 | void SignalEvent(Event_t event);
|
---|
| 60 |
|
---|
[23] | 61 | flair::filter::Pid *uX, *uY;
|
---|
[21] | 62 |
|
---|
[167] | 63 | flair::core::Vector2Df posHold;
|
---|
[21] | 64 | float yawHold;
|
---|
| 65 |
|
---|
[23] | 66 | flair::gui::PushButton *startCircle,*stopCircle;
|
---|
[122] | 67 | flair::meta::MetaVrpnObject *targetVrpn,*uavVrpn;
|
---|
[23] | 68 | flair::filter::TrajectoryGenerator2DCircle *circle;
|
---|
| 69 | flair::core::AhrsData *customReferenceOrientation,*customOrientation;
|
---|
[21] | 70 | };
|
---|
| 71 |
|
---|
| 72 | #endif // CIRCLEFOLLOWER_H
|
---|