feedback-controller.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2010 CNRS
3  *
4  * Florent Lamiraux
5  */
6 
7 #ifndef DG_TUTORIAL_FEEDBACK_CONTROLLER_HH
8 #define DG_TUTORIAL_FEEDBACK_CONTROLLER_HH
9 
10 #include <dynamic-graph/entity.h>
11 #include <dynamic-graph/linear-algebra.h>
12 #include <dynamic-graph/signal-ptr.h>
13 #include <dynamic-graph/signal-time-dependent.h>
14 
15 namespace dynamicgraph {
16 namespace tutorial {
23 class FeedbackController : public Entity {
24  public:
28  FeedbackController(const std::string& inName);
29 
31 
33  virtual const std::string& getClassName(void) const { return CLASS_NAME; }
34 
36  virtual std::string getDocString() const {
37  return "Feedback controller aimed at maintaining the pendulum vertical\n";
38  }
46  void setGain(const ::dynamicgraph::Matrix& inGain) { gain_ = inGain; }
47 
51  ::dynamicgraph::Matrix getGain() const { return gain_; }
52 
57  public:
58  /*
59  \brief Class name
60  */
61  static const std::string CLASS_NAME;
62 
63  private:
67  double& computeForceFeedback(double& force, const int& inTime);
68 
72  SignalPtr< ::dynamicgraph::Vector, int> stateSIN;
76  SignalTimeDependent<double, int> forceSOUT;
77 
79  ::dynamicgraph::Matrix gain_;
80 };
81 } // namespace tutorial
82 } // namespace dynamicgraph
83 
84 #endif // DG_TUTORIAL_FEEDBACK_CONTROLLER_HH
dynamicgraph::tutorial::FeedbackController::getClassName
virtual const std::string & getClassName(void) const
Each entity should provide the name of the class it belongs to.
Definition: feedback-controller.hh:33
dynamicgraph
Definition: feedback-controller.hh:15
dynamicgraph::tutorial::FeedbackController::FeedbackController
FeedbackController(const std::string &inName)
Constructor by name.
dynamicgraph::tutorial::FeedbackController::CLASS_NAME
static const std::string CLASS_NAME
Definition: feedback-controller.hh:61
dynamicgraph::tutorial::FeedbackController::~FeedbackController
~FeedbackController()
dynamicgraph::tutorial::FeedbackController
Feedback controller for an inverted pendulum.
Definition: feedback-controller.hh:23
dynamicgraph::tutorial::FeedbackController::getDocString
virtual std::string getDocString() const
Header documentation of the python class.
Definition: feedback-controller.hh:36
dynamicgraph::tutorial::FeedbackController::getGain
::dynamicgraph::Matrix getGain() const
Get feedback gain.
Definition: feedback-controller.hh:51
dynamicgraph::tutorial::FeedbackController::setGain
void setGain(const ::dynamicgraph::Matrix &inGain)
Get feedback gain.
Definition: feedback-controller.hh:46