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 
31 #include <rtabmap/core/rtabmap_core_export.h>
32 
33 #include <rtabmap/core/Transform.h>
36 
37 namespace rtabmap {
38 
39 class OdometryInfo;
40 class ParticleFilter;
41 
42 class RTABMAP_CORE_EXPORT Odometry
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  // Use getVelocityGuess() instead.
79  RTABMAP_DEPRECATED const Transform & previousVelocityTransform() const;
80  const Transform & getVelocityGuess() const {return velocityGuess_;}
81  double previousStamp() const {return previousStamp_;}
82  unsigned int framesProcessed() const {return framesProcessed_;}
83  bool imagesAlreadyRectified() const {return _imagesAlreadyRectified;}
84 
85 protected:
86  const std::map<double, Transform> & imus() const {return imus_;}
87 
88 private:
89  virtual Transform computeTransform(SensorData & data, const Transform & guess = Transform(), OdometryInfo * info = 0) = 0;
90 
91  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);
92  void predictKalmanFilter(float dt, float * vx=0, float * vy=0, float * vz=0, float * vroll=0, float * vpitch=0, float * vyaw=0);
93  void updateKalmanFilter(float & vx, float & vy, float & vz, float & vroll, float & vpitch, float & vyaw);
94 
95 private:
97  bool _force3DoF;
98  bool _holonomic;
110  unsigned int _imageDecimation;
118  std::list<std::pair<std::vector<float>, double> > previousVelocities_;
123  unsigned int framesProcessed_;
124 
125  std::vector<ParticleFilter *> particleFilters_;
126  cv::KalmanFilter kalmanFilter_;
127  std::vector<StereoCameraModel> stereoModels_;
128  std::vector<CameraModel> models_;
129  std::map<double, Transform> imus_;
130 
131 protected:
132  Odometry(const rtabmap::ParametersMap & parameters);
133 };
134 
135 } /* namespace rtabmap */
136 #endif /* ODOMETRY_H_ */
rtabmap::SensorData
Definition: SensorData.h:51
rtabmap::Odometry::_resetCurrentCount
int _resetCurrentCount
Definition: Odometry.h:116
create
ADT create(const Signature &signature)
rtabmap::Odometry::_particleSize
int _particleSize
Definition: Odometry.h:102
rtabmap::Odometry::guessFromMotion_
bool guessFromMotion_
Definition: Odometry.h:99
rtabmap::Odometry::previousStamp_
double previousStamp_
Definition: Odometry.h:117
rtabmap::Odometry::_publishRAMUsage
bool _publishRAMUsage
Definition: Odometry.h:112
rtabmap::Transform::getIdentity
static Transform getIdentity()
Definition: Transform.cpp:411
rtabmap::RTABMAP_DEPRECATED
RTABMAP_DEPRECATED(typedef SensorData Image, "rtabmap::Image class is renamed to rtabmap::SensorData, use the last one instead.")
SensorData.h
Transform.h
type
rtabmap::Odometry::previousVelocities_
std::list< std::pair< std::vector< float >, double > > previousVelocities_
Definition: Odometry.h:118
rtabmap::Odometry::_particleNoiseR
float _particleNoiseR
Definition: Odometry.h:105
rtabmap::Odometry::framesProcessed_
unsigned int framesProcessed_
Definition: Odometry.h:123
rtabmap::ParametersMap
std::map< std::string, std::string > ParametersMap
Definition: Parameters.h:43
rtabmap::Odometry::previousStamp
double previousStamp() const
Definition: Odometry.h:81
rtabmap::Odometry::velocityGuess_
Transform velocityGuess_
Definition: Odometry.h:119
rtabmap::Odometry::imus_
std::map< double, Transform > imus_
Definition: Odometry.h:129
rtabmap::Odometry::canProcessAsyncIMU
virtual bool canProcessAsyncIMU() const
Definition: Odometry.h:73
Parameters.h
rtabmap::Odometry::getPose
const Transform & getPose() const
Definition: Odometry.h:76
rtabmap::Odometry::imuLastTransform_
Transform imuLastTransform_
Definition: Odometry.h:120
rtabmap::Odometry::previousGroundTruthPose_
Transform previousGroundTruthPose_
Definition: Odometry.h:121
Type
rtabmap::Odometry::stereoModels_
std::vector< StereoCameraModel > stereoModels_
Definition: Odometry.h:127
rtabmap::Odometry::_force3DoF
bool _force3DoF
Definition: Odometry.h:97
rtabmap::Odometry::_holonomic
bool _holonomic
Definition: Odometry.h:98
rtabmap::Odometry::_resetCountdown
int _resetCountdown
Definition: Odometry.h:96
rtabmap::Odometry::getVelocityGuess
const Transform & getVelocityGuess() const
Definition: Odometry.h:80
rtabmap::Odometry::_particleLambdaR
float _particleLambdaR
Definition: Odometry.h:106
rtabmap::Odometry::imus
const std::map< double, Transform > & imus() const
Definition: Odometry.h:86
rtabmap::Odometry::framesProcessed
unsigned int framesProcessed() const
Definition: Odometry.h:82
rtabmap::Odometry::_particleLambdaT
float _particleLambdaT
Definition: Odometry.h:104
rtabmap::Odometry::_kalmanProcessNoise
float _kalmanProcessNoise
Definition: Odometry.h:108
rtabmap::Odometry::particleFilters_
std::vector< ParticleFilter * > particleFilters_
Definition: Odometry.h:125
rtabmap::Transform
Definition: Transform.h:41
rtabmap::Odometry::_deskewing
bool _deskewing
Definition: Odometry.h:114
rtabmap::Odometry::_alignWithGround
bool _alignWithGround
Definition: Odometry.h:111
rtabmap::Odometry::_kalmanMeasurementNoise
float _kalmanMeasurementNoise
Definition: Odometry.h:109
rtabmap::Odometry::distanceTravelled_
float distanceTravelled_
Definition: Odometry.h:122
rtabmap::Odometry::guessSmoothingDelay_
float guessSmoothingDelay_
Definition: Odometry.h:100
rtabmap::Odometry::_fillInfoData
bool _fillInfoData
Definition: Odometry.h:107
rtabmap::Odometry
Definition: Odometry.h:42
rtabmap::OdometryInfo
Definition: OdometryInfo.h:40
rtabmap::Odometry::Type
Type
Definition: Odometry.h:45
rtabmap::Odometry::_particleNoiseT
float _particleNoiseT
Definition: Odometry.h:103
rtabmap::Odometry::models_
std::vector< CameraModel > models_
Definition: Odometry.h:128
rtabmap::Odometry::_imageDecimation
unsigned int _imageDecimation
Definition: Odometry.h:110
rtabmap::Odometry::_pose
Transform _pose
Definition: Odometry.h:115
rtabmap::Odometry::imagesAlreadyRectified
bool imagesAlreadyRectified() const
Definition: Odometry.h:83
rtabmap
Definition: CameraARCore.cpp:35
rtabmap::Odometry::_imagesAlreadyRectified
bool _imagesAlreadyRectified
Definition: Odometry.h:113
rtabmap::Odometry::kalmanFilter_
cv::KalmanFilter kalmanFilter_
Definition: Odometry.h:126
rtabmap::Odometry::isInfoDataFilled
bool isInfoDataFilled() const
Definition: Odometry.h:77
rtabmap::Odometry::_filteringStrategy
int _filteringStrategy
Definition: Odometry.h:101
rtabmap::Odometry::canProcessRawImages
virtual bool canProcessRawImages() const
Definition: Odometry.h:72


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