ocra-recipes
Doxygen documentation for the ocra-recipes repository
ContactSet.h
Go to the documentation of this file.
1 
13 #ifndef _OCRA_CONTACT_SET_H_
14 #define _OCRA_CONTACT_SET_H_
15 
17 #include <Eigen/Lgsm>
18 #include <boost/shared_ptr.hpp>
19 #include <vector>
20 #include <memory>
21 #include "ocra/optim/Constraint.h"
24 #include "ocra/optim/Objective.h"
25 
26 #include "ocra/control/Model.h"
29 #include "ocra/control/Feature.h"
30 #include "ocra/control/Task.h"
32 
33 #include <stdexcept>
34 #include <sstream>
35 
36 namespace ocra
37 {
38  class ContactSetBuilder;
39  class SegmentFrame;
40  class ContactConstraintFeature;
41  class PointContactFeature;
42  class Task;
43  class Model;
44  class Controller;
45 }
46 
47 namespace ocra
48 {
49  // ------------------------------------------------------------
50  // --- BASE CLASS ---------------------------------------------
51  // ------------------------------------------------------------
52 
54 
59  class ContactSet
60  : public NamedInstance
61  {
62  public:
63  ContactSet(const std::string& name, const Controller& factory, SegmentFrame::Ptr body, double mu, double margin);
64  virtual ~ContactSet();
65 
66  void addContactFrame(const Eigen::Displacementd& frame);
67 
69  std::shared_ptr<Task> getBodyTask() const;
70  const std::vector<SegmentFrame::Ptr>& getPoints() const;
71  const std::vector<PointContactFeature::Ptr>& getFeatures() const;
72  const std::vector<std::shared_ptr<Task>>& getTasks() const;
73 
74  SegmentFrame::Ptr getBodyFrame() const;
75  double getMu() const;
76  double getMargin() const;
77  int getNFacets() const;
78 
79  void setMu(double mu);
80  void setMargin(double margin);
81  void setNFacets(int nFacets);
82 
83  private:
84  const Controller& _factory;
85  const SegmentFrame::Ptr _body;
86  ContactConstraintFeature::Ptr _bodyFeature;
87  std::shared_ptr<Task> _bodyTask;
88  std::vector<SegmentFrame::Ptr> _points;
89  std::vector<PointContactFeature::Ptr> _features;
90  std::vector<std::shared_ptr<Task>> _tasks;
91  double _mu;
92  double _margin;
93  int _nFacets;
94  };
95 }
96 
97 #endif
98 
99 // cmake:sourcegroup=Api
double getMu() const
Definition: ContactSet.cpp:75
Classes that represent frames.
void addContactFrame(const Eigen::Displacementd &frame)
Definition: ContactSet.cpp:25
ContactSet(const std::string &name, const Controller &factory, SegmentFrame::Ptr body, double mu, double margin)
Definition: ContactSet.cpp:7
Contact task factory.
Definition: ContactSet.h:59
SegmentFrame::Ptr getBodyFrame() const
Definition: ContactSet.cpp:40
Declaration file of the Model class.
std::shared_ptr< Task > getBodyTask() const
Definition: ContactSet.cpp:50
A class hierarchy to compute task errors based on control frames.
const std::vector< SegmentFrame::Ptr > & getPoints() const
Definition: ContactSet.cpp:55
void setMargin(double margin)
Definition: ContactSet.cpp:80
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Interface for controllers.
Definition: Controller.h:53
virtual ~ContactSet()
Definition: ContactSet.cpp:21
Declaration file of the WeightedSquareDistanceFunction class.
Declaration file of the LinearizedCoulombFunction class.
Declaration file of the Constraint class.
Controller interface.
void setNFacets(int nFacets)
Definition: ContactSet.cpp:90
const std::vector< std::shared_ptr< Task > > & getTasks() const
Definition: ContactSet.cpp:65
Used to build contact constraint tasks (null acceleration).
Definition: Feature.h:279
const std::vector< PointContactFeature::Ptr > & getFeatures() const
Definition: ContactSet.cpp:60
void setMu(double mu)
Definition: ContactSet.cpp:70
Declaration file of the Objective class.
int getNFacets() const
Definition: ContactSet.cpp:95
double getMargin() const
Definition: ContactSet.cpp:85
Some enumerations for the control.
ContactConstraintFeature & getBodyFeature() const
Definition: ContactSet.cpp:45