ocra-recipes
Doxygen documentation for the ocra-recipes repository
SecondOrderLinearTask.h
Go to the documentation of this file.
1 
13 #ifndef _OCRABASE_SECOND_ORDER_LINEAR_TASK_H_
14 #define _OCRABASE_SECOND_ORDER_LINEAR_TASK_H_
15 
16 // includes
18 
24 namespace ocra
25 {
34  {
35  // ------------------------ structures --------------------------------------
36  public:
37  typedef LinearFunction functionType_t; //< alias on the type of the mother class. Needed to duplicate the function tree.
38 
39  // ------------------------ constructors ------------------------------------
40  private:
42  SecondOrderLinearTask& operator= (const SecondOrderLinearTask&);
43  protected:
44  public:
47 
48  // ------------------------ public interface --------------------------------
49  public:
50  Function& getL();
51  const Function& getL() const;
52  Function& getf();
53  const Function& getf() const;
54 
55  void saturate(double accelerationMax) {_saturate = true; _accelerationMax = accelerationMax;}
56  void dontSaturate() {_saturate = false;}
57  double getSaturationValue(void) const {return _accelerationMax;}
58  bool isSaturated() const {return _saturate;}
59 
60  // ------------------------ public static methods ---------------------------
61  public:
62  //create the task J*x_ddot + J_dot*x_dot + diag(weight1)*J*x_dot + diag(weight0)*f(x)
63  //weight0 and weight1 should be positive
64  static SecondOrderLinearTask* createSecondOrderLinearTaskWithLinearLaw(Function* f, double weight0, double weight1);
65  static SecondOrderLinearTask* createSecondOrderLinearTaskWithLinearLaw(Function* f, const VectorXd& weight0, const VectorXd& weight1);
66 
67 
68  // ------------------------ private methods ---------------------------------
69  private:
70  void updateJacobian() const;
71  void updateb() const;
72 
73  void doUpdateInputSizeBegin();
74 
75  void doUpdateDimensionBegin(int newDimension);
76  void doUpdateDimensionEnd(int oldDimension);
77 
78  // ------------------------ private methods ---------------------------------
79  private:
80  void updateDimension(int timestamp);
81 
82  // ------------------------ protected members -------------------------------
83  protected:
86  bool _saturate;
88 
89  };
90 
91 
92 
93  inline Function& SecondOrderLinearTask::getL(void) {return *_L;}
94 
95  inline const Function& SecondOrderLinearTask::getf(void) const {return *_f;}
96 }
97 
98 #endif //_OCRABASE_SECOND_ORDER_LINEAR_TASK_H_
99 
100 // cmake:sourcegroup=Function
101 
double getSaturationValue(void) const
static SecondOrderLinearTask * createSecondOrderLinearTaskWithLinearLaw(Function *f, double weight0, double weight1)
LinearFunction class.
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Function class.
Definition: Function.h:77
Declaration file of the LinearFunction class.
void saturate(double accelerationMax)
SecondOrderLinearTask class.