25 #define BETWEENFACTOR_VISIBILITY 29 #define BETWEENFACTOR_VISIBILITY GTSAM_EXPORT 60 typedef typename boost::shared_ptr<BetweenFactor>
shared_ptr;
68 Base(
model, key1, key2), measured_(measured) {
84 std::cout << s <<
"BetweenFactor(" 85 << keyFormatter(this->
key1()) <<
"," 86 << keyFormatter(this->
key2()) <<
")\n";
93 const This *
e =
dynamic_cast<const This*
> (&
expected);
103 boost::none, boost::optional<Matrix&> H2 = boost::none)
const override {
106 #ifdef SLOW_BUT_CORRECT_BETWEENFACTOR 109 if (H1) *H1 = Hlocal * (*H1);
110 if (H2) *H2 = Hlocal * (*H2);
131 template<
class ARCHIVE>
133 ar & boost::serialization::make_nvp(
"NoiseModelFactor2",
134 boost::serialization::base_object<Base>(*
this));
135 ar & BOOST_SERIALIZATION_NVP(measured_);
145 template<
class VALUE>
153 template<
class VALUE>
156 typedef boost::shared_ptr<BetweenConstraint<VALUE> >
shared_ptr;
167 friend class boost::serialization::access;
168 template<
class ARCHIVE>
170 ar & boost::serialization::make_nvp(
"BetweenFactor",
176 template<
class VALUE>
void serialize(ARCHIVE &ar, const unsigned int)
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Concept check for values that can be used in unit tests.
~BetweenFactor() override
noiseModel::Diagonal::shared_ptr model
boost::shared_ptr< BetweenConstraint< VALUE > > shared_ptr
const VALUE & measured() const
return the measurement
void serialize(ARCHIVE &ar, const unsigned int)
static const KeyFormatter DefaultKeyFormatter
const SharedNoiseModel & noiseModel() const
access to the noise model
gtsam::NonlinearFactor::shared_ptr clone() const override
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
boost::shared_ptr< BetweenFactor > shared_ptr
BetweenConstraint(const VALUE &measured, Key key1, Key key2, double mu=1000.0)
boost::shared_ptr< This > shared_ptr
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
BetweenFactor< Rot3 > Between
Array< double, 1, 3 > e(1./3., 0.5, 2.)
Base class and basic functions for Lie types.
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
assert equality up to a tolerance
BOOST_CONCEPT_ASSERT((IsTestable< VALUE >))
SharedNoiseModel noiseModel_
Non-linear factor base classes.
friend class boost::serialization::access
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print with optional string
NoiseModelFactor2< VALUE, VALUE > Base
BetweenFactor< VALUE > This
Vector evaluateError(const T &p1, const T &p2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
evaluate error, returns vector of errors size of tangent space
std::uint64_t Key
Integer nonlinear key type.
void Print(const CONTAINER &keys, const string &s, const KeyFormatter &keyFormatter)
noiseModel::Base::shared_ptr SharedNoiseModel
BetweenFactor(Key key1, Key key2, const VALUE &measured, const SharedNoiseModel &model=nullptr)