35 Base(model, key), p_(
Rot3::Logmap(P)), z_(
Rot3::Logmap(Z)) {
39 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
41 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
44 virtual void print(
const std::string& s =
"",
45 const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const {
47 std::cout <<
"RotateFactor:" << std::endl;
54 boost::optional<Matrix&> H = boost::none)
const {
58 return Vector(3) << q.
x()-p_.
x(), q.
y()-p_.
y(), q.
z()-p_.
z();
79 Base(model, key), p_(p), z_(z) {
83 virtual gtsam::NonlinearFactor::shared_ptr
clone()
const {
85 gtsam::NonlinearFactor::shared_ptr(
new This(*
this))); }
88 virtual void print(
const std::string& s =
"",
89 const KeyFormatter& keyFormatter = DefaultKeyFormatter)
const {
91 std::cout <<
"RotateDirectionsFactor:" << std::endl;
98 boost::optional<Matrix&> H = boost::none)
const {
100 Vector e = p_.
error(q, H);
Non-linear factor base classes.
void print(const std::string &s="") const
print with optional string
Definition: Point3.cpp:35
RotateFactor(Key key, const Rot3 &P, const Rot3 &Z, const SharedNoiseModel &model)
Constructor.
Definition: RotateFactor.h:33
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: RotateFactor.h:83
virtual void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print
Definition: RotateFactor.h:44
Point3 rotate(const Point3 &p, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const
rotate point from rotated coordinate frame to world
Definition: Rot3M.cpp:174
Factor on unknown rotation R that relates two directions p_i = iRc * z_c Directions provide less cons...
Definition: RotateFactor.h:67
This is the base class for all factor types.
Definition: Factor.h:51
Vector evaluateError(const Rot3 &R, boost::optional< Matrix & > H=boost::none) const
vector of errors returns 2D vector
Definition: RotateFactor.h:97
Vector error(const Unit3 &q, boost::optional< Matrix & > H=boost::none) const
Signed, vector-valued error between two directions.
Definition: Unit3.cpp:112
Represents a 3D point on a unit sphere.
Definition: Unit3.h:31
double z() const
get z
Definition: Point3.h:205
Vector evaluateError(const Rot3 &R, boost::optional< Matrix & > H=boost::none) const
vector of errors returns 2D vector
Definition: RotateFactor.h:53
double y() const
get y
Definition: Point3.h:202
size_t Key
Integer nonlinear key type.
Definition: types.h:59
A convenient base class for creating your own NoiseModelFactor with 1 variable.
Definition: NonlinearFactor.h:354
double x() const
get x
Definition: Point3.h:199
virtual gtsam::NonlinearFactor::shared_ptr clone() const
Definition: RotateFactor.h:39
RotateDirectionsFactor(Key key, const Unit3 &p, const Unit3 &z, const SharedNoiseModel &model)
Constructor.
Definition: RotateFactor.h:77
virtual void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
Print.
Definition: NonlinearFactor.h:231
void print(const std::string &s=std::string()) const
The print fuction.
Definition: Unit3.cpp:102
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:884
Nonlinear factor base class.
Definition: NonlinearFactor.h:54
virtual void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
print
Definition: RotateFactor.h:88
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: types.h:62
3D rotation represented as a rotation matrix or quaternion
Factor on unknown rotation iRC that relates two incremental rotations c1Rc2 = iRc' * i1Ri2 * iRc Whic...
Definition: RotateFactor.h:23