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 PidThrust.h
|
---|
7 | * \brief Class defining a Pid for Thrust
|
---|
8 | * \author Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS 7253
|
---|
9 | * \date 2014/11/07
|
---|
10 | * \version 4.0
|
---|
11 | */
|
---|
12 |
|
---|
13 | #ifndef PIDTHRUST_H
|
---|
14 | #define PIDTHRUST_H
|
---|
15 |
|
---|
16 | #include <ControlLaw.h>
|
---|
17 |
|
---|
18 | namespace flair {
|
---|
19 | namespace gui {
|
---|
20 | class LayoutPosition;
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | class PidThrust_impl;
|
---|
25 |
|
---|
26 | namespace flair {
|
---|
27 | namespace filter {
|
---|
28 | /*! \class PidThrust
|
---|
29 | *
|
---|
30 | * \brief Class defining a Pid for Thrust.\n
|
---|
31 | * This Pid as an extra offset for compensating gravity.
|
---|
32 | */
|
---|
33 | class PidThrust : public ControlLaw {
|
---|
34 | friend class ::PidThrust_impl;
|
---|
35 |
|
---|
36 | public:
|
---|
37 | /*!
|
---|
38 | * \brief Constructor
|
---|
39 | *
|
---|
40 | * Construct a PidThrust at given position
|
---|
41 | * The PidThrust will automatically be child of position->getLayout() Layout.
|
---|
42 | *After calling this function,
|
---|
43 | * position will be deleted as it is no longer usefull. \n
|
---|
44 | *
|
---|
45 | * \param position position to display settings
|
---|
46 | * \param name name
|
---|
47 | */
|
---|
48 | PidThrust(const gui::LayoutPosition *position, std::string name);
|
---|
49 |
|
---|
50 | /*!
|
---|
51 | * \brief Destructor
|
---|
52 | *
|
---|
53 | */
|
---|
54 | ~PidThrust();
|
---|
55 |
|
---|
56 | /*!
|
---|
57 | * \brief Reset integral and offset to 0
|
---|
58 | *
|
---|
59 | */
|
---|
60 | void Reset(void);
|
---|
61 |
|
---|
62 | /*!
|
---|
63 | * \brief Reset integral to 0
|
---|
64 | *
|
---|
65 | */
|
---|
66 | void ResetI(void);
|
---|
67 |
|
---|
68 | /*!
|
---|
69 | * \brief Reset offset to 0
|
---|
70 | *
|
---|
71 | */
|
---|
72 | void ResetOffset(void);
|
---|
73 |
|
---|
74 | /*!
|
---|
75 | * \brief Set offset to specified value in ground station
|
---|
76 | *
|
---|
77 | */
|
---|
78 | void SetOffset(void);
|
---|
79 |
|
---|
80 | /*!
|
---|
81 | * \brief Get offset
|
---|
82 | *
|
---|
83 | * \return current offset
|
---|
84 | */
|
---|
85 | float GetOffset(void);
|
---|
86 |
|
---|
87 | /*!
|
---|
88 | * \brief Step up the offset according to specified value in ground station
|
---|
89 | *
|
---|
90 | * \return false if offset is at its maximum (1) value, true otherwise
|
---|
91 | */
|
---|
92 | bool OffsetStepUp(void);
|
---|
93 |
|
---|
94 | /*!
|
---|
95 | * \brief Step down the offset according to specified value in ground station
|
---|
96 | *
|
---|
97 | * \return false if offset is at its minimum (specified in ground station)
|
---|
98 | *value, true otherwise
|
---|
99 | */
|
---|
100 | bool OffsetStepDown(void);
|
---|
101 |
|
---|
102 | /*!
|
---|
103 | * \brief Set input values
|
---|
104 | *
|
---|
105 | * \param p proportional value
|
---|
106 | * \param d derivative value
|
---|
107 | */
|
---|
108 | void SetValues(float p, float d);
|
---|
109 |
|
---|
110 | /*!
|
---|
111 | * \brief Use default plot
|
---|
112 | *
|
---|
113 | * Plot the output values at position. \n
|
---|
114 | * Plot consists of 4 curves: proportional part,
|
---|
115 | * derivative part, integral part and
|
---|
116 | * the sum of the three. \n
|
---|
117 | * After calling this function, position will be deleted as it is no longer
|
---|
118 | *usefull. \n
|
---|
119 | *
|
---|
120 | * \param position position to display plot
|
---|
121 | */
|
---|
122 | void UseDefaultPlot(const gui::LayoutPosition *position);
|
---|
123 |
|
---|
124 | private:
|
---|
125 | /*!
|
---|
126 | * \brief Update using provided datas
|
---|
127 | *
|
---|
128 | * Reimplemented from IODevice.
|
---|
129 | *
|
---|
130 | * \param data data from the parent to process
|
---|
131 | */
|
---|
132 | void UpdateFrom(const core::io_data *data);
|
---|
133 |
|
---|
134 | PidThrust_impl *pimpl_;
|
---|
135 | };
|
---|
136 | } // end namespace filter
|
---|
137 | } // end namespace flair
|
---|
138 | #endif // PIDTHRUST_H
|
---|