Go to the documentation of this file.
17 template<
typename objT>
93 template<
typename objT>
101 : w_set(w_set), w_get(w_get), obj_set(obj_set), obj_get(obj_get)
106 template<
typename objT>
109 this->weight = weight;
112 stepW = (weight - w_get()) * percent;
113 stepO = (obj - obj_get()) * percent;
115 nrIter =
static_cast<unsigned int>(ceil(1 / percent));
119 template<
typename objT>
124 w_set(w_get() + stepW);
125 obj_set(obj_get() + stepO);
void reset(double weight, const objT &obj, double percent)
Reset the target weight, target objective and interpolation step.
Definition: SmoothTask.h:107
unsigned int iter
Definition: SmoothTask.h:90
void update()
Update the task.
Definition: SmoothTask.h:120
obj_set_fn obj_set
Definition: SmoothTask.h:80
std::function< double(void)> w_get_fn
A function to get the current weight of the task.
Definition: SmoothTask.h:24
objT obj
Definition: SmoothTask.h:84
w_get_fn w_get
Definition: SmoothTask.h:79
w_set_fn w_set
Definition: SmoothTask.h:78
double stepW
Definition: SmoothTask.h:86
SmoothTask(w_set_fn w_set, w_get_fn w_get, obj_set_fn obj_set, obj_get_fn obj_get, double weight, const objT &obj, double percent)
Constructor.
Definition: SmoothTask.h:94
SmoothTask allows to smoothly reach a final weight and objective for a given task.
Definition: SmoothTask.h:18
obj_get_fn obj_get
Definition: SmoothTask.h:81
objT stepO
Definition: SmoothTask.h:87
std::function< const objT(void)> obj_get_fn
A function to get the objective of a task.
Definition: SmoothTask.h:28
std::function< void(const objT &)> obj_set_fn
A function to set the objective of a task.
Definition: SmoothTask.h:26
std::function< void(double)> w_set_fn
A function to set the weight of the task.
Definition: SmoothTask.h:22
unsigned int nrIter
Definition: SmoothTask.h:89
Definition: StabilizerStandingState.h:11
double weight
Definition: SmoothTask.h:83