forked from mp3guy/ICPCUDA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ICPOdometry.h
64 lines (44 loc) · 1.43 KB
/
ICPOdometry.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
* ICPOdometry.h
*
* Created on: 17 Sep 2012
* Author: thomas
*/
#ifndef ICPODOMETRY_H_
#define ICPODOMETRY_H_
#include "Cuda/internal.h"
#include <sophus/se3.hpp>
#include <vector>
#include <Eigen/Core>
#include <Eigen/Geometry>
class ICPOdometry {
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
ICPOdometry(int width, int height, float cx, float cy, float fx, float fy,
float distThresh = 0.10f,
float angleThresh = sinf(20.f * 3.14159254f / 180.f));
virtual ~ICPOdometry();
void initICP(unsigned short *depth, const float depthCutoff = 20.0f);
void initICPModel(unsigned short *depth, const float depthCutoff = 20.0f);
void getIncrementalTransformation(Sophus::SE3d &T_prev_curr, int threads,
int blocks);
float lastError;
float lastInliers;
private:
std::vector<DeviceArray2D<unsigned short>> depth_tmp;
std::vector<DeviceArray2D<float>> vmaps_prev;
std::vector<DeviceArray2D<float>> nmaps_prev;
std::vector<DeviceArray2D<float>> vmaps_curr;
std::vector<DeviceArray2D<float>> nmaps_curr;
Intr intr;
DeviceArray<Eigen::Matrix<float, 29, 1, Eigen::DontAlign>> sumData;
DeviceArray<Eigen::Matrix<float, 29, 1, Eigen::DontAlign>> outData;
static const int NUM_PYRS = 3;
std::vector<int> iterations;
float dist_thresh;
float angle_thresh;
const int width;
const int height;
const float cx, cy, fx, fy;
};
#endif /* ICPODOMETRY_H_ */