1#ifndef WBC_CORE_SCENE_HPP
2#define WBC_CORE_SCENE_HPP
29 virtual bool configure(
const std::vector<TaskPtr> &tasks) = 0;
64 throw std::runtime_error(
"Failed to create instance of plugin " + name +
". Is the plugin registered?");
65 return it->second(robot_model, solver, dt);
71 T* ret =
dynamic_cast<T*
>(tmp);
94 throw std::runtime_error(
"Failed to register plugin with name " + name +
". A plugin with the same name is already registered");
Base class for all wbc scenes.
Definition Scene.hpp:16
virtual const HierarchicalQP & update()=0
Update the wbc scene and return the (updated) optimization problem.
RobotModelPtr robot_model
Definition Scene.hpp:18
Scene(RobotModelPtr robot_model, QPSolverPtr solver, const double dt)
Definition Scene.cpp:9
QPSolverPtr getSolver()
Return the current solver.
Definition Scene.hpp:51
virtual bool configure(const std::vector< TaskPtr > &tasks)=0
Configure the WBC scene. Create tasks and sort them by priority given the task config.
virtual const types::JointCommand & solve(const HierarchicalQP &hqp)=0
Solve the given optimization problem.
~Scene()
Definition Scene.cpp:14
RobotModelPtr getRobotModel()
Return the current robot model.
Definition Scene.hpp:46
QPSolverPtr solver
Definition Scene.hpp:19
Definition JointCommand.hpp:8
Definition ContactsAccelerationConstraint.cpp:3
QPSolver * createT()
Definition QPSolver.hpp:35
std::shared_ptr< Scene > ScenePtr
Definition Scene.hpp:54
std::shared_ptr< QPSolver > QPSolverPtr
Definition QPSolver.hpp:33
std::shared_ptr< RobotModel > RobotModelPtr
Definition RobotModel.hpp:315
Describes a hierarchy of quadratic programs.
Definition QuadraticProgram.hpp:53
static SceneMap * getSceneMap()
Definition Scene.hpp:75
std::map< std::string, Scene *(*)(RobotModelPtr, QPSolverPtr, double)> SceneMap
Definition Scene.hpp:59
static T * createInstance(const std::string &name, RobotModelPtr robot_model, QPSolverPtr solver, const double dt)
Definition Scene.hpp:69
static Scene * createInstance(const std::string &name, RobotModelPtr robot_model, QPSolverPtr solver, const double dt)
Definition Scene.hpp:61
static void clear()
Definition Scene.hpp:81
SceneRegistry(const std::string &name)
Definition Scene.hpp:91