ocra-recipes
Doxygen documentation for the ocra-recipes repository
gOcraContactTaskManager.cpp
Go to the documentation of this file.
2 
3 namespace gocra
4 {
5 
16 gOcraContactTaskManager::gOcraContactTaskManager(GHCJTController& _ctrl, const ocra::Model& _model, const std::string& _taskName, const std::string& _segmentName, Eigen::Displacementd _H_segment_frame, double _mu, double _margin)
17  : gOcraTaskManagerBase(_ctrl, _model, _taskName), segmentName(_segmentName)
18 {
19  featFrame = new ocra::SegmentFrame(name + ".SegmentFrame", model, model.SegmentName(segmentName), _H_segment_frame);
20  feat = new ocra::PointContactFeature(name + ".PointContactFeature", *featFrame);
21 
22  task = &(ctrl.createGHCJTContactTask(name, *feat, _mu, _margin));
23 
24  ctrl.addTask(task);
25 
26  task->activateAsConstraint();
27 }
28 
34 {
35  task->activateAsConstraint();
36 }
37 
43 {
44  task->deactivate();
45 }
46 
47 // Masks base class function
49 {
50  throw std::runtime_error("[gOcraContactTaskManager::getTaskError()] Error is meaningless in this context or has not been computed");
51 }
52 
53 // Masks base class function
55 {
56  throw std::runtime_error("[gOcraContactTaskManager::getTaskErrorNorm()] Error is meaningless in this context or has not been computed");
57 }
58 
59 
60 }
gOcraContactTaskManager(GHCJTController &ctrl, const ocra::Model &model, const std::string &taskName, const std::string &segmentName, Eigen::Displacementd H_segment_frame, double mu, double margin)
void activateAsConstraint()
Definition: Task.cpp:312
Model class.
Definition: Model.h:38
Task Manager for the Center of Mass (CoM) task with the gOcra Controllers.
gOcra Controller based on LQP solver for the ocra framework.
void deactivate()
Definition: Task.cpp:326
A frame attached to a segment of a model.
Definition: ControlFrame.h:104
gocra::GHCJTController & ctrl
Used to build point contact tasks.
Definition: Feature.h:147
GHCJTTask & createGHCJTContactTask(const std::string &name, PointContactFeature::Ptr feature, double mu, double margin) const
const std::string SegmentName(const std::string &name) const
Definition: Model.cpp:245
void addTask(std::shared_ptr< Task > task)
Definition: Controller.cpp:184