[122] | 1 | // created: 2011/05/01
|
---|
| 2 | // filename: DemoOpticalFlow.h
|
---|
| 3 | //
|
---|
| 4 | // author: Guillaume Sanahuja
|
---|
| 5 | // Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
| 6 | //
|
---|
| 7 | // version: $Id: $
|
---|
| 8 | //
|
---|
| 9 | // purpose: demo optical flow
|
---|
| 10 | //
|
---|
| 11 | //
|
---|
| 12 | /*********************************************************************/
|
---|
| 13 | //------------
|
---|
| 14 |
|
---|
| 15 | #ifndef DEMOOPTICALFLOW_H
|
---|
| 16 | #define DEMOOPTICALFLOW_H
|
---|
| 17 |
|
---|
| 18 | #include <UavStateMachine.h>
|
---|
| 19 |
|
---|
| 20 | namespace flair {
|
---|
| 21 | namespace core {
|
---|
| 22 | class cvmatrix;
|
---|
| 23 | }
|
---|
| 24 | namespace gui {
|
---|
| 25 | class GroupBox;
|
---|
| 26 | class DoubleSpinBox;
|
---|
[124] | 27 | class PushButton;
|
---|
[122] | 28 | }
|
---|
| 29 | namespace filter {
|
---|
| 30 | class OpticalFlow;
|
---|
[155] | 31 | class OpticalFlowCompensated;
|
---|
[122] | 32 | class OpticalFlowSpeed;
|
---|
| 33 | class LowPassFilter;
|
---|
[142] | 34 | class EulerDerivative;
|
---|
[122] | 35 | class CvtColor;
|
---|
| 36 | }
|
---|
| 37 | namespace sensor {
|
---|
| 38 | class TargetController;
|
---|
| 39 | }
|
---|
| 40 | }
|
---|
| 41 |
|
---|
| 42 | class DemoOpticalFlow : public flair::meta::UavStateMachine {
|
---|
| 43 |
|
---|
| 44 | public:
|
---|
| 45 | DemoOpticalFlow(flair::sensor::TargetController *controller);
|
---|
| 46 | ~DemoOpticalFlow();
|
---|
| 47 |
|
---|
| 48 | protected:
|
---|
| 49 | void SignalEvent(Event_t event);
|
---|
| 50 | void ExtraCheckJoystick(void);
|
---|
[155] | 51 | void ExtraCheckPushButton(void);
|
---|
[122] | 52 | const flair::core::AhrsData *GetReferenceOrientation(void);
|
---|
| 53 |
|
---|
| 54 | flair::gui::GroupBox* opticalFlowGroupBox;
|
---|
| 55 | flair::gui::DoubleSpinBox *maxXSpeed,*maxYSpeed;
|
---|
| 56 | flair::core::cvmatrix *opticalFlowReference;
|
---|
| 57 | flair::filter::Pid *u_x, *u_y;
|
---|
| 58 | flair::filter::CvtColor* greyCameraImage;
|
---|
| 59 | flair::core::AhrsData *customReferenceOrientation;
|
---|
[163] | 60 | flair::core::cvmatrix *opticalFlowRealSpeed,*opticalFlowRealAcceleration;
|
---|
[122] | 61 |
|
---|
| 62 | private:
|
---|
| 63 | flair::filter::OpticalFlow *opticalFlow;
|
---|
[155] | 64 | flair::filter::OpticalFlowCompensated *opticalFlowCompensated;
|
---|
[142] | 65 | flair::filter::OpticalFlowSpeed *opticalFlowSpeedRaw;
|
---|
| 66 | flair::filter::EulerDerivative *opticalFlowAccelerationRaw;
|
---|
[155] | 67 | flair::gui::PushButton *startOpticalflow,*stopOpticalflow;
|
---|
| 68 | void StartOpticalFlow(void);
|
---|
[163] | 69 | flair::filter::LowPassFilter* opticalFlowSpeed;
|
---|
| 70 | flair::filter::LowPassFilter* opticalFlowAcceleration;
|
---|
[122] | 71 | };
|
---|
| 72 |
|
---|
| 73 | #endif // DEMOOPTICALFLOW_H
|
---|