36 using NoiseModelFactor1<VALUE>::evaluateError;
46 GTSAM_CONCEPT_TESTABLE_TYPE(T)
51 typedef typename std::shared_ptr<PriorFactor<VALUE> >
shared_ptr;
63 Base(model, key), prior_(prior) {
68 Base(
noiseModel::Gaussian::Covariance(covariance), key), prior_(prior) {
72 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
74 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
79 void print(
const std::string& s,
80 const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const override {
81 std::cout << s <<
"PriorFactor on " << keyFormatter(this->
key()) <<
"\n";
83 if (this->noiseModel_)
84 this->noiseModel_->print(
" noise model: ");
86 std::cout <<
"no noise model" << std::endl;
91 const This* e =
dynamic_cast<const This*
> (&expected);
104 const VALUE & prior()
const {
return prior_; }
108 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 110 friend class boost::serialization::access;
111 template<
class ARCHIVE>
112 void serialize(ARCHIVE & ar,
const unsigned int ) {
114 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
115 boost::serialization::base_object<Base>(*
this));
116 ar & BOOST_SERIALIZATION_NVP(prior_);
121 enum { NeedsToAlign = (
sizeof(T) % 16) == 0 };
127 template<
class VALUE>
Vector evaluateError(const T &x, OptionalMatrixType H) const override
Definition: PriorFactor.h:98
Definition: NonlinearFactor.h:431
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Concept check for values that can be used in unit tests.
PriorFactor(Key key, const VALUE &prior, const Matrix &covariance)
Definition: PriorFactor.h:67
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:113
Definition: Testable.h:152
Key key() const
Definition: NonlinearFactor.h:582
Definition: NonlinearFactor.h:68
PriorFactor(Key key, const VALUE &prior, const SharedNoiseModel &model=nullptr)
Definition: PriorFactor.h:62
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign)
Definition: types.h:293
PriorFactor()
Definition: PriorFactor.h:57
const SharedNoiseModel & noiseModel() const
access to the noise model
Definition: NonlinearFactor.h:245
Matrix * OptionalMatrixType
Definition: NonlinearFactor.h:55
Definition: PriorFactor.h:30
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
Definition: chartTesting.h:28
Non-linear factor base classes.
bool equals(const NonlinearFactor &expected, double tol=1e-9) const override
Definition: PriorFactor.h:90
PriorFactor< VALUE > This
Typedef to this class.
Definition: PriorFactor.h:54
std::shared_ptr< PriorFactor< VALUE > > shared_ptr
shorthand for a smart pointer to a factor
Definition: PriorFactor.h:51
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition: PriorFactor.h:72
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
void print(const std::string &s, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Definition: PriorFactor.h:79
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:741