diff --git a/gtsam/geometry/SO3.cpp b/gtsam/geometry/SO3.cpp index cd321b126..a509bcf74 100644 --- a/gtsam/geometry/SO3.cpp +++ b/gtsam/geometry/SO3.cpp @@ -136,7 +136,7 @@ SO3 SO3::AxisAngle(const Vector3& axis, double theta) { /* ************************************************************************* */ SO3 SO3::ClosestTo(const Matrix3& M) { - Eigen::JacobiSVD svd(M, Eigen::ComputeThinU | Eigen::ComputeThinV); + Eigen::JacobiSVD svd(M, Eigen::ComputeFullU | Eigen::ComputeFullV); const auto& U = svd.matrixU(); const auto& V = svd.matrixV(); const double det = (U * V.transpose()).determinant(); diff --git a/gtsam/geometry/SOn.h b/gtsam/geometry/SOn.h index bc6282fe4..1b5228be0 100644 --- a/gtsam/geometry/SOn.h +++ b/gtsam/geometry/SOn.h @@ -75,12 +75,13 @@ class SOnBase { Matrix G(n2, d); for (size_t j = 0; j < d; j++) { // TODO(frank): this can't be right. Think about fixed vs dynamic. - G.col(j) << Derived::Hat(n, Eigen::VectorXd::Unit(d, j)); + const auto X = derived().Hat(n, Eigen::VectorXd::Unit(d, j)); + G.col(j) = Eigen::Map(X.data(), n2, 1); } // Vectorize Vector X(n2); - X << derived(); + X << Eigen::Map(derived().data(), n2, 1); // If requested, calculate H as (I \oplus Q) * P if (H) {