Skip to content

Commit

Permalink
creating 18 point example
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushbaid committed Jun 8, 2021
1 parent b3601ef commit 4fbd98d
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 0 deletions.
25 changes: 25 additions & 0 deletions examples/CreateSFMExampleData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,36 @@ void create5PointExample2() {
createExampleBALFile(filename, P, pose1, pose2,K);
}


/* ************************************************************************* */

void create18PointExample1() {

// Create two cameras poses
Rot3 aRb = Rot3::Yaw(M_PI_2);
Point3 aTb(0.1, 0, 0);
Pose3 pose1, pose2(aRb, aTb);

// Create test data, we need 15 points
vector<Point3> P;
P += Point3(-0.1, -0.5, 1), Point3(-0.1, 0, 1), Point3(-0.1, 0.5, 1),
Point3(0, -0.5, 1), Point3(0, 0, 1), Point3(0, 0.5, 1),
Point3(0.1, -0.5, 1), Point3(0.1, 0, 1), Point3(0.1, 0.5, 1),
Point3(-0.1, -0.5, 0.5), Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5),
Point3(0, -0.5, 0.5), Point3(0, 0, 0.5), Point3(0, 0.5, 0.5),
Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5);

// Assumes example is run in ${GTSAM_TOP}/build/examples
const string filename = "../../examples/data/18pointExample1.txt";
createExampleBALFile(filename, P, pose1, pose2);
}

/* ************************************************************************* */

int main(int argc, char* argv[]) {
create5PointExample1();
create5PointExample2();
create18PointExample1();
return 0;
}

Expand Down
131 changes: 131 additions & 0 deletions examples/data/18pointExample1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
2 18 36

0 0 -0.10000000000000000555 0.5
1 0 -0.5 -0.19999999999999998335
0 1 -0.10000000000000000555 -0
1 1 -1.2246467991473532688e-17 -0.2000000000000000111
0 2 -0.10000000000000000555 -0.5
1 2 0.5 -0.20000000000000003886
0 3 0 0.5
1 3 -0.5 -0.099999999999999977796
0 4 0 -0
1 4 -6.123233995736766344e-18 -0.10000000000000000555
0 5 0 -0.5
1 5 0.5 -0.10000000000000003331
0 6 0.10000000000000000555 0.5
1 6 -0.5 3.0616169978683830179e-17
0 7 0.10000000000000000555 -0
1 7 0 -0
0 8 0.10000000000000000555 -0.5
1 8 0.5 -3.0616169978683830179e-17
0 9 -0.2000000000000000111 1
1 9 -1 -0.39999999999999996669
0 10 -0.2000000000000000111 -0
1 10 -2.4492935982947065376e-17 -0.4000000000000000222
0 11 -0.2000000000000000111 -1
1 11 1 -0.40000000000000007772
0 12 0 1
1 12 -1 -0.19999999999999995559
0 13 0 -0
1 13 -1.2246467991473532688e-17 -0.2000000000000000111
0 14 0 -1
1 14 1 -0.20000000000000006661
0 15 0.2000000000000000111 1
1 15 -1 6.1232339957367660359e-17
0 16 0.2000000000000000111 -0
1 16 0 -0
0 17 0.2000000000000000111 -1
1 17 1 -6.1232339957367660359e-17

3.141592653589793116
0
0
-0
0
0
1
0
0

2.2214414690791830509
2.2214414690791826068
0
-6.123233995736766344e-18
-0.10000000000000000555
0
1
0
0

-0.10000000000000000555
-0.5
1

-0.10000000000000000555
0
1

-0.10000000000000000555
0.5
1

0
-0.5
1

0
0
1

0
0.5
1

0.10000000000000000555
-0.5
1

0.10000000000000000555
0
1

0.10000000000000000555
0.5
1

-0.10000000000000000555
-0.5
0.5

-0.10000000000000000555
0
0.5

-0.10000000000000000555
0.5
0.5

0
-0.5
0.5

0
0
0.5

0
0.5
0.5

0.10000000000000000555
-0.5
0.5

0.10000000000000000555
0
0.5

0.10000000000000000555
0.5
0.5

0 comments on commit 4fbd98d

Please sign in to comment.