Go to the documentation of this file.
26 #include <boost/archive/binary_oarchive.hpp>
27 #include <boost/archive/binary_iarchive.hpp>
28 #include <boost/serialization/export.hpp>
29 #include <boost/random/mersenne_twister.hpp>
30 #include <boost/random/uniform_real.hpp>
31 #include <boost/random/variate_generator.hpp>
34 using namespace gtsam;
43 int main(
int argc,
char *argv[]) {
45 const size_t steps = 50000;
47 cout <<
"Playing forward " << steps <<
" time steps..." << endl;
52 vector<double> times(steps);
60 gttic_(Create_measurements);
63 newFactors.
addPrior(0,
Pose(), noiseModel::Unit::Create(3));
66 Vector eta = Vector::Random(3) * 0.1;
73 gttoc_(Create_measurements);
77 isam2.
update(newFactors, newVariables);
83 times[
step] = node->time();
85 if(
step % 1000 == 0) {
86 cout <<
"Step " <<
step << endl;
94 ofstream timesFile(
"times.txt");
95 for(
double t: times) {
96 timesFile <<
t <<
"\n"; }
std::shared_ptr< Unit > shared_ptr
utility functions for loading datasets
void tictoc_finishedIteration_()
#define tictoc_getNode(variable, label)
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
def step(data, isam, result, truth, currPoseIndex, isamArgs=())
NoiseModelFactorN< Pose, Pose > NM2
Values calculateEstimate() const
Incremental update functionality (ISAM2) for BayesTree, with fluid relinearization.
virtual ISAM2Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const FactorIndices &removeFactorIndices=FactorIndices(), const std::optional< FastMap< Key, int > > &constrainedKeys={}, const std::optional< FastList< Key > > &noRelinKeys={}, const std::optional< FastList< Key > > &extraReelimKeys={}, bool force_relinearize=false)
A class for computing marginals in a NonlinearFactorGraph.
void insert(Key j, const Value &val)
int main(int argc, char *argv[])
T between(const T &t1, const T &t2)
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
noiseModel::Unit::shared_ptr model
IsDerived< DERIVEDFACTOR > add(std::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
NoiseModelFactorN< Pose > NM1
gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:08:59