ocra-recipes
Doxygen documentation for the ocra-recipes repository
LinearTask.h
Go to the documentation of this file.
1 
13 #ifndef _OCRABASE_LINEAR_TASK_H_
14 #define _OCRABASE_LINEAR_TASK_H_
15 
16 //ocra includes
19 
25 namespace ocra
26 {
37  class LinearTask : public LinearFunction
38  {
39  // ------------------------ structures --------------------------------------
40  public:
41  typedef LinearFunction functionType_t; //< alias on the type of the mother class. Needed to duplicate the function tree.
42 
43  // ------------------------ constructors ------------------------------------
44  private:
45  LinearTask(const LinearTask&);
46  LinearTask& operator= (const LinearTask&);
47  protected:
48  public:
50  ~LinearTask();
51 
52  // ------------------------ public interface --------------------------------
53  public:
54  Function& getL();
55  const Function& getL() const;
56  Function& getf();
57  const Function& getf() const;
58 
59  // ------------------------ public static methods ---------------------------
60  public:
61  static LinearTask* createEqualityTaskWithLinearLaw(Function* f, double weight);
62  static LinearTask* createEqualityTaskWithLinearLaw(Function* f, const VectorXd& weight);
63  //generate the task function for f <= 0
64  //for component j the task value is f_dot-weight*f/fi. weight is thus the maximum speed
65  //of f when f==fi when the task is used for an inequality constraint. fi should be negative.
66  static LinearTask* createInequalityTaskWithLinearLaw(Function* f, double weight, double fi);
67  static LinearTask* createInequalityTaskWithLinearLaw(Function* f, const VectorXd& weight, real fi);
68  static LinearTask* createInequalityTaskWithLinearLaw(Function* f, real weight, const VectorXd& fi);
69  static LinearTask* createInequalityTaskWithLinearLaw(Function* f, const VectorXd& weight, const VectorXd& fi);
70  static LinearTask* createInequalityTaskWithLinearLaw(Function* f, const VectorXd& weightDividedByFi);
71 
72 
73  // ------------------------ protected methods -------------------------------
74  protected:
75  void updateJacobian() const;
76  void updateb() const;
77 
79 
80  void doUpdateDimensionBegin(int newDimension);
81  void doUpdateDimensionEnd(int oldDimension);
82 
83  // ------------------------ private methods ---------------------------------
84  private:
85  void updateDimension(int timestamp);
86 
87  // ------------------------ protected members -------------------------------
88  protected:
91  };
92 
93 
95  {
96  return *_L;
97  }
98 
99  inline const Function& LinearTask::getL() const
100  {
101  return *_L;
102  }
103 
104  inline const Function& LinearTask::getf() const
105  {
106  return *_f;
107  }
108 
110  {
111  return *_f;
112  }
113 
114 
115 
116 
117 
118  void testLinearTask();
119 }
120 
121 #endif //_OCRABASE_LINEAR_TASK_H_
122 
123 // cmake:sourcegroup=Function
124 
void doUpdateDimensionBegin(int newDimension)
Definition: LinearTask.cpp:142
void updateJacobian() const
Definition: LinearTask.cpp:131
Function & getf()
Definition: LinearTask.h:109
LinearTask class.
Definition: LinearTask.h:37
LinearFunction class.
Function * _f
Definition: LinearTask.h:89
static LinearTask * createInequalityTaskWithLinearLaw(Function *f, double weight, double fi)
Definition: LinearTask.cpp:66
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Function class.
Definition: Function.h:77
Function & getL()
Definition: LinearTask.h:94
Declaration file of the LinearFunction class.
void doUpdateDimensionEnd(int oldDimension)
Definition: LinearTask.cpp:147
Declaration file of the DiagonalLinearFunction class.
void doUpdateInputSizeBegin()
Definition: LinearTask.cpp:137
void updateb() const
Definition: LinearTask.cpp:39
double real
Definition: MathTypes.h:27
void testLinearTask()
Definition: LinearTask.cpp:163
LinearFunction functionType_t
Definition: LinearTask.h:41
static LinearTask * createEqualityTaskWithLinearLaw(Function *f, double weight)
Definition: LinearTask.cpp:49
Function * _L
Definition: LinearTask.h:90