Candy
|
This is an end-fitting first-order adaptive window estimator of velocity from samples allowing jittering. More...
Public Member Functions | |
EFFOAW () | |
Creates a new end-fitting first-order adaptive window estimator using the default parameters. More... | |
void | setHistoryLength (size_t N) |
Set how many samples should be saved to be used when estimating the velocity. More... | |
size_t | getHistoryLength () const |
Get the number of samples that are saved to be used when estimating the velocity. More... | |
void | setHistoryDuration (double t) |
Set how old samples should be saved to be used when estimating the velocity. More... | |
double | getHistoryDuration () const |
Get how old samples are saved to be used when estimating the velocity. More... | |
void | addSample (size_t id, VEC position, double time) |
Add a position sample. More... | |
template<class TYPE > | |
VEC | estimateVelocity (size_t id, TYPE error) const |
Estimate and return the velocity using samples associated to id. More... | |
void | cleanup (double time) |
Clean-up old samples and unused ids. More... | |
This is an end-fitting first-order adaptive window estimator of velocity from samples allowing jittering.
Candy::Utils::EFFOAW< VEC >::EFFOAW | ( | ) |
Creates a new end-fitting first-order adaptive window estimator using the default parameters.
void Candy::Utils::EFFOAW< VEC >::addSample | ( | size_t | id, |
VEC | position, | ||
double | time | ||
) |
Add a position sample.
Each sample is associated to an id and a time.
id | The id to add position sample to. |
position | The position value to use as sample. |
time | The time at which the sample was taken. |
void Candy::Utils::EFFOAW< VEC >::cleanup | ( | double | time | ) |
Clean-up old samples and unused ids.
This function should be called from time to time, for example after calling addSample, to avoid too much unnecessary memory usage.
time | The current time, to use when estimating if samples are too old. |
VEC Candy::Utils::EFFOAW< VEC >::estimateVelocity | ( | size_t | id, |
TYPE | error | ||
) | const |
Estimate and return the velocity using samples associated to id.
id | The id to estimate velocity for. |
error | An estimate of the position tracking error, used to determine how many samples to include in the averaging. |
|
inline |
Get how old samples are saved to be used when estimating the velocity.
|
inline |
Get the number of samples that are saved to be used when estimating the velocity.
|
inline |
Set how old samples should be saved to be used when estimating the velocity.
|
inline |
Set how many samples should be saved to be used when estimating the velocity.