clone methods
parent
5f6f4ac05a
commit
2778f2fe39
|
@ -25,6 +25,7 @@ class RotateFactor: public NoiseModelFactor1<Rot3> {
|
||||||
Point3 p_, z_; ///< Predicted and measured directions, p = iRc * z
|
Point3 p_, z_; ///< Predicted and measured directions, p = iRc * z
|
||||||
|
|
||||||
typedef NoiseModelFactor1<Rot3> Base;
|
typedef NoiseModelFactor1<Rot3> Base;
|
||||||
|
typedef RotateFactor This;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -34,6 +35,11 @@ public:
|
||||||
Base(model, key), p_(Rot3::Logmap(P)), z_(Rot3::Logmap(Z)) {
|
Base(model, key), p_(Rot3::Logmap(P)), z_(Rot3::Logmap(Z)) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @return a deep copy of this factor
|
||||||
|
virtual gtsam::NonlinearFactor::shared_ptr clone() const {
|
||||||
|
return boost::static_pointer_cast<gtsam::NonlinearFactor>(
|
||||||
|
gtsam::NonlinearFactor::shared_ptr(new This(*this))); }
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
virtual void print(const std::string& s = "",
|
virtual void print(const std::string& s = "",
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
|
||||||
|
@ -63,6 +69,7 @@ class RotateDirectionsFactor: public NoiseModelFactor1<Rot3> {
|
||||||
Sphere2 p_, z_; ///< Predicted and measured directions, p = iRc * z
|
Sphere2 p_, z_; ///< Predicted and measured directions, p = iRc * z
|
||||||
|
|
||||||
typedef NoiseModelFactor1<Rot3> Base;
|
typedef NoiseModelFactor1<Rot3> Base;
|
||||||
|
typedef RotateDirectionsFactor This;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -72,6 +79,11 @@ public:
|
||||||
Base(model, key), p_(p), z_(z) {
|
Base(model, key), p_(p), z_(z) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @return a deep copy of this factor
|
||||||
|
virtual gtsam::NonlinearFactor::shared_ptr clone() const {
|
||||||
|
return boost::static_pointer_cast<gtsam::NonlinearFactor>(
|
||||||
|
gtsam::NonlinearFactor::shared_ptr(new This(*this))); }
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
virtual void print(const std::string& s = "",
|
virtual void print(const std::string& s = "",
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
|
||||||
|
|
Loading…
Reference in New Issue