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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:37:29