24 using namespace gtsam;
27 #define TEST(TITLE,STATEMENT) \ 29 for(int i = 0; i < n; i++) \ 40 boost::optional<Matrix&> H1 = boost::none, boost::optional<Matrix&> H2 = boost::none) {
43 double c1=R1.
c(), s1=R1.
s(),
c2=
R2.c(), s2=
R2.s();
49 double c = c1 *
c2 + s1 * s2,
s = -s1 *
c2 + c1 * s2;
54 double x = dt.x(),
y = dt.y();
55 Point2 t(c1 * x + s1 *
y, -s1 * x + c1 * y);
59 double dt1 = -s2 * x +
c2 *
y;
60 double dt2 = -
c2 * x - s2 *
y;
64 0.0, 0.0,-1.0).finished();
73 boost::optional<Matrix3&> H1, boost::optional<Matrix3&> H2)
77 double c1=R1.
c(), s1=R1.
s(),
c2=
R2.c(), s2=
R2.s();
83 double c = c1 *
c2 + s1 * s2,
s = -s1 *
c2 + c1 * s2;
88 double x = dt.x(),
y = dt.y();
89 Point2 t(c1 * x + s1 *
y, -s1 * x + c1 * y);
93 double dt1 = -s2 * x +
c2 *
y;
94 double dt2 = -
c2 * x - s2 *
y;
95 *H1 = Matrix3(); (*H1) <<
100 if (H2) *H2 = Matrix3::Identity();
107 boost::optional<Matrix&> H1, boost::optional<Matrix&> H2)
116 boost::optional<Matrix&> H1, boost::optional<Matrix&> H2)
125 boost::optional<Matrix3&> H1, boost::optional<Matrix3&> H2)
137 cout <<
"NOTE: Times are reported for " << n <<
" calls" << endl;
140 double x = 4.0,
y = 2.0, r = 0.3;
146 TEST(Logmap, Pose2::Logmap(
X2));
Vector Pose2BetweenFactorEvaluateErrorDefault(const Pose2 &measured, const Pose2 &p1, const Pose2 &p2, boost::optional< Matrix & > H1, boost::optional< Matrix & > H2)
const Point2 & t() const
translation
Rot2 R(Rot2::fromAngle(0.1))
Pose2_ Expmap(const Vector3_ &xi)
Vector Pose2BetweenFactorEvaluateErrorOptimizedBetween(const Pose2 &measured, const Pose2 &p1, const Pose2 &p2, boost::optional< Matrix & > H1, boost::optional< Matrix & > H2)
const Rot2 & r() const
rotation
#define TEST(TITLE, STATEMENT)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Q R1(Eigen::AngleAxisd(1, Q_z_axis))
Vector Pose2BetweenFactorEvaluateErrorOptimizedBetweenFixed(const Pose2 &measured, const Pose2 &p1, const Pose2 &p2, boost::optional< Matrix3 & > H1, boost::optional< Matrix3 & > H2)
Jet< T, N > atan2(const Jet< T, N > &g, const Jet< T, N > &f)
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
Class between(const Class &g) const
Pose2 Pose2betweenOptimized(const Pose2 &r1, const Pose2 &r2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none)
Pose2 Pose2betweenDefault(const Pose2 &r1, const Pose2 &r2)
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
GTSAM_EXPORT Pose2 inverse() const
inverse
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
Q R2(Eigen::AngleAxisd(2, Vector3(0, 1, 0)))
TangentVector localCoordinates(const Class &g) const
localCoordinates as required by manifold concept: finds tangent vector between *this and g ...