ocra-recipes
Doxygen documentation for the ocra-recipes repository
WocraController.h
Go to the documentation of this file.
1 
13 #ifndef __WOCRACTRL_H__
14 
15 #define __WOCRACTRL_H__
16 
17 
18 #include <string>
19 #include <vector>
20 #include <iostream>
21 #include <memory>
22 
23 // OCRA INCLUDES
25 #include "ocra/control/Model.h"
27 
28 // WOCRA INCLUDES
29 #include "ocra/control/Task.h"
33 
34 
35 using namespace ocra;
36 
37 
38 
39 
40 namespace wocra
41 
42 {
43 
44 
45 
102 
103  {
104 
105  public:
106 
107 
117  WocraController(const std::string& ctrlName, std::shared_ptr<Model> innerModel, std::shared_ptr<OneLevelSolver> innerSolver, bool useReducedProblem);
118 
125  virtual ~WocraController();
126 
127 
133  std::shared_ptr<Model> getModel();
134 
140  std::shared_ptr<OneLevelSolver> getSolver();
141 
146  bool isUsingReducedProblem();
147 
155  void setVariableMinimizationWeights(double w_ddq, double w_tau, double w_fc);
156 
162  void takeIntoAccountGravity(bool useGrav);
163 
176  void writePerformanceInStream(std::ostream& myOstream, bool addCommaAtEnd) const;
177 
199  std::string getPerformances() const;
200 
206  void addConstraint(ocra::LinearConstraint& constraint) const;
207 
213  void removeConstraint(ocra::LinearConstraint& constraint) const;
214 
221  void addConstraint(ocra::ControlConstraint& constraint) const;
222 
228  void removeConstraint(ocra::ControlConstraint& constraint) const;
229 
230  // WocraTask& createWocraTask(const std::string& name, Feature::Ptr feature, Feature::Ptr featureDes) const;
231  // WocraTask& createWocraTask(const std::string& name, Feature::Ptr feature) const;
232  // WocraTask& createWocraContactTask(const std::string& name, PointContactFeature::Ptr feature, double mu, double margin) const;
233 
234 
235  protected:
236 
237  virtual void doComputeOutput(Eigen::VectorXd& tau);
238 
244  virtual void doAddTask(std::shared_ptr<Task> task);
245 
252  virtual void doAddContactSet(const ContactSet& contacts);
253 
254 
255 
256  protected: // factory
267  virtual std::shared_ptr<Task> doCreateTask(const std::string& name, Feature::Ptr feature, Feature::Ptr featureDes) const;
268 
278  virtual std::shared_ptr<Task> doCreateTask(const std::string& name, Feature::Ptr feature) const;
279 
291  virtual std::shared_ptr<Task> doCreateContactTask(const std::string& name, PointContactFeature::Ptr feature, double mu, double margin) const;
292 
293 
294  private:
295 
303  struct Pimpl;
304 
305  boost::shared_ptr<Pimpl> pimpl;
306 
307  std::shared_ptr<ocra::JointLimitConstraint> jointLimitConstraint;
308  std::shared_ptr<ocra::TorqueLimitConstraint> torqueLimitConstraint;
309 
310  };
311 
312 
313  // end group core
315 
316 
317 
318 } //end namespace wocra
319 
320 
321 
322 
323 
324 
325 
326 #endif
Contact task factory.
Definition: ContactSet.h:59
Define joint limit constraint for wOcra controller.
Define the internal solver class that can be used in the wOcra controller.
Declaration file of the Model class.
Contains all the abstract & concrete classes for robotic control with optimization, based on the ocra framework.
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Interface for controllers.
Definition: Controller.h:53
Constraint class.
Definition: Constraint.h:100
Controller interface.
Wocra Controller based on LQP solver for the ocra framework.
Define torque limit constraint for wOcra controller.
Define base class that can be used as constraints in wOcra controller.