13 using namespace gtsam;
19 static const
Point3 pt(1.0, 2.0, 3.0);
24 TEST( testPoseRTV, constructors ) {
49 Vector vec_init = (
Vector(9) << 0.1, 0.2, 0.3, 1.0, 2.0, 3.0, 0.4, 0.5, 0.6).finished();
87 delta << 0.1, 0.1, 0.1, 0.2, 0.3, 0.4,-0.1,-0.2,-0.3;
108 TEST( testPoseRTV, dynamics_identities ) {
112 const double dt = 0.1;
114 Vector imu01 = Z_6x1, imu12 = Z_6x1, imu23 = Z_6x1, imu34 = Z_6x1;
139 state1.compose(state2, actH1, actH2);
152 state1.between(state2, actH1, actH2);
173 Point3 tA(1.0, 2.0, 3.0), tB(3.0, 2.0, 3.0);
180 rtvA.range(rtvB, actH1, actH2);
191 TEST( testPoseRTV, transformed_from_1 ) {
198 Matrix actDTrans, actDGlobal;
210 TEST( testPoseRTV, transformed_from_2 ) {
217 Matrix actDTrans, actDGlobal;
Provides additional testing facilities for common data structures.
static Rot3 Ypr(double y, double p, double r, OptionalJacobian< 3, 1 > Hy={}, OptionalJacobian< 3, 1 > Hp={}, OptionalJacobian< 3, 1 > Hr={})
ProductLieGroup compose(const ProductLieGroup &g) const
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
Concept check for values that can be used in unit tests.
static int runAllTests(TestResult &result)
static const Velocity3 vel(0.4, 0.5, 0.6)
Vector3 Velocity3
Velocity is currently typedef'd to Vector3.
PoseRTV transformed_from_proxy(const PoseRTV &a, const Pose3 &trans)
TangentVector logmap(const ProductLieGroup &g) const
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Rot2 R(Rot2::fromAngle(0.1))
PoseRTV compose_proxy(const PoseRTV &A, const PoseRTV &B)
Some functions to compute numerical derivatives.
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
static const Vector3 kZero3
static const Point3 pt(1.0, 2.0, 3.0)
const Pose3 & pose() const
static const NavState state1(x1, v1)
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
#define GTSAM_CONCEPT_LIE_INST(T)
#define EXPECT_DOUBLES_EQUAL(expected, actual, threshold)
EIGEN_DEVICE_FUNC const InverseReturnType inverse() const
Matrix trans(const Matrix &A)
static Matrix RRTMnb(const Vector3 &euler)
internal::FixedSizeMatrix< Y, X >::type numericalDerivative11(std::function< Y(const X &)> h, const X &x, double delta=1e-5)
New-style numerical derivatives using manifold_traits.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
ProductLieGroup between(const ProductLieGroup &g) const
ProductLieGroup expmap(const TangentVector &v) const
bool assert_inequal(const Matrix &A, const Matrix &B, double tol)
static Rot3 Rodrigues(const Vector3 &w)
static Rot3 Yaw(double t)
Positive yaw is to right (as in aircraft heading). See ypr.
double range(const PoseRTV &other, OptionalJacobian< 1, 9 > H1={}, OptionalJacobian< 1, 9 > H2={}) const
TangentVector localCoordinates(const ProductLieGroup &g, ChartJacobian H1={}, ChartJacobian H2={}) const
static const NavState state2(x2, v2)
#define EXPECT(condition)
PoseRTV transformed_from(const Pose3 &trans, ChartJacobian Dglobal={}, OptionalJacobian< 9, 6 > Dtrans={}) const
Eigen::Triplet< double > T
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static Matrix RRTMbn(const Vector3 &euler)
EIGEN_DONT_INLINE void transform(const Transformation &t, Data &data)
Class compose(const Class &g) const
Pose3 x3(Rot3::Ypr(M_PI/4.0, 0.0, 0.0), l2)
PoseRTV between_proxy(const PoseRTV &A, const PoseRTV &B)
Pose3 with translational velocity.
double range_proxy(const PoseRTV &A, const PoseRTV &B)
NavState retract(const Vector9 &v, OptionalJacobian< 9, 9 > H1={}, OptionalJacobian< 9, 9 > H2={}) const
retract with optional derivatives
#define EXPECT_LONGS_EQUAL(expected, actual)
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
ProductLieGroup inverse() const
Double_ range(const Point2_ &p, const Point2_ &q)
Expression< T > compose(const Expression< T > &t1, const Expression< T > &t2)
ProductLieGroup retract(const TangentVector &v, ChartJacobian H1={}, ChartJacobian H2={}) const
PoseRTV generalDynamics(const Vector &accel, const Vector &gyro, double dt) const
General Dynamics update - supply control inputs in body frame.
Vector9 localCoordinates(const NavState &g, OptionalJacobian< 9, 9 > H1={}, OptionalJacobian< 9, 9 > H2={}) const
localCoordinates with optional derivatives
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself={}) const
get rotation
TEST(SmartFactorBase, Pinhole)
PoseRTV inverse_proxy(const PoseRTV &A)
Expression< T > between(const Expression< T > &t1, const Expression< T > &t2)
const Velocity3 & v() const
#define GTSAM_CONCEPT_TESTABLE_INST(T)