10 Model::Ptr _innerModel,
11 OneLevelSolver::Ptr _levelSolver,
12 bool _useReducedProblem):
14 innerModel(_innerModel),
15 cascadeQPSolver(new
CascadeQPSolver(_ctrlName,_innerModel,_levelSolver,_useReducedProblem))
17 std::cout <<
"Constructing Hocra Controller"<<std::endl;
22 std::cout <<
"HocraController::doAddContactSet" << std::endl;
26 std::cout <<
"Adding task "<<task->getName()<<
" at level "<<task->getHierarchyLevel() << std::endl;
27 cascadeQPSolver->addTask(task);
34 for(
auto task : tasks)
39 if(!cascadeQPSolver->solve().info)
41 tau = innerModel->getJointTorqueVariable().getValue();
43 }
catch(
const std::exception & e) {
44 std::cerr << e.what() ;
45 throw std::runtime_error(
"[HocraController::doComputeOutput] Error while computing output");
50 std::cout <<
"HocraController::doCreateContactTask" << std::endl;
51 return std::make_shared<ocra::Task>(name, innerModel, feature);
56 std::cout <<
"HocraController::doCreateTask des" << std::endl;
57 return std::make_shared<ocra::Task>(name, innerModel, feature, featureDes);
62 std::cout <<
"HocraController::doCreateTask" << std::endl;
63 return std::make_shared<ocra::Task>(name, innerModel, feature);
Task::Ptr doCreateContactTask(const std::string &name, ocra::PointContactFeature::Ptr feature, double mu, double margin) const
Task::Ptr doCreateTask(const std::string &name, ocra::Feature::Ptr feature) const
virtual void doAddContactSet(const ContactSet &contacts)
Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
Interface for controllers.
virtual void doAddTask(Task::Ptr task)
virtual void doComputeOutput(VectorXd &tau)
HocraController(const std::string &ctrlName, Model::Ptr innerModel, OneLevelSolver::Ptr innerSolver, bool useReducedProblem)
const std::vector< std::shared_ptr< Task > > & getActiveTasks() const