36 #include <type_traits> 39 using namespace gtsam;
44 const auto R =
SOn(0);
55 const auto R =
SOn(5);
94 const auto R =
SOn(5);
102 const auto R =
SOn(5);
113 static std::mt19937
rng(42);
122 v << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
125 expected2 << 0, -1, 1, 0;
126 const auto actual2 = SOn::Hat(v.head<1>());
131 expected3 << 0, -3, 2,
134 const auto actual3 = SOn::Hat(v.head<3>());
140 expected4 << 0, -6, 5, 3,
144 const auto actual4 = SOn::Hat(v.head<6>());
149 expected5 << 0, -10, 9, 7, -4,
154 const auto actual5 = SOn::Hat(v);
161 Vector6
v1 = (
Vector(6) << 0, 0, 0, 1, 0, 0).finished() / 10000;
162 Vector6
v2 = (
Vector(6) << 0, 0, 0, 1, 2, 3).finished() / 10000;
163 Vector6
v3 = (
Vector(6) << 3, 2, 1, 1, 2, 3).finished() / 10000;
180 SOn Q1 = SOn::Retract(v1);
192 boost::function<Matrix(const Vector &)>
h = [](
const Vector &
v) {
193 return SOn::ChartAtOrigin::Retract(
v).matrix();
197 const Matrix expectedH = numericalDerivative11<Matrix, Vector, 3>(
h,
v, 1
e-5);
204 v << 0, 0, 0, 0, 1, 2, 3, 4, 5, 6;
205 SOn Q = SOn::ChartAtOrigin::Retract(v);
208 boost::function<Vector(const SOn &)>
h = [](
const SOn &
Q) {
return Q.
vec(); };
209 const Matrix H = numericalDerivative11<Vector, SOn, 10>(
h,
Q, 1
e-5);
217 CHECK(actual2.rows()==4 && actual2.cols()==1)
221 CHECK(actual3.rows()==9 && actual3.cols()==3)
223 CHECK(actual4.rows()==16 && actual4.cols()==6)
226 auto actual5 = SOn::VectorizedGenerators(5);
227 CHECK(actual5.rows()==25 && actual5.cols()==10)
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H=boost::none) const
Concept check for values that can be used in unit tests.
Provides convenient mappings of common member functions for testing.
static int runAllTests(TestResult &result)
Matrix RetractJacobian(size_t n)
A non-templated config holding any types of Manifold-group elements.
Q id(Eigen::AngleAxisd(0, Q_z_axis))
void insert(Key j, const Value &val)
BOOST_CONCEPT_ASSERT((boost::RandomAccessRangeConcept< ListOfOneContainer< int > >))
Rot2 R(Rot2::fromAngle(0.1))
4*4 matrix representation of SO(4)
Pose2_ Expmap(const Vector3_ &xi)
Some functions to compute numerical derivatives.
const MatrixNN & matrix() const
Return matrix.
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 y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
3*3 matrix representation of SO(3)
Matrix< SCALARB, Dynamic, Dynamic > B
const ValueType at(Key j) const
Base class and basic functions for Manifold types.
#define EXPECT(condition)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Q R1(Eigen::AngleAxisd(1, Q_z_axis))
Base class and basic functions for Lie types.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
Matrix3 skewSymmetric(double wx, double wy, double wz)
#define EXPECT_LONGS_EQUAL(expected, actual)
The quaternion class used to represent 3D orientations and rotations.
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
N*N matrix representation of SO(N). N can be Eigen::Dynamic.
std::uint64_t Key
Integer nonlinear key type.