15 #include <gtsam/nonlinear/NonlinearFactor.h> 16 #include <gtsam/base/Matrix.h> 17 #include <gtsam/base/Vector.h> 18 #include <gtsam/geometry/Pose2.h> 37 GPSPose2XYFactor(gtsam::Key poseKey,
const gtsam::Point2 m, gtsam::SharedNoiseModel model) :
38 gtsam::NoiseModelFactor1<
gtsam::Pose2>(model, poseKey), mx_(m.x()), my_(m.y()) {}
43 gtsam::Vector
evaluateError(
const gtsam::Pose2& p, boost::optional<gtsam::Matrix&> H = boost::none)
const {
47 if (H) *H = (gtsam::Matrix23() << 1.0, 0.0, 0.0,
48 0.0, 1.0, 0.0).finished();
51 return (gtsam::Vector2() << p.x() -
mx_, p.y() -
my_).finished();
GPSPose2XYFactor(gtsam::Key poseKey, const gtsam::Point2 m, gtsam::SharedNoiseModel model)
gtsam::Vector evaluateError(const gtsam::Pose2 &p, boost::optional< gtsam::Matrix & > H=boost::none) const