Ignore:
Timestamp:
08/29/12 16:52:52 (12 years ago)
Author:
wcaarls
Message:

Updated extremum_seeking to revision 1017

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/extremum_seeking/esc_common/include/esc_common/esc.h

    r5 r13  
    1515#include <string>
    1616#define PI 3.141592654
     17
     18/// Superclass for extremum seeking control algorithms.
    1719class ESC
    1820{
    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    };
    2335
    2436public:
    25         virtual ~ESC() { }
     37    virtual ~ESC() { }
    2638
    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>(); }
    2944
    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;
    3250
    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    }
    3756
    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;
    4265};
    4366
    44 
    4567#endif /* ESC_H_ */
Note: See TracChangeset for help on using the changeset viewer.