IMUFilter.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2019, Mathieu Labbe - IntRoLab - Universite de Sherbrooke
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the Universite de Sherbrooke nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_
29 #define CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_
30 
31 #include "rtabmap/core/rtabmap_core_export.h" // DLL export/import defines
33 #include <Eigen/Geometry>
34 
35 namespace rtabmap {
36 
37 class RTABMAP_CORE_EXPORT IMUFilter
38 {
39 public:
40  enum Type {
41  kMadgwick=0,
42  kComplementaryFilter=1};
43 public:
44  static IMUFilter * create(const ParametersMap & parameters = ParametersMap());
45  static IMUFilter * create(IMUFilter::Type type, const ParametersMap & parameters = ParametersMap());
46 
47 public:
48  virtual void parseParameters(const ParametersMap & parameters) {}
49  virtual ~IMUFilter(){}
50 
51  void update(
52  double gx, double gy, double gz,
53  double ax, double ay, double az,
54  double stamp);
55 
56  virtual IMUFilter::Type type() const = 0;
57  virtual void getOrientation(double & qx, double & qy, double & qz, double & qw) const = 0;
58  virtual void reset(double qx = 0.0, double qy = 0.0, double qz = 0.0, double qw = 1.0) = 0;
59 
60 protected:
61  IMUFilter(const ParametersMap & parameters = ParametersMap()) : previousStamp_(0) {}
62 
63 private:
64  // Update from accelerometer and gyroscope data.
65  // [gx, gy, gz]: Angular veloctiy, in rad / s.
66  // [ax, ay, az]: Normalized gravity vector.
67  // dt: time delta, in seconds.
68  virtual void updateImpl(
69  double gx, double gy, double gz,
70  double ax, double ay, double az,
71  double dt) = 0;
72 
73 private:
75 };
76 
77 }
78 
79 
80 #endif /* CORELIB_INCLUDE_RTABMAP_CORE_IMUFILTER_H_ */
create
ADT create(const Signature &signature)
update
def update(text)
rtabmap::IMUFilter::IMUFilter
IMUFilter(const ParametersMap &parameters=ParametersMap())
Definition: IMUFilter.h:61
type
rtabmap::ParametersMap
std::map< std::string, std::string > ParametersMap
Definition: Parameters.h:43
rtabmap::IMUFilter::Type
Type
Definition: IMUFilter.h:40
Parameters.h
rtabmap::IMUFilter
Definition: IMUFilter.h:37
Type
rtabmap::IMUFilter::~IMUFilter
virtual ~IMUFilter()
Definition: IMUFilter.h:49
rtabmap::IMUFilter::parseParameters
virtual void parseParameters(const ParametersMap &parameters)
Definition: IMUFilter.h:48
rtabmap
Definition: CameraARCore.cpp:35
rtabmap::IMUFilter::previousStamp_
double previousStamp_
Definition: IMUFilter.h:74


rtabmap
Author(s): Mathieu Labbe
autogenerated on Thu Jul 25 2024 02:50:11