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"; }
def step(data, isam, result, truth, currPoseIndex)
#define tictoc_getNode(variable, label)
NoiseModelFactor1< Pose > NM1
boost::shared_ptr< Unit > shared_ptr
NoiseModelFactor2< Pose, Pose > NM2
T between(const T &t1, const T &t2)
void insert(Key j, const Value &val)
noiseModel::Unit::shared_ptr model
IsDerived< DERIVEDFACTOR > add(boost::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
void addPrior(Key key, const T &prior, const SharedNoiseModel &model=nullptr)
Values calculateEstimate() const
Incremental update functionality (ISAM2) for BayesTree, with fluid relinearization.
Class retract(const TangentVector &v) const
retract as required by manifold concept: applies v at *this
virtual ISAM2Result update(const NonlinearFactorGraph &newFactors=NonlinearFactorGraph(), const Values &newTheta=Values(), const FactorIndices &removeFactorIndices=FactorIndices(), const boost::optional< FastMap< Key, int > > &constrainedKeys=boost::none, const boost::optional< FastList< Key > > &noRelinKeys=boost::none, const boost::optional< FastList< Key > > &extraReelimKeys=boost::none, bool force_relinearize=false)
A class for computing marginals in a NonlinearFactorGraph.
void tictoc_finishedIteration_()
int main(int argc, char *argv[])
utility functions for loading datasets