MedianDerivativeFilterV3.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
28 #include <RobotAPI/interface/core/PoseBase.h>
29 
30 namespace armarx::filters
31 {
32 
33  /**
34  * @class PoseMedianOffsetFilter
35  * @ingroup ObserverFilters
36  * @brief The MedianFilter class provides an implementation
37  * for a median for datafields of type float, int and double.
38  */
40  public ::armarx::MedianDerivativeFilterV3Base,
41  public MedianFilter
42  {
43  public:
44  MedianDerivativeFilterV3(std::size_t offsetWindowSize = 1001, std::size_t windowSize = 11);
45 
46  // DatafieldFilterBase interface
47  public:
48  VariantBasePtr calculate(const Ice::Current& c) const override;
49 
50  /**
51  * @brief This filter supports: Vector3, FramedDirection, FramedPosition
52  * @return List of VariantTypes
53  */
54  ParameterTypeList getSupportedTypes(const Ice::Current& c) const override;
55 
56  private:
57  Eigen::Vector3f currentValue;
58  Eigen::Vector3f currentOffset;
59  std::vector<Eigen::Vector3f> valueData;
60  std::vector<Eigen::Vector3f> offsetData;
61  std::size_t valueIndex;
62  std::size_t offsetIndex;
63 
64  float median(std::vector<float>& values);
65  Eigen::Vector3f calculateMedian(std::vector<Eigen::Vector3f> const& values);
66 
67  public:
68  void update(Ice::Long timestamp, const VariantBasePtr& value, const Ice::Current& c) override;
69 
70  };
71 
72 }
armarx::filters::MedianDerivativeFilterV3::getSupportedTypes
ParameterTypeList getSupportedTypes(const Ice::Current &c) const override
This filter supports: Vector3, FramedDirection, FramedPosition.
Definition: MedianDerivativeFilterV3.cpp:81
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
IceInternal::Handle<::armarx::VariantBase >
armarx::filters
Definition: AverageFilter.h:31
armarx::filters::MedianFilter
The MedianFilter class provides an implementation for a median for datafields of type float,...
Definition: MedianFilter.h:46
cxxopts::value
std::shared_ptr< Value > value()
Definition: cxxopts.hpp:926
FramedPose.h
armarx::filters::MedianDerivativeFilterV3::update
void update(Ice::Long timestamp, const VariantBasePtr &value, const Ice::Current &c) override
Definition: MedianDerivativeFilterV3.cpp:120
armarx::filters::MedianDerivativeFilterV3::calculate
VariantBasePtr calculate(const Ice::Current &c) const override
Definition: MedianDerivativeFilterV3.cpp:44
armarx::filters::MedianDerivativeFilterV3
Definition: MedianDerivativeFilterV3.h:39
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
MedianFilter.h
armarx::filters::MedianDerivativeFilterV3::MedianDerivativeFilterV3
MedianDerivativeFilterV3(std::size_t offsetWindowSize=1001, std::size_t windowSize=11)
Definition: MedianDerivativeFilterV3.cpp:33