forked from zhixy/SolveAXXB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
42 lines (32 loc) · 756 Bytes
/
main.cpp
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
#include<iostream>
#include"conventionalaxxbsvdsolver.h"
int main(int argc, char** argv) {
google::InitGoogleLogging(argv[0]);
// Pose
Pose a, b, x;
a << 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1;
b << 1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1;
std::cout << "A = " << std::endl;
std::cout << a << std::endl;
std::cout << "B = " << std::endl;
std::cout << b << std::endl;
// Poses
Poses vec_a, vec_b;
vec_a.push_back(a);
vec_a.push_back(a);
vec_b.push_back(b);
vec_b.push_back(b);
// Solver
ConventionalAXXBSVDSolver solver(vec_a, vec_b);
x = solver.SolveX();
// Show result
std::cout << "X = " << std::endl;
std::cout << x << std::endl;
return 0;
}