22 #include <gtsam/geometry/Unit3.h> 52 nZ_(nZ),
bRef_(bRef) {
61 template<
class ARCHIVE>
62 void serialize(ARCHIVE & ar,
const unsigned int ) {
63 ar & boost::serialization::make_nvp(
"nZ_", const_cast<Unit3&>(nZ_));
64 ar & boost::serialization::make_nvp(
"bRef_", const_cast<Unit3&>(
bRef_));
79 typedef boost::shared_ptr<Rot3AttitudeFactor>
shared_ptr;
104 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
105 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
106 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
111 DefaultKeyFormatter)
const;
118 boost::optional<Matrix&> H = boost::none)
const {
119 return attitudeError(nRb, H);
131 friend class boost::serialization::access;
132 template<
class ARCHIVE>
133 void serialize(ARCHIVE & ar,
const unsigned int ) {
134 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
135 boost::serialization::base_object<Base>(*
this));
136 ar & boost::serialization::make_nvp(
"AttitudeFactor",
137 boost::serialization::base_object<AttitudeFactor>(*
this));
141 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
184 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
185 return boost::static_pointer_cast<gtsam::NonlinearFactor>(
186 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
191 DefaultKeyFormatter)
const;
198 boost::optional<Matrix&> H = boost::none)
const {
199 Vector e = attitudeError(nTb.
rotation(), H);
202 *H = Matrix::Zero(2,6);
203 H->block<2,3>(0,0) = H23;
217 friend class boost::serialization::access;
218 template<
class ARCHIVE>
219 void serialize(ARCHIVE & ar,
const unsigned int ) {
220 ar & boost::serialization::make_nvp(
"NoiseModelFactor1",
221 boost::serialization::base_object<Base>(*
this));
222 ar & boost::serialization::make_nvp(
"AttitudeFactor",
223 boost::serialization::base_object<AttitudeFactor>(*
this));
227 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: AttitudeFactor.h:72
This is the base class for all factor types.
Definition: Factor.h:54
virtual Vector evaluateError(const Rot3 &nRb, boost::optional< Matrix & > H=boost::none) const
vector of errors
Definition: AttitudeFactor.h:117
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
boost::shared_ptr< Pose3AttitudeFactor > shared_ptr
shorthand for a smart pointer to a factor
Definition: AttitudeFactor.h:159
Definition: AttitudeFactor.h:151
Definition: AttitudeFactor.h:34
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
virtual Vector evaluateError(const Pose3 &nTb, boost::optional< Matrix & > H=boost::none) const
vector of errors
Definition: AttitudeFactor.h:197
Rot3AttitudeFactor This
Typedef to this class.
Definition: AttitudeFactor.h:82
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: AttitudeFactor.h:184
Template to create a binary predicate.
Definition: Testable.h:110
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
Pose3AttitudeFactor(Key key, const Unit3 &nZ, const SharedNoiseModel &model, const Unit3 &bRef=Unit3(0, 0, 1))
Constructor.
Definition: AttitudeFactor.h:178
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Pose3AttitudeFactor()
default constructor - only use for serialization
Definition: AttitudeFactor.h:165
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
A convenient base class for creating your own NoiseModelFactor with 1 variable.
Definition: NonlinearFactor.h:276
boost::shared_ptr< Rot3AttitudeFactor > shared_ptr
shorthand for a smart pointer to a factor
Definition: AttitudeFactor.h:79
Vector attitudeError(const Rot3 &p, OptionalJacobian< 2, 3 > H=boost::none) const
vector of errors
Definition: AttitudeFactor.cpp:26
Nonlinear factor base class.
Definition: NonlinearFactor.h:50
const Unit3 bRef_
Position measurement in.
Definition: AttitudeFactor.h:38
Rot3AttitudeFactor(Key key, const Unit3 &nZ, const SharedNoiseModel &model, const Unit3 &bRef=Unit3(0, 0, 1))
Constructor.
Definition: AttitudeFactor.h:98
Represents a 3D point on a unit sphere.
Definition: Unit3.h:42
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Non-linear factor base classes.
AttitudeFactor(const Unit3 &nZ, const Unit3 &bRef=Unit3(0, 0, 1))
Constructor.
Definition: AttitudeFactor.h:51
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: AttitudeFactor.h:104
Pose3AttitudeFactor This
Typedef to this class.
Definition: AttitudeFactor.h:162
const Rot3 & rotation(OptionalJacobian< 3, 6 > H=boost::none) const
get rotation
Definition: Pose3.cpp:272
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:1072
Rot3AttitudeFactor()
default constructor - only use for serialization
Definition: AttitudeFactor.h:85
AttitudeFactor()
default constructor - only use for serialization
Definition: AttitudeFactor.h:43
friend class boost::serialization::access
Serialization function.
Definition: AttitudeFactor.h:60