Changeset 13 in flair-dev for trunk/include/FlairFilter/ControlLaw.h
- Timestamp:
- Apr 8, 2016, 3:39:24 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/FlairFilter/ControlLaw.h
r9 r13 17 17 18 18 namespace flair { 19 20 21 22 23 24 19 namespace gui { 20 class LayoutPosition; 21 } 22 namespace core { 23 class cvmatrix; 24 } 25 25 } 26 26 27 namespace flair { namespace filter { 28 /*! \class ControlLaw 29 * 30 * \brief Base class for control law 31 * input must be created by reimplemented class.\n 32 * output is created by this class, it is of size (nb_out,1) and type float.\n 33 * see constructor for nb_out 34 */ 35 class ControlLaw : public core::IODevice { 36 public: 37 /*! 38 * \brief Constructor 39 * 40 * Construct a ControlLaw 41 * 42 * \param parent parent 43 * \param name name 44 * \param nb_out number of output 45 */ 46 ControlLaw(const core::Object* parent,std::string name,uint32_t nb_out=1); 27 namespace flair { 28 namespace filter { 29 /*! \class ControlLaw 30 * 31 * \brief Base class for control law 32 * input must be created by reimplemented class.\n 33 * output is created by this class, it is of size (nb_out,1) and type float.\n 34 * see constructor for nb_out 35 */ 36 class ControlLaw : public core::IODevice { 37 public: 38 /*! 39 * \brief Constructor 40 * 41 * Construct a ControlLaw 42 * 43 * \param parent parent 44 * \param name name 45 * \param nb_out number of output 46 */ 47 ControlLaw(const core::Object *parent, std::string name, uint32_t nb_out = 1); 47 48 48 49 50 51 52 49 /*! 50 * \brief Destructor 51 * 52 */ 53 ~ControlLaw(); 53 54 54 55 56 57 58 59 60 61 float Output(uint32_t index=0) const;55 /*! 56 * \brief Output value 57 * 58 * \param index output index, between 0 and nb_out-1 59 * 60 * \return output value 61 */ 62 float Output(uint32_t index = 0) const; 62 63 63 /*! 64 * \brief Use default plot 65 * 66 * Plot the output value at given position. \n 67 * Only Output(1,1) is plotted. \n 68 * In case of a mutliple output ControlLaw, this function should be reimplemented. \n 69 * After calling this function, position will be deleted as it is no longer usefull. \n 70 * 71 * \param position position to display plot 72 */ 73 virtual void UseDefaultPlot(const gui::LayoutPosition* position); 64 /*! 65 * \brief Use default plot 66 * 67 * Plot the output value at given position. \n 68 * Only Output(1,1) is plotted. \n 69 * In case of a mutliple output ControlLaw, this function should be 70 *reimplemented. \n 71 * After calling this function, position will be deleted as it is no longer 72 *usefull. \n 73 * 74 * \param position position to display plot 75 */ 76 virtual void UseDefaultPlot(const gui::LayoutPosition *position); 74 77 75 76 77 78 79 80 81 82 78 /*! 79 * \brief Update using provided datas 80 * 81 * Reimplemented class must fill input matrix before calling this. 82 * 83 * \param time time of the update 84 */ 85 void Update(core::Time time); 83 86 84 85 86 87 88 89 90 virtual void Reset(){};87 /*! 88 * \brief Reset the internal state of the control law 89 * 90 * Doesn't do anything by default 91 * 92 */ 93 virtual void Reset(){}; 91 94 92 93 94 95 96 97 98 99 95 protected: 96 /*! 97 * \brief input matrix 98 * 99 * This matrix must be created by the reimplemented class. 100 * 101 */ 102 core::cvmatrix *input; 100 103 101 102 103 104 105 106 107 108 104 /*! 105 * \brief output matrix 106 * 107 * This matrix is created by this class. Its size is (nb_out,1) and its type 108 * is io_data::Float. 109 * 110 */ 111 core::cvmatrix *output; 109 112 110 111 112 113 114 115 116 117 118 virtual void UpdateFrom(const core::io_data *data)=0;119 113 private: 114 /*! 115 * \brief Update using provided datas 116 * 117 * Reimplemented from IODevice. 118 * 119 * \param data data from the parent to process 120 */ 121 virtual void UpdateFrom(const core::io_data *data) = 0; 122 }; 120 123 } // end namespace filter 121 124 } // end namespace flair
Note:
See TracChangeset
for help on using the changeset viewer.