From 276514f8ecdbb194f7fc982a7ca12f3b4e9a4b24 Mon Sep 17 00:00:00 2001 From: Kalana Ratnayake Date: Thu, 23 May 2024 15:56:18 +1000 Subject: [PATCH] fixed build error based on https://github.com/stonier/sophus/pull/23 --- sophus/common.hpp | 10 +++++----- sophus/se2.hpp | 4 ++-- sophus/se3.hpp | 4 ++-- sophus/so2.hpp | 4 ++-- sophus/so3.hpp | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sophus/common.hpp b/sophus/common.hpp index 9e87ee600..5319a980a 100644 --- a/sophus/common.hpp +++ b/sophus/common.hpp @@ -203,22 +203,22 @@ class optional { explicit operator bool() const { return is_valid_; } T const* operator->() const { - SOPHUS_ENSURE(is_valid_, "must be valid"); + SOPHUS_ENSURE(is_valid_, "%s", "must be valid"); return &type_; } T* operator->() { - SOPHUS_ENSURE(is_valid_, "must be valid"); + SOPHUS_ENSURE(is_valid_, "%s", "must be valid"); return &type_; } T const& operator*() const { - SOPHUS_ENSURE(is_valid_, "must be valid"); + SOPHUS_ENSURE(is_valid_, "%s", "must be valid"); return type_; } T& operator*() { - SOPHUS_ENSURE(is_valid_, "must be valid"); + SOPHUS_ENSURE(is_valid_, "%s", "must be valid"); return type_; } @@ -236,4 +236,4 @@ struct IsUniformRandomBitGenerator { std::is_unsigned::value && std::is_unsigned::value; }; -} // namespace Sophus +} // namespace Sophus \ No newline at end of file diff --git a/sophus/se2.hpp b/sophus/se2.hpp index d3968005b..6342c4633 100644 --- a/sophus/se2.hpp +++ b/sophus/se2.hpp @@ -630,7 +630,7 @@ class SE2 : public SE2Base> { /// Precondition: ``i`` must be in 0, 1 or 2. /// SOPHUS_FUNC static Transformation generator(int i) { - SOPHUS_ENSURE(i >= 0 || i <= 2, "i should be in range [0,2]."); + SOPHUS_ENSURE(i >= 0 || i <= 2, "%s", "i should be in range [0,2]."); Tangent e; e.setZero(); e[i] = Scalar(1); @@ -852,4 +852,4 @@ class Map const, Options> Map const, Options> const so2_; Map const, Options> const translation_; }; -} // namespace Eigen +} // namespace Eigen \ No newline at end of file diff --git a/sophus/se3.hpp b/sophus/se3.hpp index 414bbafd8..6c92d1263 100644 --- a/sophus/se3.hpp +++ b/sophus/se3.hpp @@ -881,7 +881,7 @@ class SE3 : public SE3Base> { /// Precondition: ``i`` must be in [0, 5]. /// SOPHUS_FUNC static Transformation generator(int i) { - SOPHUS_ENSURE(i >= 0 && i <= 5, "i should be in range [0,5]."); + SOPHUS_ENSURE(i >= 0 && i <= 5, "%s", "i should be in range [0,5]."); Tangent e; e.setZero(); e[i] = Scalar(1); @@ -1123,4 +1123,4 @@ class Map const, Options> Map const, Options> const so3_; Map const, Options> const translation_; }; -} // namespace Eigen +} // namespace Eigen \ No newline at end of file diff --git a/sophus/so2.hpp b/sophus/so2.hpp index f296c1fbd..b963ccc15 100644 --- a/sophus/so2.hpp +++ b/sophus/so2.hpp @@ -172,7 +172,7 @@ class SO2Base { using std::hypot; // Avoid under/overflows for higher precision Scalar length = hypot(unit_complex().x(), unit_complex().y()); - SOPHUS_ENSURE(length >= Constants::epsilon(), + SOPHUS_ENSURE(length >= Constants::epsilon(), "%s", "Complex number should not be close to zero!"); unit_complex_nonconst() /= length; } @@ -634,4 +634,4 @@ class Map const, Options> /// Map const, Options> const unit_complex_; }; -} // namespace Eigen +} // namespace Eigen \ No newline at end of file diff --git a/sophus/so3.hpp b/sophus/so3.hpp index c3975b0c6..f4ffb638e 100644 --- a/sophus/so3.hpp +++ b/sophus/so3.hpp @@ -668,7 +668,7 @@ class SO3 : public SO3Base> { /// SOPHUS_FUNC static SO3 expAndTheta(Tangent const& omega, Scalar* theta) { - SOPHUS_ENSURE(theta != nullptr, "must not be nullptr."); + SOPHUS_ENSURE(theta != nullptr, "%s", "must not be nullptr."); using std::abs; using std::cos; using std::sin; @@ -733,7 +733,7 @@ class SO3 : public SO3Base> { /// Precondition: ``i`` must be 0, 1 or 2. /// SOPHUS_FUNC static Transformation generator(int i) { - SOPHUS_ENSURE(i >= 0 && i <= 2, "i should be in range [0,2]."); + SOPHUS_ENSURE(i >= 0 && i <= 2, "%s", "i should be in range [0,2]."); Tangent e; e.setZero(); e[i] = Scalar(1); @@ -931,4 +931,4 @@ class Map const, Options> /// Map const, Options> const unit_quaternion_; }; -} // namespace Eigen +} // namespace Eigen \ No newline at end of file