#include <controllerUtil.h>
Classes | |
| struct | HistoryMap |
Static Public Member Functions | |
| static float | computeAverage (HistoryMap *histMap, float currentValue) |
| static int | computeAverageClassification (HistoryMap *histMap, float currentValue) |
This file positionUtil.h is created at Almende B.V. It is open-source software and part of the Common Hybrid Agent Platform (CHAP). A toolbox with a lot of open-source tools. Ranging from thread pools, and TCP/IP components to control architectures and learning algorithms.
There are no licenses involved.
Definition at line 21 of file controllerUtil.h.
| float ControllerUtil::computeAverage | ( | HistoryMap * | histMap, | |
| float | currentValue | |||
| ) | [static] |
This function gives a weighted value based on the history of values. When a value is requested, it is weighted using the number of previous encountered values. This function is for example used to average a series of location estimates.
If the history size is for example 4, then the previous value is weighted as 3/4, then one after that 2/4 and the last one 1/4. If a sensor does not have a proper value it is possible to write a defaultValue into the array. If all values in the array are equal to the defaultValue, the defaultValue will be returned.
| histMap | ||
| currentValueIndex |
Definition at line 45 of file controllerUtil.cpp.
References ControllerUtil::HistoryMap::currentValueIndex, ControllerUtil::HistoryMap::defaultValue, ControllerUtil::HistoryMap::history, and ControllerUtil::HistoryMap::historySize.
| int ControllerUtil::computeAverageClassification | ( | HistoryMap * | histMap, | |
| float | currentValue | |||
| ) | [static] |
This function stores a queue of values just as computeAverage.
| histMap | ||
| currentValueIndex |
Definition at line 106 of file controllerUtil.cpp.
References ControllerUtil::HistoryMap::currentValueIndex, ControllerUtil::HistoryMap::history, and ControllerUtil::HistoryMap::historySize.
1.6.1