Skip to content

Commit

Permalink
fixed build error based on stonier#23
Browse files Browse the repository at this point in the history
  • Loading branch information
KalanaRatnayake committed May 23, 2024
1 parent cbeacf4 commit 276514f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions sophus/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
}

Expand All @@ -236,4 +236,4 @@ struct IsUniformRandomBitGenerator {
std::is_unsigned<decltype(G::min())>::value &&
std::is_unsigned<decltype(G::max())>::value;
};
} // namespace Sophus
} // namespace Sophus
4 changes: 2 additions & 2 deletions sophus/se2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ class SE2 : public SE2Base<SE2<Scalar_, Options>> {
/// 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);
Expand Down Expand Up @@ -852,4 +852,4 @@ class Map<Sophus::SE2<Scalar_> const, Options>
Map<Sophus::SO2<Scalar> const, Options> const so2_;
Map<Sophus::Vector2<Scalar> const, Options> const translation_;
};
} // namespace Eigen
} // namespace Eigen
4 changes: 2 additions & 2 deletions sophus/se3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ class SE3 : public SE3Base<SE3<Scalar_, Options>> {
/// 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);
Expand Down Expand Up @@ -1123,4 +1123,4 @@ class Map<Sophus::SE3<Scalar_> const, Options>
Map<Sophus::SO3<Scalar> const, Options> const so3_;
Map<Sophus::Vector3<Scalar> const, Options> const translation_;
};
} // namespace Eigen
} // namespace Eigen
4 changes: 2 additions & 2 deletions sophus/so2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Scalar>::epsilon(),
SOPHUS_ENSURE(length >= Constants<Scalar>::epsilon(), "%s",
"Complex number should not be close to zero!");
unit_complex_nonconst() /= length;
}
Expand Down Expand Up @@ -634,4 +634,4 @@ class Map<Sophus::SO2<Scalar_> const, Options>
///
Map<Matrix<Scalar, 2, 1> const, Options> const unit_complex_;
};
} // namespace Eigen
} // namespace Eigen
6 changes: 3 additions & 3 deletions sophus/so3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ class SO3 : public SO3Base<SO3<Scalar_, Options>> {
///
SOPHUS_FUNC static SO3<Scalar> 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;
Expand Down Expand Up @@ -733,7 +733,7 @@ class SO3 : public SO3Base<SO3<Scalar_, Options>> {
/// 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);
Expand Down Expand Up @@ -931,4 +931,4 @@ class Map<Sophus::SO3<Scalar_> const, Options>
///
Map<Eigen::Quaternion<Scalar> const, Options> const unit_quaternion_;
};
} // namespace Eigen
} // namespace Eigen

0 comments on commit 276514f

Please sign in to comment.