Point3 and Rot3 dexpInvL

release/4.3a0
Duy-Nguyen Ta 2013-08-06 16:26:35 +00:00
parent 81b9fc33b7
commit 6bf6cc8bdd
4 changed files with 24 additions and 0 deletions

View File

@ -148,6 +148,11 @@ namespace gtsam {
return eye(3); return eye(3);
} }
/// Left-trivialized derivative inverse of the exponential map
static Matrix dexpInvL(const Vector& v) {
return eye(3);
}
/// @} /// @}
/// @name Vector Space /// @name Vector Space
/// @{ /// @{

View File

@ -271,6 +271,9 @@ namespace gtsam {
/// Left-trivialized derivative of the exponential map /// Left-trivialized derivative of the exponential map
static Matrix3 dexpL(const Vector3& v); static Matrix3 dexpL(const Vector3& v);
/// Left-trivialized derivative inverse of the exponential map
static Matrix3 dexpInvL(const Vector3& v);
/// @} /// @}
/// @name Group Action on Point3 /// @name Group Action on Point3
/// @{ /// @{

View File

@ -316,6 +316,19 @@ Matrix3 Rot3::dexpL(const Vector3& v) {
return res; return res;
} }
/* ************************************************************************* */
/// Follow Iserles05an, B10, pg 147, with a sign change in the second term (left version)
Matrix3 Rot3::dexpInvL(const Vector3& v) {
if(zero(v)) return eye(3);
Matrix x = skewSymmetric(v);
Matrix x2 = x*x;
double theta = v.norm(), vi = theta/2.0;
double s2 = (theta*tan(M_PI_2-vi) - 2)/(2*theta*theta);
Matrix res = eye(3) + 0.5*x - s2*x2;
return res;
}
/* ************************************************************************* */ /* ************************************************************************* */
Matrix3 Rot3::matrix() const { Matrix3 Rot3::matrix() const {
return rot_; return rot_;

View File

@ -419,6 +419,9 @@ TEST( Rot3, dexpL) {
boost::function<Vector(const LieVector&)>( boost::function<Vector(const LieVector&)>(
boost::bind(testDexpL, _1)), LieVector(zero(3)), 1e-2); boost::bind(testDexpL, _1)), LieVector(zero(3)), 1e-2);
EXPECT(assert_equal(expectedDexpL, actualDexpL, 1e-5)); EXPECT(assert_equal(expectedDexpL, actualDexpL, 1e-5));
Matrix actualDexpInvL = Rot3::dexpInvL(w);
EXPECT(assert_equal(expectedDexpL.inverse(), actualDexpInvL, 1e-5));
} }
/* ************************************************************************* */ /* ************************************************************************* */