wbc
Task.hpp
Go to the documentation of this file.
1#ifndef TASK_HPP
2#define TASK_HPP
3
4#include "TaskConfig.hpp"
5#include "RobotModel.hpp"
6#include <base/Eigen.hpp>
7#include <base/Time.hpp>
8#include <base/NamedVector.hpp>
9#include <memory>
10
11namespace wbc{
12
16class Task {
17public:
18
20 Task();
21
23 Task(const TaskConfig& _config, uint n_robot_joints);
24 ~Task();
25
29 void reset();
30
34 virtual void update(RobotModelPtr robot_model) = 0;
35
41 void checkTimeout();
42
47 void setWeights(const base::VectorXd& weights);
48
53 void setActivation(const double activation);
54
56 base::Time time;
57
60
63 base::VectorXd y_ref;
64
67 base::VectorXd y_ref_root;
68
72 base::VectorXd weights;
73
76 base::VectorXd weights_root;
77
79 double activation;
80
84
86 base::MatrixXd A;
87
89 base::MatrixXd Aw;
90};
91
92
93using TaskPtr = std::shared_ptr<Task> ;
94
95} // namespace wbc
96
97#endif
Defines a task in the whole body control problem. Valid Configurations are e.g.
Definition TaskConfig.hpp:39
Abstract class to represent a generic task for a WBC optimization problem.
Definition Task.hpp:16
base::VectorXd y_ref
Definition Task.hpp:63
void reset()
Reset task variables to initial values.
Definition Task.cpp:30
virtual void update(RobotModelPtr robot_model)=0
Update Task matrices and vectors.
Task()
Default constructor.
Definition Task.cpp:7
void setWeights(const base::VectorXd &weights)
Set task weights.
Definition Task.cpp:54
void setActivation(const double activation)
Set task activation.
Definition Task.cpp:69
int timeout
Definition Task.hpp:83
double activation
Definition Task.hpp:79
base::VectorXd weights
Definition Task.hpp:72
base::VectorXd weights_root
Definition Task.hpp:76
base::Time time
Definition Task.hpp:56
~Task()
Definition Task.cpp:26
base::MatrixXd Aw
Definition Task.hpp:89
base::VectorXd y_ref_root
Definition Task.hpp:67
base::MatrixXd A
Definition Task.hpp:86
TaskConfig config
Definition Task.hpp:59
void checkTimeout()
Check if the task is in timeout and set the timeout flag accordingly. A task is in timeout if.
Definition Task.cpp:48
Definition ContactsAccelerationConstraint.cpp:3
std::shared_ptr< Task > TaskPtr
Definition Task.hpp:93
std::shared_ptr< RobotModel > RobotModelPtr
Definition RobotModel.hpp:204