[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;
|
---|
| 22 | class Socket;
|
---|
| 23 | class AhrsData;
|
---|
| 24 | }
|
---|
| 25 | namespace filter {
|
---|
| 26 | class TrajectoryGenerator2DCircle;
|
---|
| 27 | }
|
---|
| 28 | namespace gui {
|
---|
| 29 | class DoubleSpinBox;
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | class SimpleFleet : public flair::meta::UavStateMachine {
|
---|
| 35 | public:
|
---|
| 36 | SimpleFleet(flair::meta::Uav* uav,std::string broadcast,uint16_t ds3port);
|
---|
| 37 | ~SimpleFleet();
|
---|
| 38 |
|
---|
| 39 | private:
|
---|
| 40 | enum class BehaviourMode_t {
|
---|
| 41 | Default,
|
---|
| 42 | PositionHold1,
|
---|
| 43 | Circle1,
|
---|
| 44 | PositionHold2,
|
---|
| 45 | PositionHold3,
|
---|
| 46 | Circle2,
|
---|
| 47 | PositionHold4,
|
---|
| 48 | };
|
---|
| 49 |
|
---|
| 50 | // BehaviourMode_t orientation_state;
|
---|
| 51 | BehaviourMode_t behaviourMode;
|
---|
| 52 | bool vrpnLost;
|
---|
| 53 |
|
---|
| 54 | void VrpnPositionHold(void);//flight mode
|
---|
| 55 | void StartCircle(void);
|
---|
| 56 | void StopCircle(void);
|
---|
| 57 | void ExtraTakeOff(void);
|
---|
| 58 | void ExtraSecurityCheck(void);
|
---|
| 59 | void ExtraCheckJoystick(void);
|
---|
| 60 | const flair::core::AhrsData *GetOrientation(void) const;
|
---|
| 61 | void AltitudeValues(float &z,float &dz) const;
|
---|
| 62 | void PositionValues(flair::core::Vector2D &pos_error,flair::core::Vector2D &vel_error,float &yaw_ref);
|
---|
| 63 | const flair::core::AhrsData *GetReferenceOrientation(void);
|
---|
| 64 | void SignalEvent(Event_t event);
|
---|
| 65 | void CheckMessages(void);
|
---|
| 66 |
|
---|
| 67 | flair::filter::Pid *u_x, *u_y;
|
---|
| 68 |
|
---|
| 69 | flair::core::Vector2D pos_hold;
|
---|
| 70 | float yaw_hold;
|
---|
| 71 | flair::core::Socket *message;
|
---|
| 72 | flair::core::Time posWait;
|
---|
| 73 |
|
---|
| 74 | flair::filter::TrajectoryGenerator2DCircle *circle;
|
---|
| 75 | flair::gui::DoubleSpinBox *xCircleCenter,*yCircleCenter,*yDisplacement;
|
---|
| 76 | flair::core::AhrsData *customReferenceOrientation,*customOrientation;
|
---|
| 77 | };
|
---|
| 78 |
|
---|
| 79 | #endif // SIMPLEFLEET_H
|
---|