Changeset 13 for trunk/extremum_seeking/esc_common
- Timestamp:
- 08/29/12 16:52:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/extremum_seeking/esc_common/include/esc_common/esc.h
r5 r13 15 15 #include <string> 16 16 #define PI 3.141592654 17 18 /// Superclass for extremum seeking control algorithms. 17 19 class ESC 18 20 { 19 public: 20 21 enum inputType { inputStateValue, inputValue }; 22 enum outputType { outputVelocity, outputPosition }; 21 public: 22 /// Controller input type 23 enum inputType 24 { 25 inputStateValue, ///< State-value input. 26 inputValue ///< Value input. 27 }; 28 29 /// Controller output type. 30 enum outputType 31 { 32 outputVelocity, ///< Velocity reference output. 33 outputPosition ///< Position reference output. 34 }; 23 35 24 36 public: 25 37 virtual ~ESC() { } 26 38 27 virtual std::vector<std::string> monitorNames() { return std::vector<std::string>(); } 28 virtual std::vector<double> monitor() { return std::vector<double>(); } 39 /// Get internal monitor variable names. 40 virtual std::vector<std::string> monitorNames() { return std::vector<std::string>(); } 41 42 /// Get internal monitor variables. 43 virtual std::vector<double> monitor() { return std::vector<double>(); } 29 44 30 virtual inputType getInputType() = 0; 31 virtual outputType getOutputType() = 0; 45 /// Get controller input type. 46 virtual inputType getInputType() = 0; 47 48 /// Get controller output type. 49 virtual outputType getOutputType() = 0; 32 50 33 virtual std::vector<double> step(std::vector<double> state, double obj_val) 34 { 35 return step(obj_val); 36 } 51 /// Control step function for value-input control algorithms. 52 virtual std::vector<double> step(std::vector<double> state, double obj_val) 53 { 54 return step(obj_val); 55 } 37 56 38 virtual std::vector<double> step(double obj_val) 39 { 40 return std::vector<double>(); 41 } 57 /// Control step function for state-input control algorithms. 58 virtual std::vector<double> step(double obj_val) 59 { 60 return std::vector<double>(); 61 } 62 63 /// Reset control algorithm to initial conditions. 64 virtual void reset() = 0; 42 65 }; 43 66 44 45 67 #endif /* ESC_H_ */
Note: See TracChangeset
for help on using the changeset viewer.