wbc
|
Base class for all wbc scenes. More...
#include <Scene.hpp>
Public Member Functions | |
Scene (RobotModelPtr robot_model, QPSolverPtr solver, const double dt) | |
~Scene () | |
virtual bool | configure (const std::vector< TaskConfig > &config) |
Configure the WBC scene. Create tasks and sort them by priority. | |
virtual const HierarchicalQP & | update ()=0 |
Update the wbc scene and return the (updated) optimization problem. | |
virtual const base::commands::Joints & | solve (const HierarchicalQP &hqp)=0 |
Solve the given optimization problem. | |
void | setReference (const std::string &task_name, const base::samples::Joints &ref) |
Set reference input for a joint space task. | |
void | setReference (const std::string &task_name, const base::samples::RigidBodyStateSE3 &ref) |
Set reference input for a cartesian space task. | |
void | setTaskWeights (const std::string &task_name, const base::VectorXd &weights) |
Set Task weights input for a task. | |
void | setTaskActivation (const std::string &task_name, double activation) |
Set Task activation for a task. | |
TaskPtr | getTask (const std::string &name) |
Return a Particular task. Throw if the task does not exist. | |
bool | hasTask (const std::string &name) |
True in case the given task exists. | |
const TasksStatus & | getTasksStatus () const |
Returns all tasks as vector. | |
virtual const TasksStatus & | updateTasksStatus ()=0 |
updateTasksStatus Evaluate the fulfillment of the tasks given the current robot state and the solver output | |
void | getHierarchicalQP (HierarchicalQP &_hqp) |
Return tasks sorted by priority for the solver. | |
const base::commands::Joints & | getSolverOutput () const |
Get current solver output. | |
const base::VectorXd & | getSolverOutputRaw () const |
Get current solver output in raw values. | |
void | setJointWeights (const JointWeights &weights) |
set Joint weights by given name | |
const JointWeights & | getJointWeights () const |
Get Joint weights as Named vector. | |
const JointWeights & | getActuatedJointWeights () const |
Get Joint weights as Named vector. | |
RobotModelPtr | getRobotModel () |
Return the current robot model. | |
QPSolverPtr | getSolver () |
Return the current solver. | |
std::vector< TaskConfig > | getWbcConfig () |
Return task configuration. | |
Static Public Member Functions | |
static void | sortTaskConfig (const std::vector< TaskConfig > &config, std::vector< std::vector< TaskConfig > > &sorted_config) |
Sort task config by the priorities of the tasks. | |
static uint | getNTaskVariables (const std::vector< TaskConfig > &config) |
Return number of tasks per priority, given the task config. | |
static std::vector< int > | getNTaskVariablesPerPrio (const std::vector< TaskConfig > &config) |
Return number of tasks per priority, given the task config. | |
Protected Member Functions | |
virtual TaskPtr | createTask (const TaskConfig &config)=0 |
void | clearTasks () |
Delete all tasks and free memory. | |
Protected Attributes | |
RobotModelPtr | robot_model |
QPSolverPtr | solver |
std::vector< std::vector< TaskPtr > > | tasks |
std::vector< std::vector< ConstraintPtr > > | constraints |
TasksStatus | tasks_status |
HierarchicalQP | hqp |
std::vector< int > | n_task_variables_per_prio |
bool | configured |
base::commands::Joints | solver_output_joints |
JointWeights | joint_weights |
JointWeights | actuated_joint_weights |
std::vector< TaskConfig > | wbc_config |
base::VectorXd | solver_output |
Base class for all wbc scenes.
wbc::Scene::Scene | ( | RobotModelPtr | robot_model, |
QPSolverPtr | solver, | ||
const double | dt ) |
wbc::Scene::~Scene | ( | ) |
|
protected |
Delete all tasks and free memory.
|
virtual |
Configure the WBC scene. Create tasks and sort them by priority.
config | configuration. Size has to be > 0. All tasks have to be valid. See TaskConfig.hpp for more details. |
Create tasks. Store the number of task variables per priority
|
protectedpure virtual |
brief Create a task and add it to the WBC scene
Implemented in wbc::AccelerationScene, wbc::AccelerationSceneReducedTSID, wbc::AccelerationSceneTSID, and wbc::VelocityScene.
|
inline |
Get Joint weights as Named vector.
|
inline |
Return tasks sorted by priority for the solver.
|
inline |
Get Joint weights as Named vector.
|
static |
Return number of tasks per priority, given the task config.
|
static |
Return number of tasks per priority, given the task config.
|
inline |
Return the current robot model.
|
inline |
Return the current solver.
|
inline |
Get current solver output.
|
inline |
Get current solver output in raw values.
TaskPtr wbc::Scene::getTask | ( | const std::string & | name | ) |
Return a Particular task. Throw if the task does not exist.
|
inline |
Returns all tasks as vector.
|
inline |
Return task configuration.
bool wbc::Scene::hasTask | ( | const std::string & | name | ) |
True in case the given task exists.
void wbc::Scene::setJointWeights | ( | const JointWeights & | weights | ) |
set Joint weights by given name
void wbc::Scene::setReference | ( | const std::string & | task_name, |
const base::samples::Joints & | ref ) |
Set reference input for a joint space task.
task_name | Name of the task |
task_name | Joint space reference values |
void wbc::Scene::setReference | ( | const std::string & | task_name, |
const base::samples::RigidBodyStateSE3 & | ref ) |
Set reference input for a cartesian space task.
task_name | Name of the task |
task_name | Cartesian space reference values |
void wbc::Scene::setTaskActivation | ( | const std::string & | task_name, |
double | activation ) |
Set Task activation for a task.
task_name | Name of the task |
activation | Activation value. Has to be in interval [0.0Scene,1.0] |
void wbc::Scene::setTaskWeights | ( | const std::string & | task_name, |
const base::VectorXd & | weights ) |
Set Task weights input for a task.
task_name | Name of the task |
weights | Weight vector. Size has to be same as number of task variables |
|
pure virtual |
Solve the given optimization problem.
Implemented in wbc::AccelerationScene, wbc::AccelerationSceneReducedTSID, wbc::AccelerationSceneTSID, and wbc::VelocityScene.
|
static |
Sort task config by the priorities of the tasks.
|
pure virtual |
Update the wbc scene and return the (updated) optimization problem.
Implemented in wbc::AccelerationScene, wbc::AccelerationSceneReducedTSID, wbc::AccelerationSceneTSID, wbc::VelocityScene, and wbc::VelocitySceneQP.
|
pure virtual |
updateTasksStatus Evaluate the fulfillment of the tasks given the current robot state and the solver output
Implemented in wbc::AccelerationScene, wbc::AccelerationSceneReducedTSID, wbc::AccelerationSceneTSID, and wbc::VelocityScene.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |