mc_tasks::SmoothTask< objT > Struct Template Reference

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
 

Detailed Description

template<typename objT>
struct mc_tasks::SmoothTask< objT >

SmoothTask allows to smoothly reach a final weight and objective for a given task.

Template Parameters
objTThe type of the objective given to the task

Member Typedef Documentation

◆ obj_get_fn

template<typename objT >
typedef std::function<const objT(void)> mc_tasks::SmoothTask< objT >::obj_get_fn

A function to get the objective of a task.

◆ obj_set_fn

template<typename objT >
typedef std::function<void(const objT &)> mc_tasks::SmoothTask< objT >::obj_set_fn

A function to set the objective of a task.

◆ w_get_fn

template<typename objT >
typedef std::function<double(void)> mc_tasks::SmoothTask< objT >::w_get_fn

A function to get the current weight of the task.

◆ w_set_fn

template<typename objT >
typedef std::function<void(double)> mc_tasks::SmoothTask< objT >::w_set_fn

A function to set the weight of the task.

Constructor & Destructor Documentation

◆ SmoothTask()

template<typename objT >
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.

Parameters
w_setWeight setting function
w_getWeight getting function
obj_setObjective setting function
obj_getObjective getting function
weightThe target weight
objThe target objective
percentThe interpolation speed as a percentage (step-size, 1 is instantaneous, 0 stop the smooth task process)

Member Function Documentation

◆ reset()

template<typename objT >
void mc_tasks::SmoothTask< objT >::reset ( double  weight,
const objT &  obj,
double  percent 
)

Reset the target weight, target objective and interpolation step.

Parameters
weightNew target weight
objNew objective
percentThe interpolation speed as a percentage (step-size, 1 is instantaneous, 0 stop the smooth task process)

◆ update()

template<typename objT >
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

Member Data Documentation

◆ iter

template<typename objT >
unsigned int mc_tasks::SmoothTask< objT >::iter

◆ nrIter

template<typename objT >
unsigned int mc_tasks::SmoothTask< objT >::nrIter

◆ obj

template<typename objT >
objT mc_tasks::SmoothTask< objT >::obj

◆ obj_get

template<typename objT >
obj_get_fn mc_tasks::SmoothTask< objT >::obj_get

◆ obj_set

template<typename objT >
obj_set_fn mc_tasks::SmoothTask< objT >::obj_set

◆ stepO

template<typename objT >
objT mc_tasks::SmoothTask< objT >::stepO

◆ stepW

template<typename objT >
double mc_tasks::SmoothTask< objT >::stepW

◆ w_get

template<typename objT >
w_get_fn mc_tasks::SmoothTask< objT >::w_get

◆ w_set

template<typename objT >
w_set_fn mc_tasks::SmoothTask< objT >::w_set

◆ weight

template<typename objT >
double mc_tasks::SmoothTask< objT >::weight

The documentation for this struct was generated from the following file: