56 using namespace gtsam;
76 using NoiseModelFactor1<Pose2>::evaluateError;
100 if (H) (*H) = (
gtsam::Matrix(2, 3) << R.
c(), -R.
s(), 0.0, R.
s(), R.
c(), 0.0).finished();
101 return (
Vector(2) << q.
x() - mx_, q.
y() - my_).finished();
117 int main(
int argc,
char** argv) {
131 noiseModel::Diagonal::Sigmas(
Vector2(0.1, 0.1));
135 graph.
print(
"\nFactor Graph:\n");
143 initialEstimate.
print(
"\nInitial Estimate:\n");
153 result.
print(
"Final Result:\n");
Matrix marginalCovariance(Key variable) const
virtual const Values & optimize()
IsDerived< DERIVEDFACTOR > emplace_shared(Args &&... args)
Emplace a shared pointer to factor of given type.
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
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
void print(const std::string &str="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Matrix * OptionalMatrixType
A nonlinear optimizer that uses the Levenberg-Marquardt trust-region scheme.
EIGEN_DEVICE_FUNC const Scalar & q
void print(const std::string &str="NonlinearFactorGraph: ", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Vector evaluateError(const Pose2 &q, OptionalMatrixType H) const override
Non-linear factor base classes.
UnaryFactor(Key j, double x, double y, const SharedNoiseModel &model)
std::shared_ptr< This > shared_ptr
int main(int argc, char **argv)
void insert(Key j, const Value &val)
A class for computing marginals in a NonlinearFactorGraph.
std::shared_ptr< UnaryFactor > shared_ptr
shorthand for a smart pointer to a factor
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
const Rot2 & rotation(OptionalJacobian< 1, 3 > Hself={}) const
rotation
std::uint64_t Key
Integer nonlinear key type.
Marginals marginals(graph, result)
noiseModel::Base::shared_ptr SharedNoiseModel