Renamed NonlinearFactor[1-6] to NoiseModelFactor[1-6]
parent
3bd1aa13fc
commit
0a81c4e57a
|
@ -29,8 +29,8 @@ using namespace gtsam;
|
|||
/**
|
||||
* Unary factor for the pose.
|
||||
*/
|
||||
class ResectioningFactor: public NonlinearFactor1<Pose3> {
|
||||
typedef NonlinearFactor1<Pose3> Base;
|
||||
class ResectioningFactor: public NoiseModelFactor1<Pose3> {
|
||||
typedef NoiseModelFactor1<Pose3> Base;
|
||||
|
||||
shared_ptrK K_; // camera's intrinsic parameters
|
||||
Point3 P_; // 3D point on the calibration rig
|
||||
|
|
|
@ -46,8 +46,8 @@ namespace gtsam {
|
|||
|
||||
typedef boost::shared_ptr<ExtendedKalmanFilter<VALUE> > shared_ptr;
|
||||
typedef VALUE T;
|
||||
typedef NonlinearFactor2<VALUE, VALUE> MotionFactor;
|
||||
typedef NonlinearFactor1<VALUE> MeasurementFactor;
|
||||
typedef NoiseModelFactor2<VALUE, VALUE> MotionFactor;
|
||||
typedef NoiseModelFactor1<VALUE> MeasurementFactor;
|
||||
|
||||
protected:
|
||||
T x_; // linearization point
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace gtsam {
|
|||
* \nosubgrouping
|
||||
*/
|
||||
template<class VALUE>
|
||||
class NonlinearEquality: public NonlinearFactor1<VALUE> {
|
||||
class NonlinearEquality: public NoiseModelFactor1<VALUE> {
|
||||
|
||||
public:
|
||||
typedef VALUE T;
|
||||
|
@ -68,7 +68,7 @@ namespace gtsam {
|
|||
typedef NonlinearEquality<VALUE> This;
|
||||
|
||||
// typedef to base class
|
||||
typedef NonlinearFactor1<VALUE> Base;
|
||||
typedef NoiseModelFactor1<VALUE> Base;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -169,7 +169,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor1",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor1",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(feasible_);
|
||||
ar & BOOST_SERIALIZATION_NVP(allow_error_);
|
||||
|
@ -183,13 +183,13 @@ namespace gtsam {
|
|||
* Simple unary equality constraint - fixes a value for a variable
|
||||
*/
|
||||
template<class VALUE>
|
||||
class NonlinearEquality1 : public NonlinearFactor1<VALUE> {
|
||||
class NonlinearEquality1 : public NoiseModelFactor1<VALUE> {
|
||||
|
||||
public:
|
||||
typedef VALUE X;
|
||||
|
||||
protected:
|
||||
typedef NonlinearFactor1<VALUE> Base;
|
||||
typedef NoiseModelFactor1<VALUE> Base;
|
||||
|
||||
/** default constructor to allow for serialization */
|
||||
NonlinearEquality1() {}
|
||||
|
@ -230,7 +230,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor1",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor1",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(value_);
|
||||
}
|
||||
|
@ -242,12 +242,12 @@ namespace gtsam {
|
|||
* be the same.
|
||||
*/
|
||||
template<class VALUE>
|
||||
class NonlinearEquality2 : public NonlinearFactor2<VALUE, VALUE> {
|
||||
class NonlinearEquality2 : public NoiseModelFactor2<VALUE, VALUE> {
|
||||
public:
|
||||
typedef VALUE X;
|
||||
|
||||
protected:
|
||||
typedef NonlinearFactor2<VALUE, VALUE> Base;
|
||||
typedef NoiseModelFactor2<VALUE, VALUE> Base;
|
||||
|
||||
GTSAM_CONCEPT_MANIFOLD_TYPE(X);
|
||||
|
||||
|
@ -279,7 +279,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor2",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor2",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
}; // \NonlinearEquality2
|
||||
|
|
|
@ -294,7 +294,7 @@ private:
|
|||
/** A convenient base class for creating your own NoiseModelFactor with 1
|
||||
* variable. To derive from this class, implement evaluateError(). */
|
||||
template<class VALUE>
|
||||
class NonlinearFactor1: public NoiseModelFactor {
|
||||
class NoiseModelFactor1: public NoiseModelFactor {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -304,14 +304,14 @@ public:
|
|||
protected:
|
||||
|
||||
typedef NoiseModelFactor Base;
|
||||
typedef NonlinearFactor1<VALUE> This;
|
||||
typedef NoiseModelFactor1<VALUE> This;
|
||||
|
||||
public:
|
||||
|
||||
/** Default constructor for I/O only */
|
||||
NonlinearFactor1() {}
|
||||
NoiseModelFactor1() {}
|
||||
|
||||
virtual ~NonlinearFactor1() {}
|
||||
virtual ~NoiseModelFactor1() {}
|
||||
|
||||
inline Key key() const { return keys_[0]; }
|
||||
|
||||
|
@ -320,7 +320,7 @@ public:
|
|||
* @param z measurement
|
||||
* @param key by which to look up X value in Values
|
||||
*/
|
||||
NonlinearFactor1(const SharedNoiseModel& noiseModel, Key key1) :
|
||||
NoiseModelFactor1(const SharedNoiseModel& noiseModel, Key key1) :
|
||||
Base(noiseModel) {
|
||||
keys_.resize(1);
|
||||
keys_[0] = key1;
|
||||
|
@ -364,14 +364,14 @@ private:
|
|||
ar & boost::serialization::make_nvp("NoiseModelFactor",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
};// \class NonlinearFactor1
|
||||
};// \class NoiseModelFactor1
|
||||
|
||||
|
||||
/* ************************************************************************* */
|
||||
/** A convenient base class for creating your own NoiseModelFactor with 2
|
||||
* variables. To derive from this class, implement evaluateError(). */
|
||||
template<class VALUE1, class VALUE2>
|
||||
class NonlinearFactor2: public NoiseModelFactor {
|
||||
class NoiseModelFactor2: public NoiseModelFactor {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -382,28 +382,28 @@ public:
|
|||
protected:
|
||||
|
||||
typedef NoiseModelFactor Base;
|
||||
typedef NonlinearFactor2<VALUE1, VALUE2> This;
|
||||
typedef NoiseModelFactor2<VALUE1, VALUE2> This;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default Constructor for I/O
|
||||
*/
|
||||
NonlinearFactor2() {}
|
||||
NoiseModelFactor2() {}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param j1 key of the first variable
|
||||
* @param j2 key of the second variable
|
||||
*/
|
||||
NonlinearFactor2(const SharedNoiseModel& noiseModel, Key j1, Key j2) :
|
||||
NoiseModelFactor2(const SharedNoiseModel& noiseModel, Key j1, Key j2) :
|
||||
Base(noiseModel) {
|
||||
keys_.resize(2);
|
||||
keys_[0] = j1;
|
||||
keys_[1] = j2;
|
||||
}
|
||||
|
||||
virtual ~NonlinearFactor2() {}
|
||||
virtual ~NoiseModelFactor2() {}
|
||||
|
||||
/** methods to retrieve both keys */
|
||||
inline Key key1() const { return keys_[0]; }
|
||||
|
@ -451,13 +451,13 @@ private:
|
|||
ar & boost::serialization::make_nvp("NoiseModelFactor",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
}; // \class NonlinearFactor2
|
||||
}; // \class NoiseModelFactor2
|
||||
|
||||
/* ************************************************************************* */
|
||||
/** A convenient base class for creating your own NoiseModelFactor with 3
|
||||
* variables. To derive from this class, implement evaluateError(). */
|
||||
template<class VALUE1, class VALUE2, class VALUE3>
|
||||
class NonlinearFactor3: public NoiseModelFactor {
|
||||
class NoiseModelFactor3: public NoiseModelFactor {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -469,14 +469,14 @@ public:
|
|||
protected:
|
||||
|
||||
typedef NoiseModelFactor Base;
|
||||
typedef NonlinearFactor3<VALUE1, VALUE2, VALUE3> This;
|
||||
typedef NoiseModelFactor3<VALUE1, VALUE2, VALUE3> This;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default Constructor for I/O
|
||||
*/
|
||||
NonlinearFactor3() {}
|
||||
NoiseModelFactor3() {}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -484,7 +484,7 @@ public:
|
|||
* @param j2 key of the second variable
|
||||
* @param j3 key of the third variable
|
||||
*/
|
||||
NonlinearFactor3(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3) :
|
||||
NoiseModelFactor3(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3) :
|
||||
Base(noiseModel) {
|
||||
keys_.resize(3);
|
||||
keys_[0] = j1;
|
||||
|
@ -492,7 +492,7 @@ public:
|
|||
keys_[2] = j3;
|
||||
}
|
||||
|
||||
virtual ~NonlinearFactor3() {}
|
||||
virtual ~NoiseModelFactor3() {}
|
||||
|
||||
/** methods to retrieve keys */
|
||||
inline Key key1() const { return keys_[0]; }
|
||||
|
@ -542,13 +542,13 @@ private:
|
|||
ar & boost::serialization::make_nvp("NoiseModelFactor",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
}; // \class NonlinearFactor3
|
||||
}; // \class NoiseModelFactor3
|
||||
|
||||
/* ************************************************************************* */
|
||||
/** A convenient base class for creating your own NoiseModelFactor with 4
|
||||
* variables. To derive from this class, implement evaluateError(). */
|
||||
template<class VALUE1, class VALUE2, class VALUE3, class VALUE4>
|
||||
class NonlinearFactor4: public NoiseModelFactor {
|
||||
class NoiseModelFactor4: public NoiseModelFactor {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -561,14 +561,14 @@ public:
|
|||
protected:
|
||||
|
||||
typedef NoiseModelFactor Base;
|
||||
typedef NonlinearFactor4<VALUE1, VALUE2, VALUE3, VALUE4> This;
|
||||
typedef NoiseModelFactor4<VALUE1, VALUE2, VALUE3, VALUE4> This;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default Constructor for I/O
|
||||
*/
|
||||
NonlinearFactor4() {}
|
||||
NoiseModelFactor4() {}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -577,7 +577,7 @@ public:
|
|||
* @param j3 key of the third variable
|
||||
* @param j4 key of the fourth variable
|
||||
*/
|
||||
NonlinearFactor4(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4) :
|
||||
NoiseModelFactor4(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4) :
|
||||
Base(noiseModel) {
|
||||
keys_.resize(4);
|
||||
keys_[0] = j1;
|
||||
|
@ -586,7 +586,7 @@ public:
|
|||
keys_[3] = j4;
|
||||
}
|
||||
|
||||
virtual ~NonlinearFactor4() {}
|
||||
virtual ~NoiseModelFactor4() {}
|
||||
|
||||
/** methods to retrieve keys */
|
||||
inline Key key1() const { return keys_[0]; }
|
||||
|
@ -638,13 +638,13 @@ private:
|
|||
ar & boost::serialization::make_nvp("NoiseModelFactor",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
}; // \class NonlinearFactor4
|
||||
}; // \class NoiseModelFactor4
|
||||
|
||||
/* ************************************************************************* */
|
||||
/** A convenient base class for creating your own NoiseModelFactor with 5
|
||||
* variables. To derive from this class, implement evaluateError(). */
|
||||
template<class VALUE1, class VALUE2, class VALUE3, class VALUE4, class VALUE5>
|
||||
class NonlinearFactor5: public NoiseModelFactor {
|
||||
class NoiseModelFactor5: public NoiseModelFactor {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -658,14 +658,14 @@ public:
|
|||
protected:
|
||||
|
||||
typedef NoiseModelFactor Base;
|
||||
typedef NonlinearFactor5<VALUE1, VALUE2, VALUE3, VALUE4, VALUE5> This;
|
||||
typedef NoiseModelFactor5<VALUE1, VALUE2, VALUE3, VALUE4, VALUE5> This;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default Constructor for I/O
|
||||
*/
|
||||
NonlinearFactor5() {}
|
||||
NoiseModelFactor5() {}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -675,7 +675,7 @@ public:
|
|||
* @param j4 key of the fourth variable
|
||||
* @param j5 key of the fifth variable
|
||||
*/
|
||||
NonlinearFactor5(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5) :
|
||||
NoiseModelFactor5(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5) :
|
||||
Base(noiseModel) {
|
||||
keys_.resize(5);
|
||||
keys_[0] = j1;
|
||||
|
@ -685,7 +685,7 @@ public:
|
|||
keys_[4] = j5;
|
||||
}
|
||||
|
||||
virtual ~NonlinearFactor5() {}
|
||||
virtual ~NoiseModelFactor5() {}
|
||||
|
||||
/** methods to retrieve keys */
|
||||
inline Key key1() const { return keys_[0]; }
|
||||
|
@ -740,13 +740,13 @@ private:
|
|||
ar & boost::serialization::make_nvp("NoiseModelFactor",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
}; // \class NonlinearFactor5
|
||||
}; // \class NoiseModelFactor5
|
||||
|
||||
/* ************************************************************************* */
|
||||
/** A convenient base class for creating your own NoiseModelFactor with 6
|
||||
* variables. To derive from this class, implement evaluateError(). */
|
||||
template<class VALUE1, class VALUE2, class VALUE3, class VALUE4, class VALUE5, class VALUE6>
|
||||
class NonlinearFactor6: public NoiseModelFactor {
|
||||
class NoiseModelFactor6: public NoiseModelFactor {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -761,14 +761,14 @@ public:
|
|||
protected:
|
||||
|
||||
typedef NoiseModelFactor Base;
|
||||
typedef NonlinearFactor6<VALUE1, VALUE2, VALUE3, VALUE4, VALUE5, VALUE6> This;
|
||||
typedef NoiseModelFactor6<VALUE1, VALUE2, VALUE3, VALUE4, VALUE5, VALUE6> This;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Default Constructor for I/O
|
||||
*/
|
||||
NonlinearFactor6() {}
|
||||
NoiseModelFactor6() {}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -779,7 +779,7 @@ public:
|
|||
* @param j5 key of the fifth variable
|
||||
* @param j6 key of the fifth variable
|
||||
*/
|
||||
NonlinearFactor6(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5, Key j6) :
|
||||
NoiseModelFactor6(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5, Key j6) :
|
||||
Base(noiseModel) {
|
||||
keys_.resize(6);
|
||||
keys_[0] = j1;
|
||||
|
@ -790,7 +790,7 @@ public:
|
|||
keys_[5] = j6;
|
||||
}
|
||||
|
||||
virtual ~NonlinearFactor6() {}
|
||||
virtual ~NoiseModelFactor6() {}
|
||||
|
||||
/** methods to retrieve keys */
|
||||
inline Key key1() const { return keys_[0]; }
|
||||
|
@ -848,7 +848,7 @@ private:
|
|||
ar & boost::serialization::make_nvp("NoiseModelFactor",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
}
|
||||
}; // \class NonlinearFactor6
|
||||
}; // \class NoiseModelFactor6
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace gtsam {
|
|||
* Binary factor for a bearing measurement
|
||||
*/
|
||||
template<class POSE, class POINT>
|
||||
class BearingFactor: public NonlinearFactor2<POSE, POINT> {
|
||||
class BearingFactor: public NoiseModelFactor2<POSE, POINT> {
|
||||
private:
|
||||
|
||||
typedef POSE Pose;
|
||||
|
@ -34,7 +34,7 @@ namespace gtsam {
|
|||
typedef POINT Point;
|
||||
|
||||
typedef BearingFactor<POSE, POINT> This;
|
||||
typedef NonlinearFactor2<POSE, POINT> Base;
|
||||
typedef NoiseModelFactor2<POSE, POINT> Base;
|
||||
|
||||
Rot measured_; /** measurement */
|
||||
|
||||
|
@ -79,7 +79,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor2",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor2",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(measured_);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace gtsam {
|
|||
* Binary factor for a bearing measurement
|
||||
*/
|
||||
template<class POSE, class POINT>
|
||||
class BearingRangeFactor: public NonlinearFactor2<POSE, POINT> {
|
||||
class BearingRangeFactor: public NoiseModelFactor2<POSE, POINT> {
|
||||
private:
|
||||
|
||||
typedef POSE Pose;
|
||||
|
@ -36,7 +36,7 @@ namespace gtsam {
|
|||
typedef POINT Point;
|
||||
|
||||
typedef BearingRangeFactor<POSE, POINT> This;
|
||||
typedef NonlinearFactor2<POSE, POINT> Base;
|
||||
typedef NoiseModelFactor2<POSE, POINT> Base;
|
||||
|
||||
// the measurement
|
||||
Rot measuredBearing_;
|
||||
|
@ -106,7 +106,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor2",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor2",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(measuredBearing_);
|
||||
ar & BOOST_SERIALIZATION_NVP(measuredRange_);
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace gtsam {
|
|||
* @tparam VALUE the Value type
|
||||
*/
|
||||
template<class VALUE>
|
||||
class BetweenFactor: public NonlinearFactor2<VALUE, VALUE> {
|
||||
class BetweenFactor: public NoiseModelFactor2<VALUE, VALUE> {
|
||||
|
||||
public:
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace gtsam {
|
|||
private:
|
||||
|
||||
typedef BetweenFactor<VALUE> This;
|
||||
typedef NonlinearFactor2<VALUE, VALUE> Base;
|
||||
typedef NoiseModelFactor2<VALUE, VALUE> Base;
|
||||
|
||||
VALUE measured_; /** The measurement */
|
||||
|
||||
|
@ -106,7 +106,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor2",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor2",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(measured_);
|
||||
}
|
||||
|
|
|
@ -29,9 +29,9 @@ namespace gtsam {
|
|||
* a scalar for comparison.
|
||||
*/
|
||||
template<class VALUE>
|
||||
struct BoundingConstraint1: public NonlinearFactor1<VALUE> {
|
||||
struct BoundingConstraint1: public NoiseModelFactor1<VALUE> {
|
||||
typedef VALUE X;
|
||||
typedef NonlinearFactor1<VALUE> Base;
|
||||
typedef NoiseModelFactor1<VALUE> Base;
|
||||
typedef boost::shared_ptr<BoundingConstraint1<VALUE> > shared_ptr;
|
||||
|
||||
double threshold_;
|
||||
|
@ -84,7 +84,7 @@ private:
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor1",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor1",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(threshold_);
|
||||
ar & BOOST_SERIALIZATION_NVP(isGreaterThan_);
|
||||
|
@ -96,11 +96,11 @@ private:
|
|||
* to implement for specific systems
|
||||
*/
|
||||
template<class VALUE1, class VALUE2>
|
||||
struct BoundingConstraint2: public NonlinearFactor2<VALUE1, VALUE2> {
|
||||
struct BoundingConstraint2: public NoiseModelFactor2<VALUE1, VALUE2> {
|
||||
typedef VALUE1 X1;
|
||||
typedef VALUE2 X2;
|
||||
|
||||
typedef NonlinearFactor2<VALUE1, VALUE2> Base;
|
||||
typedef NoiseModelFactor2<VALUE1, VALUE2> Base;
|
||||
typedef boost::shared_ptr<BoundingConstraint2<VALUE1, VALUE2> > shared_ptr;
|
||||
|
||||
double threshold_;
|
||||
|
@ -157,7 +157,7 @@ private:
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor2",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor2",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(threshold_);
|
||||
ar & BOOST_SERIALIZATION_NVP(isGreaterThan_);
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace gtsam {
|
|||
*/
|
||||
template <class CAMERA, class LANDMARK>
|
||||
class GeneralSFMFactor:
|
||||
public NonlinearFactor2<CAMERA, LANDMARK> {
|
||||
public NoiseModelFactor2<CAMERA, LANDMARK> {
|
||||
protected:
|
||||
Point2 measured_; ///< the 2D measurement
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace gtsam {
|
|||
|
||||
typedef CAMERA Cam; ///< typedef for camera type
|
||||
typedef GeneralSFMFactor<CAMERA, LANDMARK> This; ///< typedef for this object
|
||||
typedef NonlinearFactor2<CAMERA, LANDMARK> Base; ///< typedef for the base class
|
||||
typedef NoiseModelFactor2<CAMERA, LANDMARK> Base; ///< typedef for the base class
|
||||
typedef Point2 Measurement; ///< typedef for the measurement
|
||||
|
||||
// shorthand for a smart pointer to a factor
|
||||
|
|
|
@ -39,14 +39,14 @@ namespace gtsam {
|
|||
* construct the mask.
|
||||
*/
|
||||
template<class VALUE>
|
||||
class PartialPriorFactor: public NonlinearFactor1<VALUE> {
|
||||
class PartialPriorFactor: public NoiseModelFactor1<VALUE> {
|
||||
|
||||
public:
|
||||
typedef VALUE T;
|
||||
|
||||
protected:
|
||||
|
||||
typedef NonlinearFactor1<VALUE> Base;
|
||||
typedef NoiseModelFactor1<VALUE> Base;
|
||||
typedef PartialPriorFactor<VALUE> This;
|
||||
|
||||
Vector prior_; ///< measurement on logmap parameters, in compressed form
|
||||
|
@ -133,7 +133,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor1",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor1",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(prior_);
|
||||
ar & BOOST_SERIALIZATION_NVP(mask_);
|
||||
|
|
|
@ -24,14 +24,14 @@ namespace gtsam {
|
|||
* A class for a soft prior on any Value type
|
||||
*/
|
||||
template<class VALUE>
|
||||
class PriorFactor: public NonlinearFactor1<VALUE> {
|
||||
class PriorFactor: public NoiseModelFactor1<VALUE> {
|
||||
|
||||
public:
|
||||
typedef VALUE T;
|
||||
|
||||
private:
|
||||
|
||||
typedef NonlinearFactor1<VALUE> Base;
|
||||
typedef NoiseModelFactor1<VALUE> Base;
|
||||
|
||||
VALUE prior_; /** The measurement */
|
||||
|
||||
|
@ -86,7 +86,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor1",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor1",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(prior_);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace gtsam {
|
|||
* i.e. the main building block for visual SLAM.
|
||||
*/
|
||||
template<class POSE, class LANDMARK>
|
||||
class GenericProjectionFactor: public NonlinearFactor2<POSE, LANDMARK> {
|
||||
class GenericProjectionFactor: public NoiseModelFactor2<POSE, LANDMARK> {
|
||||
protected:
|
||||
|
||||
// Keep a copy of measurement and calibration for I/O
|
||||
|
@ -40,7 +40,7 @@ namespace gtsam {
|
|||
public:
|
||||
|
||||
/// shorthand for base class type
|
||||
typedef NonlinearFactor2<POSE, LANDMARK> Base;
|
||||
typedef NoiseModelFactor2<POSE, LANDMARK> Base;
|
||||
|
||||
/// shorthand for this class
|
||||
typedef GenericProjectionFactor<POSE, LANDMARK> This;
|
||||
|
|
|
@ -26,13 +26,13 @@ namespace gtsam {
|
|||
* Binary factor for a range measurement
|
||||
*/
|
||||
template<class POSE, class POINT>
|
||||
class RangeFactor: public NonlinearFactor2<POSE, POINT> {
|
||||
class RangeFactor: public NoiseModelFactor2<POSE, POINT> {
|
||||
private:
|
||||
|
||||
double measured_; /** measurement */
|
||||
|
||||
typedef RangeFactor<POSE, POINT> This;
|
||||
typedef NonlinearFactor2<POSE, POINT> Base;
|
||||
typedef NoiseModelFactor2<POSE, POINT> Base;
|
||||
|
||||
typedef POSE Pose;
|
||||
typedef POINT Point;
|
||||
|
@ -79,7 +79,7 @@ namespace gtsam {
|
|||
friend class boost::serialization::access;
|
||||
template<class ARCHIVE>
|
||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||
ar & boost::serialization::make_nvp("NonlinearFactor2",
|
||||
ar & boost::serialization::make_nvp("NoiseModelFactor2",
|
||||
boost::serialization::base_object<Base>(*this));
|
||||
ar & BOOST_SERIALIZATION_NVP(measured_);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
namespace gtsam {
|
||||
|
||||
template<class POSE, class LANDMARK>
|
||||
class GenericStereoFactor: public NonlinearFactor2<POSE, LANDMARK> {
|
||||
class GenericStereoFactor: public NoiseModelFactor2<POSE, LANDMARK> {
|
||||
private:
|
||||
|
||||
// Keep a copy of measurement and calibration for I/O
|
||||
|
@ -33,7 +33,7 @@ private:
|
|||
public:
|
||||
|
||||
// shorthand for base class type
|
||||
typedef NonlinearFactor2<POSE, LANDMARK> Base; ///< typedef for base class
|
||||
typedef NoiseModelFactor2<POSE, LANDMARK> Base; ///< typedef for base class
|
||||
typedef boost::shared_ptr<GenericStereoFactor> shared_ptr; ///< typedef for shared pointer to this object
|
||||
typedef POSE CamPose; ///< typedef for Pose Lie Value type
|
||||
|
||||
|
|
|
@ -120,9 +120,9 @@ namespace simulated2D {
|
|||
* Unary factor encoding a soft prior on a vector
|
||||
*/
|
||||
template<class VALUE = Point2>
|
||||
class GenericPrior: public NonlinearFactor1<VALUE> {
|
||||
class GenericPrior: public NoiseModelFactor1<VALUE> {
|
||||
public:
|
||||
typedef NonlinearFactor1<VALUE> Base; ///< base class
|
||||
typedef NoiseModelFactor1<VALUE> Base; ///< base class
|
||||
typedef boost::shared_ptr<GenericPrior<VALUE> > shared_ptr;
|
||||
typedef VALUE Pose; ///< shortcut to Pose type
|
||||
|
||||
|
@ -157,9 +157,9 @@ namespace simulated2D {
|
|||
* Binary factor simulating "odometry" between two Vectors
|
||||
*/
|
||||
template<class VALUE = Point2>
|
||||
class GenericOdometry: public NonlinearFactor2<VALUE, VALUE> {
|
||||
class GenericOdometry: public NoiseModelFactor2<VALUE, VALUE> {
|
||||
public:
|
||||
typedef NonlinearFactor2<VALUE, VALUE> Base; ///< base class
|
||||
typedef NoiseModelFactor2<VALUE, VALUE> Base; ///< base class
|
||||
typedef boost::shared_ptr<GenericOdometry<VALUE> > shared_ptr;
|
||||
typedef VALUE Pose; ///< shortcut to Pose type
|
||||
|
||||
|
@ -196,9 +196,9 @@ namespace simulated2D {
|
|||
* Binary factor simulating "measurement" between two Vectors
|
||||
*/
|
||||
template<class POSE, class LANDMARK>
|
||||
class GenericMeasurement: public NonlinearFactor2<POSE, LANDMARK> {
|
||||
class GenericMeasurement: public NoiseModelFactor2<POSE, LANDMARK> {
|
||||
public:
|
||||
typedef NonlinearFactor2<POSE, LANDMARK> Base; ///< base class
|
||||
typedef NoiseModelFactor2<POSE, LANDMARK> Base; ///< base class
|
||||
typedef boost::shared_ptr<GenericMeasurement<POSE, LANDMARK> > shared_ptr;
|
||||
typedef POSE Pose; ///< shortcut to Pose type
|
||||
typedef LANDMARK Landmark; ///< shortcut to Landmark type
|
||||
|
|
|
@ -78,13 +78,13 @@ namespace simulated2DOriented {
|
|||
|
||||
/// Unary factor encoding a soft prior on a vector
|
||||
template<class VALUE = Pose2>
|
||||
struct GenericPosePrior: public NonlinearFactor1<VALUE> {
|
||||
struct GenericPosePrior: public NoiseModelFactor1<VALUE> {
|
||||
|
||||
Pose2 measured_; ///< measurement
|
||||
|
||||
/// Create generic pose prior
|
||||
GenericPosePrior(const Pose2& measured, const SharedNoiseModel& model, Key key) :
|
||||
NonlinearFactor1<VALUE>(model, key), measured_(measured) {
|
||||
NoiseModelFactor1<VALUE>(model, key), measured_(measured) {
|
||||
}
|
||||
|
||||
/// Evaluate error and optionally derivative
|
||||
|
@ -99,7 +99,7 @@ namespace simulated2DOriented {
|
|||
* Binary factor simulating "odometry" between two Vectors
|
||||
*/
|
||||
template<class VALUE = Pose2>
|
||||
struct GenericOdometry: public NonlinearFactor2<VALUE, VALUE> {
|
||||
struct GenericOdometry: public NoiseModelFactor2<VALUE, VALUE> {
|
||||
Pose2 measured_; ///< Between measurement for odometry factor
|
||||
|
||||
/**
|
||||
|
@ -107,7 +107,7 @@ namespace simulated2DOriented {
|
|||
*/
|
||||
GenericOdometry(const Pose2& measured, const SharedNoiseModel& model,
|
||||
Key i1, Key i2) :
|
||||
NonlinearFactor2<VALUE, VALUE>(model, i1, i2), measured_(measured) {
|
||||
NoiseModelFactor2<VALUE, VALUE>(model, i1, i2), measured_(measured) {
|
||||
}
|
||||
|
||||
/// Evaluate error and optionally derivative
|
||||
|
|
|
@ -64,7 +64,7 @@ Point3 mea(const Point3& x, const Point3& l,
|
|||
/**
|
||||
* A prior factor on a single linear robot pose
|
||||
*/
|
||||
struct PointPrior3D: public NonlinearFactor1<Point3> {
|
||||
struct PointPrior3D: public NoiseModelFactor1<Point3> {
|
||||
|
||||
Point3 measured_; ///< The prior pose value for the variable attached to this factor
|
||||
|
||||
|
@ -75,7 +75,7 @@ struct PointPrior3D: public NonlinearFactor1<Point3> {
|
|||
* @param key is the key for the pose
|
||||
*/
|
||||
PointPrior3D(const Point3& measured, const SharedNoiseModel& model, Key key) :
|
||||
NonlinearFactor1<Point3> (model, key), measured_(measured) {
|
||||
NoiseModelFactor1<Point3> (model, key), measured_(measured) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,7 @@ struct PointPrior3D: public NonlinearFactor1<Point3> {
|
|||
/**
|
||||
* Models a linear 3D measurement between 3D points
|
||||
*/
|
||||
struct Simulated3DMeasurement: public NonlinearFactor2<Point3, Point3> {
|
||||
struct Simulated3DMeasurement: public NoiseModelFactor2<Point3, Point3> {
|
||||
|
||||
Point3 measured_; ///< Linear displacement between a pose and landmark
|
||||
|
||||
|
@ -107,7 +107,7 @@ struct Simulated3DMeasurement: public NonlinearFactor2<Point3, Point3> {
|
|||
*/
|
||||
Simulated3DMeasurement(const Point3& measured, const SharedNoiseModel& model,
|
||||
Key poseKey, Key pointKey) :
|
||||
NonlinearFactor2<Point3, Point3>(model, poseKey, pointKey), measured_(measured) {}
|
||||
NoiseModelFactor2<Point3, Point3>(model, poseKey, pointKey), measured_(measured) {}
|
||||
|
||||
/**
|
||||
* Error function with optional derivatives
|
||||
|
|
|
@ -198,12 +198,12 @@ namespace example {
|
|||
0.0, cos(v.y()));
|
||||
}
|
||||
|
||||
struct UnaryFactor: public gtsam::NonlinearFactor1<Point2> {
|
||||
struct UnaryFactor: public gtsam::NoiseModelFactor1<Point2> {
|
||||
|
||||
Point2 z_;
|
||||
|
||||
UnaryFactor(const Point2& z, const SharedNoiseModel& model, Key key) :
|
||||
gtsam::NonlinearFactor1<Point2>(model, key), z_(z) {
|
||||
gtsam::NoiseModelFactor1<Point2>(model, key), z_(z) {
|
||||
}
|
||||
|
||||
Vector evaluateError(const Point2& x, boost::optional<Matrix&> A = boost::none) const {
|
||||
|
|
|
@ -88,12 +88,12 @@ TEST( ExtendedKalmanFilter, linear ) {
|
|||
|
||||
|
||||
// Create Motion Model Factor
|
||||
class NonlinearMotionModel : public NonlinearFactor2<Point2,Point2> {
|
||||
class NonlinearMotionModel : public NoiseModelFactor2<Point2,Point2> {
|
||||
public:
|
||||
typedef Point2 T;
|
||||
|
||||
private:
|
||||
typedef NonlinearFactor2<Point2, Point2> Base;
|
||||
typedef NoiseModelFactor2<Point2, Point2> Base;
|
||||
typedef NonlinearMotionModel This;
|
||||
|
||||
protected:
|
||||
|
@ -235,13 +235,13 @@ public:
|
|||
};
|
||||
|
||||
// Create Measurement Model Factor
|
||||
class NonlinearMeasurementModel : public NonlinearFactor1<Point2> {
|
||||
class NonlinearMeasurementModel : public NoiseModelFactor1<Point2> {
|
||||
public:
|
||||
typedef Point2 T;
|
||||
|
||||
private:
|
||||
|
||||
typedef NonlinearFactor1<Point2> Base;
|
||||
typedef NoiseModelFactor1<Point2> Base;
|
||||
typedef NonlinearMeasurementModel This;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -238,9 +238,9 @@ TEST( NonlinearFactor, linearize_constraint2 )
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
class TestFactor4 : public NonlinearFactor4<LieVector, LieVector, LieVector, LieVector> {
|
||||
class TestFactor4 : public NoiseModelFactor4<LieVector, LieVector, LieVector, LieVector> {
|
||||
public:
|
||||
typedef NonlinearFactor4<LieVector, LieVector, LieVector, LieVector> Base;
|
||||
typedef NoiseModeFactor4<LieVector, LieVector, LieVector, LieVector> Base;
|
||||
TestFactor4() : Base(sharedSigmas(Vector_(1, 2.0)), "x1", "x2", "x3", "x4") {}
|
||||
|
||||
virtual Vector
|
||||
|
@ -260,7 +260,7 @@ public:
|
|||
};
|
||||
|
||||
/* ************************************ */
|
||||
TEST(NonlinearFactor, NonlinearFactor4) {
|
||||
TEST(NonlinearFactor, NoiseModelFactor4) {
|
||||
TestFactor4 tf;
|
||||
Values tv;
|
||||
tv.insert("x1", LieVector(1, 1.0));
|
||||
|
@ -283,9 +283,9 @@ TEST(NonlinearFactor, NonlinearFactor4) {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
class TestFactor5 : public NonlinearFactor5<LieVector, LieVector, LieVector, LieVector, LieVector> {
|
||||
class TestFactor5 : public NoiseModelFactor5<LieVector, LieVector, LieVector, LieVector, LieVector> {
|
||||
public:
|
||||
typedef NonlinearFactor5<LieVector, LieVector, LieVector, LieVector, LieVector> Base;
|
||||
typedef NoiseModelFactor5<LieVector, LieVector, LieVector, LieVector, LieVector> Base;
|
||||
TestFactor5() : Base(sharedSigmas(Vector_(1, 2.0)), "x1", "x2", "x3", "x4", "x5") {}
|
||||
|
||||
virtual Vector
|
||||
|
@ -307,7 +307,7 @@ public:
|
|||
};
|
||||
|
||||
/* ************************************ */
|
||||
TEST(NonlinearFactor, NonlinearFactor5) {
|
||||
TEST(NonlinearFactor, NoiseModelFactor5) {
|
||||
TestFactor5 tf;
|
||||
Values tv;
|
||||
tv.insert("x1", LieVector(1, 1.0));
|
||||
|
@ -333,9 +333,9 @@ TEST(NonlinearFactor, NonlinearFactor5) {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
class TestFactor6 : public NonlinearFactor6<LieVector, LieVector, LieVector, LieVector, LieVector, LieVector> {
|
||||
class TestFactor6 : public NoiseModelFactor6<LieVector, LieVector, LieVector, LieVector, LieVector, LieVector> {
|
||||
public:
|
||||
typedef NonlinearFactor6<LieVector, LieVector, LieVector, LieVector, LieVector, LieVector> Base;
|
||||
typedef NoiseModelFactor6<LieVector, LieVector, LieVector, LieVector, LieVector, LieVector> Base;
|
||||
TestFactor6() : Base(sharedSigmas(Vector_(1, 2.0)), "x1", "x2", "x3", "x4", "x5", "x6") {}
|
||||
|
||||
virtual Vector
|
||||
|
@ -359,7 +359,7 @@ public:
|
|||
};
|
||||
|
||||
/* ************************************ */
|
||||
TEST(NonlinearFactor, NonlinearFactor6) {
|
||||
TEST(NonlinearFactor, NoiseModelFactor6) {
|
||||
TestFactor6 tf;
|
||||
Values tv;
|
||||
tv.insert("x1", LieVector(1, 1.0));
|
||||
|
|
Loading…
Reference in New Issue