23template<
typename POSE = Pose3,
typename POINT = Po
int3>
41 : Base(model, key1, key2), measured_(
measured) {}
49 DefaultKeyFormatter)
const override {
50 std::cout << s <<
"PoseToPointFactor("
51 << keyFormatter(this->key1()) <<
","
52 << keyFormatter(this->key2()) <<
")\n"
53 <<
" measured: " << measured_.transpose() << std::endl;
54 this->noiseModel_->print(
" noise model: ");
59 double tol = 1e-9)
const override {
60 const This* e =
dynamic_cast<const This*
>(&expected);
66 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
67 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
68 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
81 const POSE& w_T_b,
const POINT& w_P,
82 boost::optional<Matrix&> H1 = boost::none,
83 boost::optional<Matrix&> H2 = boost::none)
const override {
84 return w_T_b.transformTo(w_P, H1, H2) - measured_;
88 const POINT&
measured()
const {
return measured_; }
93 template <
class ARCHIVE>
94 void serialize(ARCHIVE& ar,
const unsigned int ) {
96 ar& boost::serialization::make_nvp(
98 boost::serialization::base_object<Base>(*
this));
99 ar& BOOST_SERIALIZATION_NVP(measured_);
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition Key.h:35
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:724
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
bool equals(const This &other, double tol=1e-9) const
check equality
Definition Factor.cpp:42
Nonlinear factor base class.
Definition NonlinearFactor.h:42
NoiseModelFactorN()
Definition NonlinearFactor.h:469
A class for a measurement between a pose and a point.
Definition PoseToPointFactor.h:24
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition PoseToPointFactor.h:66
const POINT & measured() const
return the measured
Definition PoseToPointFactor.h:88
boost::shared_ptr< PoseToPointFactor > shared_ptr
the point measurement in local coordinates
Definition PoseToPointFactor.h:33
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
equals
Definition PoseToPointFactor.h:58
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
implement functions needed for Testable
Definition PoseToPointFactor.h:48
Vector evaluateError(const POSE &w_T_b, const POINT &w_P, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
implement functions needed to derive from Factor
Definition PoseToPointFactor.h:80
PoseToPointFactor(Key key1, Key key2, const POINT &measured, const SharedNoiseModel &model)
Constructor.
Definition PoseToPointFactor.h:39
friend class boost::serialization::access
Serialization function.
Definition PoseToPointFactor.h:92
PoseToPointFactor()
default constructor - only use for serialization
Definition PoseToPointFactor.h:36