56 using namespace gtsam;
96 if (
H) (*H) = (
gtsam::Matrix(2, 3) << R.
c(), -R.
s(), 0.0, R.
s(), R.
c(), 0.0).finished();
97 return (
Vector(2) << q.
x() - mx_, q.
y() - my_).finished();
113 int main(
int argc,
char** argv) {
127 noiseModel::Diagonal::Sigmas(
Vector2(0.1, 0.1));
131 graph.
print(
"\nFactor Graph:\n");
139 initialEstimate.
print(
"\nInitial Estimate:\n");
149 result.
print(
"Final Result:\n");
noiseModel::Diagonal::shared_ptr odometryNoise
virtual const Values & optimize()
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
gtsam::NonlinearFactor::shared_ptr clone() const override
noiseModel::Diagonal::shared_ptr model
void insert(Key j, const Value &val)
noiseModel::Diagonal::shared_ptr unaryNoise
Rot2 R(Rot2::fromAngle(0.1))
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange[*:*] noreverse nowriteback set trange[*:*] noreverse nowriteback set urange[*:*] noreverse nowriteback set vrange[*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
NonlinearFactorGraph graph
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&...args)
Emplace a shared pointer to factor of given type.
boost::shared_ptr< This > shared_ptr
const Rot2 & rotation() const
rotation
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
EIGEN_DEVICE_FUNC const Scalar & q
Vector evaluateError(const Pose2 &q, boost::optional< Matrix & > H=boost::none) const override
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Non-linear factor base classes.
UnaryFactor(Key j, double x, double y, const SharedNoiseModel &model)
Matrix marginalCovariance(Key variable) const
int main(int argc, char **argv)
boost::shared_ptr< UnaryFactor > shared_ptr
shorthand for a smart pointer to a factor
A class for computing marginals in a NonlinearFactorGraph.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
std::uint64_t Key
Integer nonlinear key type.
Marginals marginals(graph, result)
noiseModel::Base::shared_ptr SharedNoiseModel