diff --git a/examples/CreateSFMExampleData.cpp b/examples/CreateSFMExampleData.cpp index 650b3c731..3f46ae8b4 100644 --- a/examples/CreateSFMExampleData.cpp +++ b/examples/CreateSFMExampleData.cpp @@ -111,24 +111,46 @@ void create18PointExample1() { // Create test data, we need 15 points vector 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 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; }