From c6bafdd02c33ec0ccb705578d83e4f601ddeedea Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Mon, 28 Oct 2013 19:38:08 -0700 Subject: [PATCH] Comments from Jim Roseborough. 1. Fix the tolerance on the rotation matrix conversion test. 2. Fix some out of date comments. Change-Id: I65e80da1f96d7b4d9ac0630ad8cb708c41739840 --- include/ceres/rotation.h | 4 ++-- internal/ceres/rotation_test.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ceres/rotation.h b/include/ceres/rotation.h index 397787d51..e3dbfe84a 100644 --- a/include/ceres/rotation.h +++ b/include/ceres/rotation.h @@ -417,7 +417,7 @@ void AngleAxisToRotationMatrix( R(1, 2) = -wx*sintheta + wy*wz*(kOne - costheta); R(2, 2) = costheta + wz*wz*(kOne - costheta); } else { - // At zero, we switch to using the first order Taylor expansion. + // Near zero, we switch to using the first order Taylor expansion. R(0, 0) = kOne; R(1, 0) = angle_axis[2]; R(2, 0) = -angle_axis[1]; @@ -625,7 +625,7 @@ void AngleAxisRotatePoint(const T angle_axis[3], const T pt[3], T result[3]) { // and actually performing multiplication with the point pt, gives us // R * pt = pt + w x pt. // - // Switching to the Taylor expansion at zero provides meaningful + // Switching to the Taylor expansion near zero provides meaningful // derivatives when evaluated using Jets. // // Explicitly inlined evaluation of the cross product for diff --git a/internal/ceres/rotation_test.cc b/internal/ceres/rotation_test.cc index cc4cc924e..42fdfee11 100644 --- a/internal/ceres/rotation_test.cc +++ b/internal/ceres/rotation_test.cc @@ -576,7 +576,7 @@ TEST(Rotation, AngleAxisToRotationMatrixAndBackNearZero) { RotationMatrixToAngleAxis(matrix, round_trip); for (int i = 0; i < 3; ++i) { - EXPECT_NEAR(round_trip[i], axis_angle[i], kTolerance); + EXPECT_NEAR(round_trip[i], axis_angle[i], std::numeric_limits::epsilon()); } } }