PoseMedianOffsetFilter.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::PoseMedianOffsetFilterBase,
41  public MedianFilter
42  {
43  public:
44  PoseMedianOffsetFilter(int 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 offset;
58  Eigen::Vector3f currentValue;
59  std::vector<Eigen::Vector3f> data;
60  int dataIndex;
61 
62  float median(std::vector<float>& values);
63  Eigen::Vector3f calculateMedian();
64 
65  public:
66  void update(Ice::Long timestamp, const VariantBasePtr& value, const Ice::Current& c) override;
67 
68  };
69 
70 } // namespace Filters
armarx::filters::PoseMedianOffsetFilter::getSupportedTypes
ParameterTypeList getSupportedTypes(const Ice::Current &c) const override
This filter supports: Vector3, FramedDirection, FramedPosition.
Definition: PoseMedianOffsetFilter.cpp:78
ProsthesisInterface.values
values
Definition: ProsthesisInterface.py:190
armarx::filters::PoseMedianOffsetFilter::update
void update(Ice::Long timestamp, const VariantBasePtr &value, const Ice::Current &c) override
Definition: PoseMedianOffsetFilter.cpp:110
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::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::filters::PoseMedianOffsetFilter
The MedianFilter class provides an implementation for a median for datafields of type float,...
Definition: PoseMedianOffsetFilter.h:39
armarx::filters::PoseMedianOffsetFilter::PoseMedianOffsetFilter
PoseMedianOffsetFilter(int windowSize=11)
Definition: PoseMedianOffsetFilter.cpp:32
armarx::filters::PoseMedianOffsetFilter::calculate
VariantBasePtr calculate(const Ice::Current &c) const override
Definition: PoseMedianOffsetFilter.cpp:41
MedianFilter.h