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  kTypeVINS = 9
57  };
58 
59 public:
60  static Odometry * create(const ParametersMap & parameters = ParametersMap());
61  static Odometry * create(Type & type, const ParametersMap & parameters = ParametersMap());
62 
63 public:
64  virtual ~Odometry();
65  Transform process(SensorData & data, OdometryInfo * info = 0);
66  Transform process(SensorData & data, const Transform & guess, OdometryInfo * info = 0);
67  virtual void reset(const Transform & initialPose = Transform::getIdentity());
68  virtual Odometry::Type getType() = 0;
69  virtual bool canProcessRawImages() const {return false;}
70  virtual bool canProcessIMU() const {return false;}
71 
72  //getters
73  const Transform & getPose() const {return _pose;}
74  bool isInfoDataFilled() const {return _fillInfoData;}
75  RTABMAP_DEPRECATED(const Transform & previousVelocityTransform() const, "Use getVelocityGuess() instead.");
76  const Transform & getVelocityGuess() const {return velocityGuess_;}
77  double previousStamp() const {return previousStamp_;}
78  unsigned int framesProcessed() const {return framesProcessed_;}
79  bool imagesAlreadyRectified() const {return _imagesAlreadyRectified;}
80 
81 protected:
82  const std::map<double, Transform> & imus() const {return imus_;}
83 
84 private:
85  virtual Transform computeTransform(SensorData & data, const Transform & guess = Transform(), OdometryInfo * info = 0) = 0;
86 
87  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);
88  void predictKalmanFilter(float dt, float * vx=0, float * vy=0, float * vz=0, float * vroll=0, float * vpitch=0, float * vyaw=0);
89  void updateKalmanFilter(float & vx, float & vy, float & vz, float & vroll, float & vpitch, float & vyaw);
90 
91 private:
93  bool _force3DoF;
94  bool _holonomic;
113  std::list<std::pair<std::vector<float>, double> > previousVelocities_;
118  unsigned int framesProcessed_;
119 
120  std::vector<ParticleFilter *> particleFilters_;
121  cv::KalmanFilter kalmanFilter_;
123  std::map<double, Transform> imus_;
124 
125 protected:
126  Odometry(const rtabmap::ParametersMap & parameters);
127 };
128 
129 } /* namespace rtabmap */
130 #endif /* ODOMETRY_H_ */
bool _imagesAlreadyRectified
Definition: Odometry.h:109
unsigned int framesProcessed() const
Definition: Odometry.h:78
float _kalmanMeasurementNoise
Definition: Odometry.h:105
Transform velocityGuess_
Definition: Odometry.h:114
cv::KalmanFilter kalmanFilter_
Definition: Odometry.h:121
f
bool isInfoDataFilled() const
Definition: Odometry.h:74
bool imagesAlreadyRectified() const
Definition: Odometry.h:79
float _particleLambdaR
Definition: Odometry.h:102
unsigned int framesProcessed_
Definition: Odometry.h:118
static Transform getIdentity()
Definition: Transform.cpp:380
double previousStamp_
Definition: Odometry.h:112
std::map< std::string, std::string > ParametersMap
Definition: Parameters.h:43
float _kalmanProcessNoise
Definition: Odometry.h:104
const Transform & getPose() const
Definition: Odometry.h:73
double previousStamp() const
Definition: Odometry.h:77
virtual bool canProcessRawImages() const
Definition: Odometry.h:69
float guessSmoothingDelay_
Definition: Odometry.h:96
int _filteringStrategy
Definition: Odometry.h:97
int _resetCurrentCount
Definition: Odometry.h:111
float distanceTravelled_
Definition: Odometry.h:117
StereoCameraModel stereoModel_
Definition: Odometry.h:122
#define RTABMAP_EXP
Definition: RtabmapExp.h:38
bool guessFromMotion_
Definition: Odometry.h:95
Transform previousGroundTruthPose_
Definition: Odometry.h:116
bool _publishRAMUsage
Definition: Odometry.h:108
std::vector< ParticleFilter * > particleFilters_
Definition: Odometry.h:120
const Transform & getVelocityGuess() const
Definition: Odometry.h:76
Transform _pose
Definition: Odometry.h:110
float _particleNoiseR
Definition: Odometry.h:101
virtual bool canProcessIMU() const
Definition: Odometry.h:70
RTABMAP_DEPRECATED(typedef SensorData Image,"rtabmap::Image class is renamed to rtabmap::SensorData, use the last one instead.")
const std::map< double, Transform > & imus() const
Definition: Odometry.h:82
Transform imuLastTransform_
Definition: Odometry.h:115
std::map< double, Transform > imus_
Definition: Odometry.h:123
float _particleNoiseT
Definition: Odometry.h:99
std::list< std::pair< std::vector< float >, double > > previousVelocities_
Definition: Odometry.h:113
bool _alignWithGround
Definition: Odometry.h:107
float _particleLambdaT
Definition: Odometry.h:100


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:34:59