Odometry.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2010-2016, 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 ODOMETRY_H_
29 #define ODOMETRY_H_
30 
32 
33 #include <rtabmap/core/Transform.h>
36 
37 namespace rtabmap {
38 
39 class OdometryInfo;
40 class ParticleFilter;
41 
43 {
44 public:
45  enum Type {
46  kTypeUndef = -1,
47  kTypeF2M = 0,
48  kTypeF2F = 1,
49  kTypeFovis = 2,
50  kTypeViso2 = 3,
51  kTypeDVO = 4,
52  kTypeORBSLAM2 = 5,
53  kTypeOkvis = 6,
54  kTypeLOAM = 7,
55  kTypeMSCKF = 8
56  };
57 
58 public:
59  static Odometry * create(const ParametersMap & parameters);
60  static Odometry * create(Type & type, const ParametersMap & parameters = ParametersMap());
61 
62 public:
63  virtual ~Odometry();
64  Transform process(SensorData & data, OdometryInfo * info = 0);
65  Transform process(SensorData & data, const Transform & guess, OdometryInfo * info = 0);
66  virtual void reset(const Transform & initialPose = Transform::getIdentity());
67  virtual Odometry::Type getType() = 0;
68  virtual bool canProcessRawImages() const {return false;}
69 
70  //getters
71  const Transform & getPose() const {return _pose;}
72  bool isInfoDataFilled() const {return _fillInfoData;}
73  const Transform & previousVelocityTransform() const {return previousVelocityTransform_;}
74  double previousStamp() const {return previousStamp_;}
75  unsigned int framesProcessed() const {return framesProcessed_;}
76  bool imagesAlreadyRectified() const {return _imagesAlreadyRectified;}
77 
78 private:
79  virtual Transform computeTransform(SensorData & data, const Transform & guess = Transform(), OdometryInfo * info = 0) = 0;
80 
81  void initKalmanFilter(const Transform & initialPose = Transform::getIdentity(), float vx=0.0f, float vy=0.0f, float vz=0.0f, float vroll=0.0f, float vpitch=0.0f, float vyaw=0.0f);
82  void predictKalmanFilter(float dt, float * vx=0, float * vy=0, float * vz=0, float * vroll=0, float * vpitch=0, float * vyaw=0);
83  void updateKalmanFilter(float & vx, float & vy, float & vz, float & vroll, float & vpitch, float & vyaw);
84 
85 private:
87  bool _force3DoF;
88  bool _holonomic;
109  unsigned int framesProcessed_;
110 
111  std::vector<ParticleFilter *> particleFilters_;
112  cv::KalmanFilter kalmanFilter_;
113 
114 protected:
115  Odometry(const rtabmap::ParametersMap & parameters);
116 };
117 
118 } /* namespace rtabmap */
119 #endif /* ODOMETRY_H_ */
bool _imagesAlreadyRectified
Definition: Odometry.h:102
bool _fillInfoData
Definition: Odometry.h:96
unsigned int framesProcessed() const
Definition: Odometry.h:75
float _kalmanMeasurementNoise
Definition: Odometry.h:98
cv::KalmanFilter kalmanFilter_
Definition: Odometry.h:112
f
bool isInfoDataFilled() const
Definition: Odometry.h:72
bool imagesAlreadyRectified() const
Definition: Odometry.h:76
float _particleLambdaR
Definition: Odometry.h:95
unsigned int framesProcessed_
Definition: Odometry.h:109
static Transform getIdentity()
Definition: Transform.cpp:364
Transform previousVelocityTransform_
Definition: Odometry.h:106
double previousStamp_
Definition: Odometry.h:105
std::map< std::string, std::string > ParametersMap
Definition: Parameters.h:41
float _kalmanProcessNoise
Definition: Odometry.h:97
const Transform & getPose() const
Definition: Odometry.h:71
double previousStamp() const
Definition: Odometry.h:74
virtual bool canProcessRawImages() const
Definition: Odometry.h:68
int _filteringStrategy
Definition: Odometry.h:90
int _resetCurrentCount
Definition: Odometry.h:104
float distanceTravelled_
Definition: Odometry.h:108
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
bool guessFromMotion_
Definition: Odometry.h:89
const Transform & previousVelocityTransform() const
Definition: Odometry.h:73
Transform previousGroundTruthPose_
Definition: Odometry.h:107
bool _publishRAMUsage
Definition: Odometry.h:101
std::vector< ParticleFilter * > particleFilters_
Definition: Odometry.h:111
Transform _pose
Definition: Odometry.h:103
float _particleNoiseR
Definition: Odometry.h:94
int _imageDecimation
Definition: Odometry.h:99
float _particleNoiseT
Definition: Odometry.h:92
bool _alignWithGround
Definition: Odometry.h:100
float _particleLambdaT
Definition: Odometry.h:93


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:41:32