adding 11 point example for cal3bundler

release/4.3a0
Ayush Baid 2021-06-10 14:47:43 -07:00
parent 91e58f5016
commit bce9050672
1 changed files with 28 additions and 6 deletions

View File

@ -111,24 +111,46 @@ void create18PointExample1() {
// 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);
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);
}
/* ************************************************************************* */
void create11PointExample2() {
// Create two cameras poses
Rot3 aRb = Rot3::Yaw(M_PI_2);
Point3 aTb(10, 0, 0);
Pose3 pose1, pose2(aRb, aTb);
// Create test data, we need 11 points
vector<Point3> P;
P += Point3(0, 0, 100), Point3(0, 0, 100), Point3(0, 0, 100), //
Point3(-10, 0, 100), Point3(10, 0, 100), //
Point3(0, 50, 50), Point3(0, -50, 50), //
Point3(-10, 50, 50), Point3(10, -50, 50), //
Point3(-20, 0, 80), Point3(20, -50, 80);
// Assumes example is run in ${GTSAM_TOP}/build/examples
const string filename = "../../examples/data/11pointExample2.txt";
Cal3Bundler K(500, 0, 0);
createExampleBALFile(filename, P, pose1, pose2, K);
}
/* ************************************************************************* */
int main(int argc, char* argv[]) {
create5PointExample1();
create5PointExample2();
create18PointExample1();
create11PointExample2();
return 0;
}