32 using namespace gtsam;
66 typedef BatchFixedLagSmoother::KeyTimestampMap Timestamps;
84 Timestamps newTimestamps;
88 newTimestamps[key0] = 0.0;
91 fullinit.
insert(newValues);
94 smoother.
update(newFactors, newValues, newTimestamps);
109 Timestamps newTimestamps;
113 newTimestamps[
key2] = double(i);
116 fullinit.
insert(newValues);
119 smoother.
update(newFactors, newValues, newTimestamps);
135 Timestamps newTimestamps;
140 newTimestamps[
key2] = double(i);
143 fullinit.
insert(newValues);
146 smoother.
update(newFactors, newValues, newTimestamps);
161 Timestamps newTimestamps;
165 newTimestamps[
key2] = double(i);
168 fullinit.
insert(newValues);
171 smoother.
update(newFactors, newValues, newTimestamps);
186 Timestamps newTimestamps;
192 newTimestamps[
key2] = double(i);
195 fullinit.
insert(newValues);
198 smoother.
update(newFactors, newValues, newTimestamps);
215 Timestamps emptyNewTimestamps;
217 size_t factorIndex = 6;
219 factorToRemove.push_back(factorIndex);
224 smoother.
update(emptyNewFactors, emptyNewValues, emptyNewTimestamps,factorToRemove);
228 for(
size_t i=0; i< smootherFactorsBeforeRemove.
size(); i++){
230 if(smootherFactorsBeforeRemove[i] && i != factorIndex){
231 EXPECT(smootherFactorsBeforeRemove[i]->
equals(*actual[i]));
const gtsam::Symbol key('X', 0)
Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const KeyTimestampMap ×tamps=KeyTimestampMap(), const FactorIndices &factorsToRemove=FactorIndices()) override
static int runAllTests(TestResult &result)
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
bool check_smoother(const NonlinearFactorGraph &fullgraph, const Values &fullinit, const BatchFixedLagSmoother &smoother, const Key &key)
const ValueType at(Key j) const
IsDerived< DERIVEDFACTOR > push_back(std::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
bool assert_equal(const Matrix &expected, const Matrix &actual, double tol)
const NonlinearFactorGraph & getFactors() const
VectorValues optimize(const Eliminate &function=EliminationTraitsType::DefaultEliminate) const
Values retract(const VectorValues &delta) const
std::shared_ptr< GaussianFactorGraph > linearize(const Values &linearizationPoint) const
Linearize a nonlinear factor graph.
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
FastVector< FactorIndex > FactorIndices
Define collection types:
const Symbol key1('v', 1)
TEST(BatchFixedLagSmoother, Example)
#define EXPECT(condition)
Linear Factor Graph where all factors are Gaussians.
noiseModel::Diagonal::shared_ptr SharedDiagonal
Values calculateEstimate() const override
Chordal Bayes Net, the result of eliminating a factor graph.
void insert(Key j, const Value &val)
std::uint64_t Key
Integer nonlinear key type.
const Symbol key2('v', 2)