ekf_slam.h
Go to the documentation of this file.
1 #ifndef EKF_SLAM_H
2 #define EKF_SLAM_H
3 
6 #include "tuw_marker_slam/EKFSLAMConfig.h"
7 
8 namespace tuw {
9 
10 class EKFSLAM;
11 typedef std::shared_ptr< EKFSLAM > EKFSLAMPtr;
12 typedef std::shared_ptr< EKFSLAM const> EKFSLAMConstPtr;
13 
17 class EKFSLAM : public SLAMTechnique {
18 public:
24  EKFSLAM( const std::vector<double> beta );
25 
35  void cycle ( std::vector<Pose2D> &yt, cv::Mat_<double> &C_Yt, const Command &ut, const MeasurementConstPtr &zt );
36 
42  void setConfig ( const void *config );
43 private:
48  ID = 0,
51  };
52 
56  enum UpdateMode {
57  None = 0,
58  Single = 1,
59  Combined = 2,
60  };
61 
65  struct CorrData {
66  std::pair<size_t, size_t> ij;
67  cv::Matx<double, 3, 3> Q;
68  cv::Vec<double, 3> v;
69  cv::Matx<double, 3, 3> dx;
70  cv::Matx<double, 3, 3> dm;
71  cv::Matx<double, 3, 3> S_inv;
72  };
73  typedef std::shared_ptr< CorrData > CorrDataPtr;
74  typedef std::shared_ptr< CorrData const > CorrDataConstPtr;
75 
79  void init();
80 
85  void prediction ( const Command &ut );
86 
93 
105  void NNSF_local ( const MeasurementMarkerConstPtr &zt, const double gamma );
106 
115  void NNSF_global ( const MeasurementMarkerConstPtr &zt, const double gamma );
116 
123  void measurement ( const MeasurementMarkerConstPtr &zt, const CorrDataPtr &corr );
124 
131  cv::Matx<double, 3, 3> measurement_noise ( const MeasurementMarker::Marker zi );
132 
138  void update();
139 
143  void update_single();
144 
148  void update_combined();
149 
153  void integration ( const MeasurementMarkerConstPtr &zt );
154 
155  tuw_marker_slam::EKFSLAMConfig config_;
156  const std::vector<double> beta_;
157 
158  cv::Mat_<double> y;
159  cv::Mat_<double> x;
160  cv::Mat_<double> C_Y;
161  cv::Mat_<double> C_X;
162 
163  std::map<int, size_t> f_kj;
164 
165  std::vector<CorrDataPtr> c_ij;
166  std::vector<CorrDataPtr> c_ji;
167 
168  std::vector<size_t> z_known;
169  std::vector<size_t> z_new;
170 };
171 };
172 
173 #endif // EKF_SLAM_H
cv::Mat_< double > C_Y
mean vector of x
Definition: ekf_slam.h:160
cv::Mat_< double > C_X
covariance matrix of y = (x m1 m2 ...)
Definition: ekf_slam.h:161
void cycle(std::vector< Pose2D > &yt, cv::Mat_< double > &C_Yt, const Command &ut, const MeasurementConstPtr &zt)
Definition: ekf_slam.cpp:29
std::vector< size_t > z_known
landmark to measurement correspondences (ignore j = 0 since landmark numbering starts with 1) ...
Definition: ekf_slam.h:168
cv::Matx< double, 3, 3 > measurement_noise(const MeasurementMarker::Marker zi)
Definition: ekf_slam.cpp:399
cv::Matx< double, 3, 3 > Q
i >= 0, j > 0...landmark j corressponds to measurement i (else no correspondence) ...
Definition: ekf_slam.h:67
void NNSF_local(const MeasurementMarkerConstPtr &zt, const double gamma)
Definition: ekf_slam.cpp:181
DataAssociationMode
Definition: ekf_slam.h:47
void update()
Definition: ekf_slam.cpp:413
std::vector< CorrDataPtr > c_ij
correspondences: f[k] = j <-> marker k corressponds to landmark j
Definition: ekf_slam.h:165
cv::Vec< double, 3 > v
measurement noise
Definition: ekf_slam.h:68
cv::Matx< double, 3, 3 > S_inv
m deviation in H_ij = (dx 0 .. 0 dm 0 .. 0)
Definition: ekf_slam.h:71
std::shared_ptr< CorrData const > CorrDataConstPtr
Definition: ekf_slam.h:74
void data_association(const MeasurementMarkerConstPtr &zt)
Definition: ekf_slam.cpp:124
std::vector< CorrDataPtr > c_ji
measurement to landmark correspondences
Definition: ekf_slam.h:166
std::shared_ptr< CorrData > CorrDataPtr
Definition: ekf_slam.h:73
EKFSLAM(const std::vector< double > beta)
Definition: ekf_slam.cpp:7
void prediction(const Command &ut)
Definition: ekf_slam.cpp:61
const std::vector< double > beta_
parameters
Definition: ekf_slam.h:156
std::shared_ptr< EKFSLAM const > EKFSLAMConstPtr
Definition: ekf_slam.h:12
void update_single()
Definition: ekf_slam.cpp:429
Definition: ekf_slam.h:8
void update_combined()
Definition: ekf_slam.cpp:482
cv::Mat_< double > x
mean vector of y = (x m1 m2 ...)
Definition: ekf_slam.h:159
std::pair< size_t, size_t > ij
Definition: ekf_slam.h:66
void NNSF_global(const MeasurementMarkerConstPtr &zt, const double gamma)
Definition: ekf_slam.cpp:259
std::shared_ptr< MeasurementMarker const > MeasurementMarkerConstPtr
tuw_marker_slam::EKFSLAMConfig config_
Definition: ekf_slam.h:155
cv::Matx< double, 3, 3 > dm
x deviation in H_ij = (dx 0 .. 0 dm 0 .. 0)
Definition: ekf_slam.h:70
void init()
Definition: ekf_slam.cpp:12
void integration(const MeasurementMarkerConstPtr &zt)
Definition: ekf_slam.cpp:530
void setConfig(const void *config)
Definition: ekf_slam.cpp:57
std::map< int, size_t > f_kj
covariance matrix of x
Definition: ekf_slam.h:163
void measurement(const MeasurementMarkerConstPtr &zt, const CorrDataPtr &corr)
Definition: ekf_slam.cpp:334
cv::Mat_< double > y
parameters for the implemented measurement noise model
Definition: ekf_slam.h:158
std::vector< size_t > z_new
measurements corresponding to known landmarks
Definition: ekf_slam.h:169
std::shared_ptr< EKFSLAM > EKFSLAMPtr
Definition: ekf_slam.h:10
cv::Matx< double, 3, 3 > dx
difference of obtained and predicted measurement
Definition: ekf_slam.h:69


tuw_marker_slam
Author(s): Markus Macsek
autogenerated on Mon Jun 10 2019 15:39:09