[33] | 1 | // created: 2015/11/05
|
---|
| 2 | // filename: SimpleFleet.h
|
---|
| 3 | //
|
---|
| 4 | // author: Guillaume Sanahuja
|
---|
| 5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: $
|
---|
| 8 | //
|
---|
| 9 | // purpose: demo fleet
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | /*********************************************************************/
|
---|
| 13 |
|
---|
| 14 | #ifndef SIMPLEFLEET_H
|
---|
| 15 | #define SIMPLEFLEET_H
|
---|
| 16 |
|
---|
| 17 | #include <UavStateMachine.h>
|
---|
| 18 |
|
---|
| 19 | namespace flair {
|
---|
| 20 | namespace core {
|
---|
| 21 | class FrameworkManager;
|
---|
[178] | 22 | class UdpSocket;
|
---|
[33] | 23 | class AhrsData;
|
---|
| 24 | }
|
---|
| 25 | namespace filter {
|
---|
| 26 | class TrajectoryGenerator2DCircle;
|
---|
| 27 | }
|
---|
[122] | 28 | namespace meta {
|
---|
| 29 | class MetaVrpnObject;
|
---|
| 30 | }
|
---|
[33] | 31 | namespace gui {
|
---|
| 32 | class DoubleSpinBox;
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 |
|
---|
| 36 |
|
---|
| 37 | class SimpleFleet : public flair::meta::UavStateMachine {
|
---|
| 38 | public:
|
---|
[122] | 39 | SimpleFleet(std::string broadcast,flair::sensor::TargetController *controller);
|
---|
[33] | 40 | ~SimpleFleet();
|
---|
| 41 |
|
---|
| 42 | private:
|
---|
| 43 | enum class BehaviourMode_t {
|
---|
| 44 | Default,
|
---|
| 45 | PositionHold1,
|
---|
| 46 | Circle1,
|
---|
| 47 | PositionHold2,
|
---|
| 48 | PositionHold3,
|
---|
| 49 | Circle2,
|
---|
| 50 | PositionHold4,
|
---|
| 51 | };
|
---|
| 52 |
|
---|
| 53 | // BehaviourMode_t orientation_state;
|
---|
| 54 | BehaviourMode_t behaviourMode;
|
---|
| 55 | bool vrpnLost;
|
---|
| 56 |
|
---|
| 57 | void VrpnPositionHold(void);//flight mode
|
---|
| 58 | void StartCircle(void);
|
---|
| 59 | void StopCircle(void);
|
---|
| 60 | void ExtraTakeOff(void);
|
---|
| 61 | void ExtraSecurityCheck(void);
|
---|
| 62 | void ExtraCheckJoystick(void);
|
---|
| 63 | const flair::core::AhrsData *GetOrientation(void) const;
|
---|
| 64 | void AltitudeValues(float &z,float &dz) const;
|
---|
[167] | 65 | void PositionValues(flair::core::Vector2Df &pos_error,flair::core::Vector2Df &vel_error,float &yaw_ref);
|
---|
[33] | 66 | const flair::core::AhrsData *GetReferenceOrientation(void);
|
---|
| 67 | void SignalEvent(Event_t event);
|
---|
| 68 | void CheckMessages(void);
|
---|
| 69 |
|
---|
| 70 | flair::filter::Pid *u_x, *u_y;
|
---|
| 71 |
|
---|
[167] | 72 | flair::core::Vector2Df posHold;
|
---|
[135] | 73 | float yawHold;
|
---|
[178] | 74 | flair::core::UdpSocket *message;
|
---|
[33] | 75 | flair::core::Time posWait;
|
---|
| 76 |
|
---|
| 77 | flair::filter::TrajectoryGenerator2DCircle *circle;
|
---|
| 78 | flair::gui::DoubleSpinBox *xCircleCenter,*yCircleCenter,*yDisplacement;
|
---|
| 79 | flair::core::AhrsData *customReferenceOrientation,*customOrientation;
|
---|
[122] | 80 | flair::meta::MetaVrpnObject *uavVrpn;
|
---|
[33] | 81 | };
|
---|
| 82 |
|
---|
| 83 | #endif // SIMPLEFLEET_H
|
---|