23 using namespace gtsam;
57 CHECK(assert_container_equality<Indices>({ 0 },
factor1.indices()));
60 const Indices t_indices = { 0, 1 };
64 CHECK(assert_container_equality<Indices>(t_indices,
factor2.indices()));
70 CHECK(assert_container_equality<Indices>({ 2 },
factor3.indices()));
84 Matrix expectedH1 = numericalDerivative11<Vector, Pose2>(
85 [&factor](
const Pose2&
p) {
return factor.evaluateError(
p); },
pose);
89 factor.evaluateError(pose, actualH1);
107 Matrix expectedH1 = numericalDerivative11<Vector, Pose2>(
108 [&factor](
const Pose2&
p) {
return factor.evaluateError(
p); },
pose);
112 factor.evaluateError(pose, actualH1);
129 Matrix expectedH1 = numericalDerivative11<Vector, Pose2>(
130 [&factor](
const Pose2&
p) {
return factor.evaluateError(
p); },
pose);
134 factor.evaluateError(pose, actualH1);
158 CHECK(assert_container_equality<Indices>(t_indices,
factor2.indices()));
166 CHECK(assert_container_equality<Indices>(r_indices,
factor3.indices()));
180 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
181 [&factor](
const Pose3&
p) {
return factor.evaluateError(
p); },
pose);
185 factor.evaluateError(pose, actualH1);
202 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
203 [&factor](
const Pose3&
p) {
return factor.evaluateError(
p); },
pose);
207 factor.evaluateError(pose, actualH1);
226 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
227 [&factor](
const Pose3&
p) {
return factor.evaluateError(
p); },
pose);
231 factor.evaluateError(pose, actualH1);
245 (
Vector(2) << measurement.
x(), measurement.
z()).finished(),
model);
250 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
251 [&factor](
const Pose3&
p) {
return factor.evaluateError(
p); },
pose);
255 factor.evaluateError(pose, actualH1);
273 Matrix expectedH1 = numericalDerivative11<Vector, Pose3>(
Provides additional testing facilities for common data structures.
const Point3 & translation(OptionalJacobian< 3, 6 > Hself={}) const
get translation
PartialPriorFactor< Pose2 > TestPartialPriorFactor2
static int runAllTests(TestResult &result)
noiseModel::Diagonal::shared_ptr model
TEST(PartialPriorFactor, Constructors2)
static const int kIndexRz
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
static const int kIndexTz
Some functions to compute numerical derivatives.
PartialPriorFactor< Pose3 > TestPartialPriorFactor3
static const int kIndexTy
static Point2 measurement(323.0, 240.0)
A simple prior factor that allows for setting a prior only on a part of linear parameters.
double theta() const
get theta
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static const int kIndexRy
static const Pose3 pose(Rot3(Vector3(1, -1, -1).asDiagonal()), Point3(0, 0, 0.5))
static const int kIndexRx
std::vector< size_t > Indices
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself={}) const
get rotation
Vector evaluateError(const T &p, OptionalMatrixType H) const override
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel
static shared_ptr Sigma(size_t dim, double sigma, bool smart=true)
const Point2 & translation(OptionalJacobian< 2, 3 > Hself={}) const
translation
All noise models live in the noiseModel namespace.
static const int kIndexTx