1 | // %flair:license{ |
---|
2 | // This file is part of the Flair framework distributed under the |
---|
3 | // CECILL-C License, Version 1.0. |
---|
4 | // %flair:license} |
---|
5 | /*! |
---|
6 | * \file OpticalFlowCompensated.h |
---|
7 | * \brief Compensate optical flow data for rotations |
---|
8 | * \author Gildas Bayard, Copyright Heudiasyc UMR UTC/CNRS 7253 |
---|
9 | * \date 2017/02/17 |
---|
10 | * \version 1.0 |
---|
11 | */ |
---|
12 | |
---|
13 | #ifndef OPTICALFLOWCOMPENSATED_H_ |
---|
14 | #define OPTICALFLOWCOMPENSATED_H |
---|
15 | |
---|
16 | #include <IODevice.h> |
---|
17 | #include <Object.h> |
---|
18 | #include <Vector3D.h> |
---|
19 | |
---|
20 | namespace flair { |
---|
21 | namespace core { |
---|
22 | class io_data; |
---|
23 | class Matrix; |
---|
24 | } |
---|
25 | namespace gui { |
---|
26 | class LayoutPosition; |
---|
27 | class SpinBox; |
---|
28 | class DoubleSpinBox; |
---|
29 | } |
---|
30 | namespace filter { |
---|
31 | class Ahrs; |
---|
32 | class OpticalFlow; |
---|
33 | class OpticalFlowData; |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | namespace flair { namespace filter { |
---|
38 | |
---|
39 | /*! \class OpticalFlowCompensated |
---|
40 | * |
---|
41 | * \brief Compensate optical flow data for rotations |
---|
42 | * |
---|
43 | */ |
---|
44 | class OpticalFlowCompensated : public core::IODevice { |
---|
45 | public: |
---|
46 | /*! |
---|
47 | * \brief Constructor |
---|
48 | * |
---|
49 | * Construct an optical flow compensated filter |
---|
50 | * |
---|
51 | * \param parent parent |
---|
52 | * \param name name |
---|
53 | * \param ahrs ahrs object used to get rotational speed |
---|
54 | */ |
---|
55 | OpticalFlowCompensated(const filter::OpticalFlow *parent, const filter::Ahrs *ahrs, const gui::LayoutPosition* position, std::string name); |
---|
56 | |
---|
57 | /*! |
---|
58 | * \brief Destructor |
---|
59 | * |
---|
60 | */ |
---|
61 | ~OpticalFlowCompensated(); |
---|
62 | |
---|
63 | void UpdateFrom(const core::io_data *data); |
---|
64 | |
---|
65 | core::Matrix *GetFirstPointDisplacement() const; |
---|
66 | private: |
---|
67 | OpticalFlowData *output; |
---|
68 | core::Time previousTime; |
---|
69 | const Ahrs *ahrs; |
---|
70 | core::Matrix *firstPointDisplacement; |
---|
71 | core::Vector3Df **previousStepsAngularRates; |
---|
72 | unsigned int previousStepsAngularRatesIndex; |
---|
73 | gui::SpinBox *gyroDelay; |
---|
74 | gui::DoubleSpinBox *gyroGain; |
---|
75 | }; |
---|
76 | |
---|
77 | }} // end namespace flair::filter |
---|
78 | #endif // OPTICALFLOWCOMPENSATED_H |
---|