diff --git a/examples/CreateSFMExampleData.cpp b/examples/CreateSFMExampleData.cpp index 15c009036..3a1e905e8 100644 --- a/examples/CreateSFMExampleData.cpp +++ b/examples/CreateSFMExampleData.cpp @@ -26,7 +26,7 @@ using namespace gtsam; /* ************************************************************************* */ -void createExampleBALFile(const string& filename, const vector& P, +void createExampleBALFile(const string& filename, const vector& points, const Pose3& pose1, const Pose3& pose2, const Cal3Bundler& K = Cal3Bundler()) { // Class that will gather all data @@ -35,7 +35,7 @@ void createExampleBALFile(const string& filename, const vector& P, data.cameras.push_back(SfmCamera(pose1, K)); data.cameras.push_back(SfmCamera(pose2, K)); - for (const Point3& p : P) { + for (const Point3& p : points) { // Create the track SfmTrack track; track.p = p; @@ -63,13 +63,12 @@ void create5PointExample1() { Pose3 pose1, pose2(aRb, aTb); // Create test data, we need at least 5 points - vector P; - P += Point3(0, 0, 1), Point3(-0.1, 0, 1), Point3(0.1, 0, 1), // - Point3(0, 0.5, 0.5), Point3(0, -0.5, 0.5); + vector points = {{0, 0, 1}, {-0.1, 0, 1}, {0.1, 0, 1}, // + {0, 0.5, 0.5}, {0, -0.5, 0.5}}; // Assumes example is run in ${GTSAM_TOP}/build/examples const string filename = "../../examples/Data/5pointExample1.txt"; - createExampleBALFile(filename, P, pose1, pose2); + createExampleBALFile(filename, points, pose1, pose2); } /* ************************************************************************* */ @@ -81,15 +80,14 @@ void create5PointExample2() { Pose3 pose1, pose2(aRb, aTb); // Create test data, we need at least 5 points - vector P; - P += Point3(0, 0, 100), Point3(-10, 0, 100), Point3(10, 0, 100), // - Point3(0, 50, 50), Point3(0, -50, 50), Point3(-20, 0, 80), - Point3(20, -50, 80); + vector points = {{0, 0, 100}, {-10, 0, 100}, {10, 0, 100}, // + {0, 50, 50}, {0, -50, 50}, {-20, 0, 80}, + {20, -50, 80}}; // Assumes example is run in ${GTSAM_TOP}/build/examples const string filename = "../../examples/Data/5pointExample2.txt"; Cal3Bundler K(500, 0, 0); - createExampleBALFile(filename, P, pose1, pose2, K); + createExampleBALFile(filename, points, pose1, pose2, K); } /* ************************************************************************* */ @@ -101,17 +99,16 @@ void create18PointExample1() { Pose3 pose1, pose2(aRb, aTb); // Create test data, we need 15 points - vector P; - P += Point3(0, 0, 1), Point3(-0.1, 0, 1), Point3(0.1, 0, 1), // - Point3(0, 0.5, 0.5), Point3(0, -0.5, 0.5), Point3(-1, -0.5, 2), // - Point3(-1, 0.5, 2), Point3(0.25, -0.5, 1.5), Point3(0.25, 0.5, 1.5), // - Point3(-0.1, -0.5, 0.5), Point3(0.1, -0.5, 1), Point3(0.1, 0.5, 1), // - Point3(-0.1, 0, 0.5), Point3(-0.1, 0.5, 0.5), Point3(0, 0, 0.5), // - Point3(0.1, -0.5, 0.5), Point3(0.1, 0, 0.5), Point3(0.1, 0.5, 0.5); + vector points = {{0, 0, 1}, {-0.1, 0, 1}, {0.1, 0, 1}, // + {0, 0.5, 0.5}, {0, -0.5, 0.5}, {-1, -0.5, 2}, // + {-1, 0.5, 2}, {0.25, -0.5, 1.5}, {0.25, 0.5, 1.5}, // + {-0.1, -0.5, 0.5}, {0.1, -0.5, 1}, {0.1, 0.5, 1}, // + {-0.1, 0, 0.5}, {-0.1, 0.5, 0.5}, {0, 0, 0.5}, // + {0.1, -0.5, 0.5}, {0.1, 0, 0.5}, {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); + createExampleBALFile(filename, points, pose1, pose2); } int main(int argc, char* argv[]) { diff --git a/gtsam/slam/EssentialMatrixFactor.h b/gtsam/slam/EssentialMatrixFactor.h index 62d7531d9..787efac51 100644 --- a/gtsam/slam/EssentialMatrixFactor.h +++ b/gtsam/slam/EssentialMatrixFactor.h @@ -315,7 +315,7 @@ class EssentialMatrixFactor4 typedef NoiseModelFactor2 Base; typedef EssentialMatrixFactor4 This; - static const int DimK = FixedDimension::value; + static constexpr int DimK = FixedDimension::value; typedef Eigen::Matrix JacobianCalibration; public: