SmoothTask allows to smoothly reach a final weight and objective for a given task. More...
#include <mc_tasks/SmoothTask.h>
Public Types | |
typedef std::function< void(double)> | w_set_fn |
A function to set the weight of the task. More... | |
typedef std::function< double(void)> | w_get_fn |
A function to get the current weight of the task. More... | |
typedef std::function< void(const objT &)> | obj_set_fn |
A function to set the objective of a task. More... | |
typedef std::function< const objT(void)> | obj_get_fn |
A function to get the objective of a task. More... | |
Public Member Functions | |
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. More... | |
void | update () |
Update the task. More... | |
void | reset (double weight, const objT &obj, double percent) |
Reset the target weight, target objective and interpolation step. More... | |
Public Attributes | |
w_set_fn | w_set |
w_get_fn | w_get |
obj_set_fn | obj_set |
obj_get_fn | obj_get |
double | weight |
objT | obj |
double | stepW |
objT | stepO |
unsigned int | nrIter |
unsigned int | iter |
SmoothTask allows to smoothly reach a final weight and objective for a given task.
objT | The type of the objective given to the task |
typedef std::function<const objT(void)> mc_tasks::SmoothTask< objT >::obj_get_fn |
A function to get the objective of a task.
typedef std::function<void(const objT &)> mc_tasks::SmoothTask< objT >::obj_set_fn |
A function to set the objective of a task.
typedef std::function<double(void)> mc_tasks::SmoothTask< objT >::w_get_fn |
A function to get the current weight of the task.
typedef std::function<void(double)> mc_tasks::SmoothTask< objT >::w_set_fn |
A function to set the weight of the task.
mc_tasks::SmoothTask< objT >::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.
w_set | Weight setting function |
w_get | Weight getting function |
obj_set | Objective setting function |
obj_get | Objective getting function |
weight | The target weight |
obj | The target objective |
percent | The interpolation speed as a percentage (step-size, 1 is instantaneous, 0 stop the smooth task process) |
void mc_tasks::SmoothTask< objT >::reset | ( | double | weight, |
const objT & | obj, | ||
double | percent | ||
) |
Reset the target weight, target objective and interpolation step.
weight | New target weight |
obj | New objective |
percent | The interpolation speed as a percentage (step-size, 1 is instantaneous, 0 stop the smooth task process) |
void mc_tasks::SmoothTask< objT >::update |
Update the task.
This will move the weight to the target weight and the objective to the target objective
unsigned int mc_tasks::SmoothTask< objT >::iter |
unsigned int mc_tasks::SmoothTask< objT >::nrIter |
objT mc_tasks::SmoothTask< objT >::obj |
obj_get_fn mc_tasks::SmoothTask< objT >::obj_get |
obj_set_fn mc_tasks::SmoothTask< objT >::obj_set |
objT mc_tasks::SmoothTask< objT >::stepO |
double mc_tasks::SmoothTask< objT >::stepW |
w_get_fn mc_tasks::SmoothTask< objT >::w_get |
w_set_fn mc_tasks::SmoothTask< objT >::w_set |
double mc_tasks::SmoothTask< objT >::weight |