Skip to content

Commit 4fbd98d

Browse files
committed
creating 18 point example
1 parent b3601ef commit 4fbd98d

File tree

2 files changed

+156
-0
lines changed

2 files changed

+156
-0
lines changed

examples/CreateSFMExampleData.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,36 @@ void create5PointExample2() {
9999
createExampleBALFile(filename, P, pose1, pose2,K);
100100
}
101101

102+
103+
/* ************************************************************************* */
104+
105+
void create18PointExample1() {
106+
107+
// Create two cameras poses
108+
Rot3 aRb = Rot3::Yaw(M_PI_2);
109+
Point3 aTb(0.1, 0, 0);
110+
Pose3 pose1, pose2(aRb, aTb);
111+
112+
// Create test data, we need 15 points
113+
vector<Point3> P;
114+
P += Point3(-0.1, -0.5, 1), Point3(-0.1, 0, 1), Point3(-0.1, 0.5, 1),
115+
Point3(0, -0.5, 1), Point3(0, 0, 1), Point3(0, 0.5, 1),
116+
Point3(0.1, -0.5, 1), Point3(0.1, 0, 1), Point3(0.1, 0.5, 1),
117+
Point3(-0.1, -0.5, 0.5), Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5),
118+
Point3(0, -0.5, 0.5), Point3(0, 0, 0.5), Point3(0, 0.5, 0.5),
119+
Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5);
120+
121+
// Assumes example is run in ${GTSAM_TOP}/build/examples
122+
const string filename = "../../examples/data/18pointExample1.txt";
123+
createExampleBALFile(filename, P, pose1, pose2);
124+
}
125+
102126
/* ************************************************************************* */
103127

104128
int main(int argc, char* argv[]) {
105129
create5PointExample1();
106130
create5PointExample2();
131+
create18PointExample1();
107132
return 0;
108133
}
109134

examples/data/18pointExample1.txt

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
2 18 36
2+
3+
0 0 -0.10000000000000000555 0.5
4+
1 0 -0.5 -0.19999999999999998335
5+
0 1 -0.10000000000000000555 -0
6+
1 1 -1.2246467991473532688e-17 -0.2000000000000000111
7+
0 2 -0.10000000000000000555 -0.5
8+
1 2 0.5 -0.20000000000000003886
9+
0 3 0 0.5
10+
1 3 -0.5 -0.099999999999999977796
11+
0 4 0 -0
12+
1 4 -6.123233995736766344e-18 -0.10000000000000000555
13+
0 5 0 -0.5
14+
1 5 0.5 -0.10000000000000003331
15+
0 6 0.10000000000000000555 0.5
16+
1 6 -0.5 3.0616169978683830179e-17
17+
0 7 0.10000000000000000555 -0
18+
1 7 0 -0
19+
0 8 0.10000000000000000555 -0.5
20+
1 8 0.5 -3.0616169978683830179e-17
21+
0 9 -0.2000000000000000111 1
22+
1 9 -1 -0.39999999999999996669
23+
0 10 -0.2000000000000000111 -0
24+
1 10 -2.4492935982947065376e-17 -0.4000000000000000222
25+
0 11 -0.2000000000000000111 -1
26+
1 11 1 -0.40000000000000007772
27+
0 12 0 1
28+
1 12 -1 -0.19999999999999995559
29+
0 13 0 -0
30+
1 13 -1.2246467991473532688e-17 -0.2000000000000000111
31+
0 14 0 -1
32+
1 14 1 -0.20000000000000006661
33+
0 15 0.2000000000000000111 1
34+
1 15 -1 6.1232339957367660359e-17
35+
0 16 0.2000000000000000111 -0
36+
1 16 0 -0
37+
0 17 0.2000000000000000111 -1
38+
1 17 1 -6.1232339957367660359e-17
39+
40+
3.141592653589793116
41+
0
42+
0
43+
-0
44+
0
45+
0
46+
1
47+
0
48+
0
49+
50+
2.2214414690791830509
51+
2.2214414690791826068
52+
0
53+
-6.123233995736766344e-18
54+
-0.10000000000000000555
55+
0
56+
1
57+
0
58+
0
59+
60+
-0.10000000000000000555
61+
-0.5
62+
1
63+
64+
-0.10000000000000000555
65+
0
66+
1
67+
68+
-0.10000000000000000555
69+
0.5
70+
1
71+
72+
0
73+
-0.5
74+
1
75+
76+
0
77+
0
78+
1
79+
80+
0
81+
0.5
82+
1
83+
84+
0.10000000000000000555
85+
-0.5
86+
1
87+
88+
0.10000000000000000555
89+
0
90+
1
91+
92+
0.10000000000000000555
93+
0.5
94+
1
95+
96+
-0.10000000000000000555
97+
-0.5
98+
0.5
99+
100+
-0.10000000000000000555
101+
0
102+
0.5
103+
104+
-0.10000000000000000555
105+
0.5
106+
0.5
107+
108+
0
109+
-0.5
110+
0.5
111+
112+
0
113+
0
114+
0.5
115+
116+
0
117+
0.5
118+
0.5
119+
120+
0.10000000000000000555
121+
-0.5
122+
0.5
123+
124+
0.10000000000000000555
125+
0
126+
0.5
127+
128+
0.10000000000000000555
129+
0.5
130+
0.5
131+

0 commit comments

Comments
 (0)