69 typedef typename std::shared_ptr<BetweenFactor> shared_ptr;
89 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
90 return std::static_pointer_cast<gtsam::NonlinearFactor>(
91 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
98 const std::string& s =
"",
100 std::cout << s <<
"BetweenFactor("
101 << keyFormatter(this->key1()) <<
","
102 << keyFormatter(this->key2()) <<
")\n";
104 this->noiseModel_->print(
" noise model: ");
109 const This *e =
dynamic_cast<const This*
> (&expected);
122#ifdef GTSAM_SLOW_BUT_CORRECT_BETWEENFACTOR
128 if (H1) *H1 = Hlocal * (*H1);
129 if (H2) *H2 = Hlocal * (*H2);
149#if GTSAM_ENABLE_BOOST_SERIALIZATION
151 friend class boost::serialization::access;
152 template<
class ARCHIVE>
153 void serialize(ARCHIVE & ar,
const unsigned int ) {
155 ar & boost::serialization::make_nvp(
"NoiseModelFactor2",
156 boost::serialization::base_object<Base>(*
this));
157 ar & BOOST_SERIALIZATION_NVP(measured_);
163 template<
class VALUE>
171 template<
class VALUE>
174 typedef std::shared_ptr<BetweenConstraint<VALUE> > shared_ptr;
185#if GTSAM_ENABLE_BOOST_SERIALIZATION
186 friend class boost::serialization::access;
187 template<
class ARCHIVE>
188 void serialize(ARCHIVE & ar,
const unsigned int ) {
189 ar & boost::serialization::make_nvp(
"BetweenFactor",
196 template<
class VALUE>
Concept check for values that can be used in unit tests.
Base class and basic functions for Lie types.
Arbitrary-arity Jacobian factor with compile-time block dimensions.
Base class for noise model factors with N variables.
Non-linear factor base classes.
#define OptionalNone
These typedefs and aliases will help with making the evaluateError interface independent of boost TOD...
Definition NonlinearFactor.h:51
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
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:846
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:33
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Lie Group Concept.
Definition Lie.h:377
Detect whether a traits type provides Local with Jacobians.
Definition Manifold.h:145
A testable concept check that should be placed in applicable unit tests and in generic algorithms.
Definition Testable.h:59
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
bool equals(const This &other, double tol=1e-9) const
check equality
Definition Factor.cpp:42
A Constrained constrained model is a specialization of Diagonal which allows some or all of the sigma...
Definition NoiseModel.h:436
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual ErrorVector evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Nonlinear factor base class.
Definition NonlinearFactor.h:70
double error(const Values &c) const override
Calculate the error of the factor.
Definition NonlinearFactor.cpp:146
A class for a measurement predicted by "between(config[key1],config[key2])".
Definition BetweenFactor.h:45
BetweenFactor()
default constructor - only use for serialization
Definition BetweenFactor.h:75
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
assert equality up to a tolerance
Definition BetweenFactor.h:108
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition BetweenFactor.h:89
const double & measured() const
Definition BetweenFactor.h:142
BetweenFactor(Key key1, Key key2, const VALUE &measured, const SharedNoiseModel &model=nullptr)
Constructor.
Definition BetweenFactor.h:78
ErrorVector evaluateError(const T &p1, const T &p2, OptionalMatrixType H1, OptionalMatrixType H2) const override
evaluate error, returns vector of errors size of tangent space
Definition BetweenFactor.h:118
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print with optional string
Definition BetweenFactor.h:97
Binary between constraint - forces between to a given value This constraint requires the underlying t...
Definition BetweenFactor.h:172
BetweenConstraint(const VALUE &measured, Key key1, Key key2, double mu=1000.0)
Syntactic sugar for constrained version.
Definition BetweenFactor.h:177