-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathprivateType.h
More file actions
85 lines (67 loc) · 1.69 KB
/
privateType.h
File metadata and controls
85 lines (67 loc) · 1.69 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#pragma once
#include <Eigen/Geometry>
#include <gtl/phmap.hpp>
#include <kdtree.h>
#include <ppf.h>
#include <xsimd/xsimd.hpp>
namespace ppf {
using vectorF = std::vector<float, xsimd::aligned_allocator<float>>;
using vectorI = std::vector<uint32_t, xsimd::aligned_allocator<uint32_t>>;
/*struct Feature {
public:
int refInd;
float alphaAngle;
float voteValue;
Feature()
: refInd(0)
, alphaAngle(0) {
}
Feature(int refInd_, float alphaAngle_)
: refInd(refInd_)
, alphaAngle(alphaAngle_) {
}
};*/
struct Feature {
public:
vectorI refInd;
vectorF alphaAngle;
void push_back(uint32_t index, float angle) {
refInd.push_back(index);
alphaAngle.push_back(angle);
}
// Feature &operator=(Feature &&rhs) noexcept;
};
struct Candidate {
public:
Candidate(float vote_, int refId_, int angleId_)
: vote(vote_)
, refId(refId_)
, angleId(angleId_) {
}
float vote = 0;
int refId;
int angleId;
};
struct Detector::IMPL {
public:
// model
float samplingDistanceRel;
TrainParam param;
PointCloud sampledModel;
PointCloud reSampledModel;
gtl::flat_hash_map<uint32_t, Feature> hashTable;
};
struct Pose {
public:
Eigen::Matrix4f pose;
Eigen::AngleAxisf r;
Eigen::Quaternionf q;
float numVotes;
explicit Pose(float votes);
void updatePose(const Eigen::Matrix4f &newPose);
void updatePoseT(const Eigen::Vector3f &t);
void updatePoseQuat(const Eigen::Quaternionf &q);
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
using KDTree = KDTreeVectorOfVectorsAdaptor<std::vector<Eigen::Vector3f>, float>;
} // namespace ppf