30 using namespace filters;
35 this->windowFilterSize = windowSize;
36 this->dataIndex = -windowSize;
37 this->offset = Eigen::Vector3f::Zero();
38 this->currentValue = Eigen::Vector3f::Zero();
43 std::unique_lock lock(historyMutex);
45 if (dataHistory.size() == 0)
50 VariantPtr var = VariantPtr::dynamicCast(dataHistory.begin()->second);
87 float armarx::filters::PoseMedianOffsetFilter::median(std::vector<float>&
values)
93 Eigen::Vector3f armarx::filters::PoseMedianOffsetFilter::calculateMedian()
95 Eigen::Vector3f result;
96 for (
int i = 0; i < 3; ++i)
101 for (
const Eigen::Vector3f&
v :
data)
105 result(i) = median(
values);
118 data.push_back(currentValue);
119 this->currentValue = Eigen::Vector3f::Zero();
123 offset = calculateMedian();
128 data.at(dataIndex) = currentValue;
129 dataIndex = (dataIndex + 1) % windowFilterSize;
130 this->currentValue = calculateMedian() - offset;