diff --git a/.cproject b/.cproject index bcf690995..d081a750a 100644 --- a/.cproject +++ b/.cproject @@ -542,6 +542,14 @@ true true + + make + -j4 + testSimilarity3.run + true + true + true + make -j2 @@ -592,7 +600,6 @@ make - tests/testBayesTree.run true false @@ -600,7 +607,6 @@ make - testBinaryBayesNet.run true false @@ -648,7 +654,6 @@ make - testSymbolicBayesNet.run true false @@ -656,7 +661,6 @@ make - tests/testSymbolicFactor.run true false @@ -664,7 +668,6 @@ make - testSymbolicFactorGraph.run true false @@ -680,7 +683,6 @@ make - tests/testBayesTree true false @@ -1128,7 +1130,6 @@ make - testErrors.run true false @@ -1358,46 +1359,6 @@ true true - - make - -j5 - testBTree.run - true - true - true - - - make - -j5 - testDSF.run - true - true - true - - - make - -j5 - testDSFMap.run - true - true - true - - - make - -j5 - testDSFVector.run - true - true - true - - - make - -j5 - testFixedVector.run - true - true - true - make -j2 @@ -1480,6 +1441,7 @@ make + testSimulated2DOriented.run true false @@ -1519,6 +1481,7 @@ make + testSimulated2D.run true false @@ -1526,6 +1489,7 @@ make + testSimulated3D.run true false @@ -1539,6 +1503,46 @@ true true + + make + -j5 + testBTree.run + true + true + true + + + make + -j5 + testDSF.run + true + true + true + + + make + -j5 + testDSFMap.run + true + true + true + + + make + -j5 + testDSFVector.run + true + true + true + + + make + -j5 + testFixedVector.run + true + true + true + make -j5 @@ -1796,7 +1800,6 @@ cpack - -G DEB true false @@ -1804,7 +1807,6 @@ cpack - -G RPM true false @@ -1812,7 +1814,6 @@ cpack - -G TGZ true false @@ -1820,7 +1821,6 @@ cpack - --config CPackSourceConfig.cmake true false @@ -2675,7 +2675,6 @@ make - testGraph.run true false @@ -2683,7 +2682,6 @@ make - testJunctionTree.run true false @@ -2691,7 +2689,6 @@ make - testSymbolicBayesNetB.run true false @@ -3235,6 +3232,7 @@ make + tests/testGaussianISAM2 true false diff --git a/gtsam/geometry/Rot3.h b/gtsam/geometry/Rot3.h index ef2d19750..80ecd6d81 100644 --- a/gtsam/geometry/Rot3.h +++ b/gtsam/geometry/Rot3.h @@ -93,9 +93,6 @@ namespace gtsam { /** constructor from a rotation matrix */ Rot3(const Matrix3& R); - /** constructor from a rotation matrix */ - Rot3(const Matrix& R); - /** Constructor from a quaternion. This can also be called using a plain * Vector, due to implicit conversion from Vector to Quaternion * @param q The quaternion diff --git a/gtsam/geometry/Rot3M.cpp b/gtsam/geometry/Rot3M.cpp index d0c7e95f3..2c446c6d7 100644 --- a/gtsam/geometry/Rot3M.cpp +++ b/gtsam/geometry/Rot3M.cpp @@ -56,13 +56,6 @@ Rot3::Rot3(const Matrix3& R) { rot_ = R; } -/* ************************************************************************* */ -Rot3::Rot3(const Matrix& R) { - if (R.rows()!=3 || R.cols()!=3) - throw invalid_argument("Rot3 constructor expects 3*3 matrix"); - rot_ = R; -} - /* ************************************************************************* */ Rot3::Rot3(const Quaternion& q) : rot_(q.toRotationMatrix()) { } diff --git a/gtsam/geometry/Rot3Q.cpp b/gtsam/geometry/Rot3Q.cpp index 19de92ca2..3f21c2a80 100644 --- a/gtsam/geometry/Rot3Q.cpp +++ b/gtsam/geometry/Rot3Q.cpp @@ -52,10 +52,6 @@ namespace gtsam { Rot3::Rot3(const Matrix3& R) : quaternion_(R) {} - /* ************************************************************************* */ - Rot3::Rot3(const Matrix& R) : - quaternion_(Matrix3(R)) {} - /* ************************************************************************* */ Rot3::Rot3(const Quaternion& q) : quaternion_(q) { diff --git a/gtsam_unstable/geometry/tests/testSimilarity3.cpp b/gtsam_unstable/geometry/tests/testSimilarity3.cpp index a71308b7a..7526250af 100644 --- a/gtsam_unstable/geometry/tests/testSimilarity3.cpp +++ b/gtsam_unstable/geometry/tests/testSimilarity3.cpp @@ -24,24 +24,31 @@ namespace gtsam { * 3D similarity transform */ class Similarity3: private Matrix4 { - Similarity3() : - Matrix4::Identity() { - } - - /// Construct pure scaling - Similarity3(double s) : - Matrix4::Identity() { - this->topLeftCorner<3, 3>() = s * Matrix3::Identity(); - } /// Construct from Eigen types Similarity3(const Matrix3& R, const Vector3& t, double s) { *this << s * R, t, 0, 0, 0, 1; } +public: + + Similarity3() { + setIdentity(); + } + + /// Construct pure scaling + Similarity3(double s) { + setIdentity(); + this->topLeftCorner<3, 3>() = s * Matrix3::Identity(); + } + /// Construct from GTSAM types Similarity3(const Rot3& R, const Point3& t, double s) { - *this << s * R.matrix(), t.vector, 0, 0, 0, 1; + *this << s * R.matrix(), t.vector(), 0, 0, 0, 1; + } + + bool operator==(const Similarity3& other) const { + return Matrix4::operator==(other); } /// @name Manifold @@ -61,13 +68,13 @@ class Similarity3: private Matrix4 { Similarity3 retract(const Vector& v) const { // Get rotation - translation - scale from 4*4 - Rot3 R(this->topLeftCorner<3, 3>); - Vector3 t(this->topRightCorner<3, 1>); - double s(this->at(3, 3)); + Rot3 R(this->topLeftCorner<3, 3>()); + Vector3 t(this->topRightCorner<3, 1>()); + double s((*this)(3, 3)); return Similarity3( // R.retract(v.head<3>()), // retract rotation using v[0,1,2] - t + v.vector.segment < 3 > (3), // retract translation via v[3,4,5] + Point3(t + v.segment < 3 > (3)), // retract translation via v[3,4,5] s + v[6]); // finally, update scale using v[6] } @@ -110,8 +117,8 @@ TEST(Similarity3, manifold) { Vector7 v = Vector7::Zero(); v(6) = 2; - Similarity3 sim; - EXPECT(sim.retract(z)==sim); + Similarity3 sim2; + EXPECT(sim2.retract(z)==sim2); // TODO add unit tests for retract and localCoordinates }