30 using namespace gtsam;
42 static const double tol = 1
e-4;
65 GaussianBayesTree::sharedClique
R = bayesTree.
roots().front();
70 GaussianBayesTree::sharedClique
C2 = bayesTree[
X(5)];
76 Matrix A56 = (
Matrix(2,2) << -0.382022,0.,0.,-0.382022).finished();
79 GaussianBayesTree::sharedClique C3 = bayesTree[
X(4)];
84 double sigma4 = 0.661968;
85 Matrix A46 = (
Matrix(2,2) << -0.146067,0.,0.,-0.146067).finished();
88 GaussianBayesTree::sharedClique C4 = bayesTree[
X(3)];
121 VectorValues expectedSolution = VectorValues::Zero(actualSolution);
132 Matrix actualCovarianceX1 = m->information().inverse();
136 double sigmax2 = 0.68712938;
138 Matrix expectedCovX2 = I_2x2 * (sigmax2 * sigmax2);
169 GaussianBayesTree::sharedClique
R = bayesTree.
roots().front();
174 GaussianBayesTree::sharedClique
C2 = bayesTree[
X(3)];
234 const Matrix I = I_2x2,
A = -0.00429185*
I;
254 double sig14 = 0.784465;
287 fg.
add(1, (
Matrix(1, 1) << 1.0).finished(), 3, (
Matrix(1, 1) << 2.0).finished(), 5, (
Matrix(1, 1) << 3.0).finished(), (
Vector(1) << 4.0).finished(), model);
288 fg.
add(1, (
Matrix(1, 1) << 5.0).finished(), (
Vector(1) << 6.0).finished(), model);
289 fg.
add(2, (
Matrix(1, 1) << 7.0).finished(), 4, (
Matrix(1, 1) << 8.0).finished(), 5, (
Matrix(1, 1) << 9.0).finished(), (
Vector(1) << 10.0).finished(), model);
290 fg.
add(2, (
Matrix(1, 1) << 11.0).finished(), (
Vector(1) << 12.0).finished(), model);
291 fg.
add(5, (
Matrix(1, 1) << 13.0).finished(), 6, (
Matrix(1, 1) << 14.0).finished(), (
Vector(1) << 15.0).finished(), model);
292 fg.
add(6, (
Matrix(1, 1) << 17.0).finished(), 7, (
Matrix(1, 1) << 18.0).finished(), (
Vector(1) << 19.0).finished(), model);
293 fg.
add(7, (
Matrix(1, 1) << 20.0).finished(), (
Vector(1) << 21.0).finished(), model);
313 if (signbit(expectedJointJ(0, 2)) != signbit(actualJointJ(0, 2)))
314 expectedJointJ.row(0) = -expectedJointJ.row(0);
316 if (signbit(expectedJointJ(1, 2)) != signbit(actualJointJ(1, 2)))
317 expectedJointJ.row(1) = -expectedJointJ.row(1);
GaussianFactorGraph createSmoother(int T)
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
static int runAllTests(TestResult &result)
noiseModel::Diagonal::shared_ptr model
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
Rot2 R(Rot2::fromAngle(0.1))
Matrix information() const override
Matrix< SCALARA, Dynamic, Dynamic, opt_A > A
static enum @1107 ordering
TEST(GaussianBayesTree, linear_smoother_shortcuts)
void add(const GaussianFactor &factor)
VectorValues optimize() const
#define EXPECT(condition)
std::pair< std::shared_ptr< GaussianConditional >, std::shared_ptr< HessianFactor > > EliminateCholesky(const GaussianFactorGraph &factors, const Ordering &keys)
Contains the HessianFactor class, a general quadratic factor.
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Conditional Gaussian Base class.
std::pair< GaussianConditional::shared_ptr, JacobianFactor::shared_ptr > EliminateQR(const GaussianFactorGraph &factors, const Ordering &keys)
Matrix augmentedJacobian(const Ordering &ordering) const
#define LONGS_EQUAL(expected, actual)
const Roots & roots() const
std::shared_ptr< BayesTreeType > eliminateMultifrontal(OptionalOrderingType orderingType={}, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex={}) const
Create small example with two poses and one landmark.
Chordal Bayes Net, the result of eliminating a factor graph.
sharedBayesNet jointBayesNet(Key j1, Key j2, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
std::shared_ptr< Diagonal > shared_ptr
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
sharedConditional marginalFactor(Key j, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
static const Eigen::MatrixBase< Vector2 >::ConstantReturnType Z_2x1