Added underscore to case conflicts until wrap can handle this.
parent
c0686f1f09
commit
37ed46cee1
|
|
@ -0,0 +1,21 @@
|
||||||
|
"""Pose2 unit tests."""
|
||||||
|
import unittest
|
||||||
|
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
from gtsam import Pose2
|
||||||
|
|
||||||
|
|
||||||
|
class TestPose2(unittest.TestCase):
|
||||||
|
"""Test selected Pose2 methods."""
|
||||||
|
|
||||||
|
def test_adjoint(self):
|
||||||
|
"""Test adjoint method."""
|
||||||
|
xi = np.array([1, 2, 3])
|
||||||
|
expected = np.dot(Pose2.adjointMap(xi), xi)
|
||||||
|
actual = Pose2.adjoint(xi, xi)
|
||||||
|
np.testing.assert_array_equal(actual, expected)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
|
|
@ -49,8 +49,8 @@ class TestPose3(unittest.TestCase):
|
||||||
def test_adjoint(self):
|
def test_adjoint(self):
|
||||||
"""Test adjoint method."""
|
"""Test adjoint method."""
|
||||||
xi = np.array([1, 2, 3, 4, 5, 6])
|
xi = np.array([1, 2, 3, 4, 5, 6])
|
||||||
expected = np.dot(Pose3.adjointMap(xi), xi)
|
expected = np.dot(Pose3.adjointMap_(xi), xi)
|
||||||
actual = Pose3.adjoint(xi, xi)
|
actual = Pose3.adjoint_(xi, xi)
|
||||||
np.testing.assert_array_equal(actual, expected)
|
np.testing.assert_array_equal(actual, expected)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
8
gtsam.h
8
gtsam.h
|
|
@ -577,8 +577,8 @@ class Pose2 {
|
||||||
static Matrix LogmapDerivative(const gtsam::Pose2& v);
|
static Matrix LogmapDerivative(const gtsam::Pose2& v);
|
||||||
Matrix AdjointMap() const;
|
Matrix AdjointMap() const;
|
||||||
Vector Adjoint(Vector xi) const;
|
Vector Adjoint(Vector xi) const;
|
||||||
static Matrix adjointMap(Vector v);
|
static Matrix adjointMap_(Vector v);
|
||||||
Vector adjoint(Vector xi, Vector y);
|
Vector adjoint_(Vector xi, Vector y);
|
||||||
Vector adjointTranspose(Vector xi, Vector y);
|
Vector adjointTranspose(Vector xi, Vector y);
|
||||||
static Matrix wedge(double vx, double vy, double w);
|
static Matrix wedge(double vx, double vy, double w);
|
||||||
|
|
||||||
|
|
@ -628,8 +628,8 @@ class Pose3 {
|
||||||
static Vector Logmap(const gtsam::Pose3& pose);
|
static Vector Logmap(const gtsam::Pose3& pose);
|
||||||
Matrix AdjointMap() const;
|
Matrix AdjointMap() const;
|
||||||
Vector Adjoint(Vector xi) const;
|
Vector Adjoint(Vector xi) const;
|
||||||
static Matrix adjointMap(Vector xi);
|
static Matrix adjointMap_(Vector xi);
|
||||||
static Vector adjoint(Vector xi, Vector y);
|
static Vector adjoint_(Vector xi, Vector y);
|
||||||
static Vector adjointTranspose(Vector xi, Vector y);
|
static Vector adjointTranspose(Vector xi, Vector y);
|
||||||
static Matrix ExpmapDerivative(Vector xi);
|
static Matrix ExpmapDerivative(Vector xi);
|
||||||
static Matrix LogmapDerivative(const gtsam::Pose3& xi);
|
static Matrix LogmapDerivative(const gtsam::Pose3& xi);
|
||||||
|
|
|
||||||
|
|
@ -146,17 +146,21 @@ public:
|
||||||
/**
|
/**
|
||||||
* Action of the adjointMap on a Lie-algebra vector y, with optional derivatives
|
* Action of the adjointMap on a Lie-algebra vector y, with optional derivatives
|
||||||
*/
|
*/
|
||||||
Vector3 adjoint(const Vector3& xi, const Vector3& y) {
|
static Vector3 adjoint(const Vector3& xi, const Vector3& y) {
|
||||||
return adjointMap(xi) * y;
|
return adjointMap(xi) * y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The dual version of adjoint action, acting on the dual space of the Lie-algebra vector space.
|
* The dual version of adjoint action, acting on the dual space of the Lie-algebra vector space.
|
||||||
*/
|
*/
|
||||||
Vector3 adjointTranspose(const Vector3& xi, const Vector3& y) {
|
static Vector3 adjointTranspose(const Vector3& xi, const Vector3& y) {
|
||||||
return adjointMap(xi).transpose() * y;
|
return adjointMap(xi).transpose() * y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// temporary fix for wrappers until case issue is resolved
|
||||||
|
static Matrix3 adjointMap_(const Vector3 &xi) { return adjointMap(xi);}
|
||||||
|
static Vector3 adjoint_(const Vector3 &xi, const Vector3 &y) { return adjoint(xi, y);}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wedge for SE(2):
|
* wedge for SE(2):
|
||||||
* @param xi 3-dim twist (v,omega) where
|
* @param xi 3-dim twist (v,omega) where
|
||||||
|
|
|
||||||
|
|
@ -160,6 +160,10 @@ public:
|
||||||
static Vector6 adjoint(const Vector6 &xi, const Vector6 &y,
|
static Vector6 adjoint(const Vector6 &xi, const Vector6 &y,
|
||||||
OptionalJacobian<6, 6> = boost::none);
|
OptionalJacobian<6, 6> = boost::none);
|
||||||
|
|
||||||
|
// temporary fix for wrappers until case issue is resolved
|
||||||
|
static Matrix6 adjointMap_(const Vector6 &xi) { return adjointMap(xi);}
|
||||||
|
static Vector6 adjoint_(const Vector6 &xi, const Vector6 &y) { return adjoint(xi, y);}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The dual version of adjoint action, acting on the dual space of the Lie-algebra vector space.
|
* The dual version of adjoint action, acting on the dual space of the Lie-algebra vector space.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue