Removed spurious Testable inheritance
parent
5268de198d
commit
c4a88102ef
|
|
@ -42,7 +42,7 @@ namespace gtsam {
|
||||||
* immutable, i.e., practicing functional programming.
|
* immutable, i.e., practicing functional programming.
|
||||||
*/
|
*/
|
||||||
template<typename KEY>
|
template<typename KEY>
|
||||||
class Conditional: public gtsam::Factor<KEY>, boost::noncopyable, public Testable<Conditional<KEY> > {
|
class Conditional: public gtsam::Factor<KEY>, boost::noncopyable {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace gtsam {
|
||||||
* i.e. the main building block for visual SLAM.
|
* i.e. the main building block for visual SLAM.
|
||||||
*/
|
*/
|
||||||
template<class VALUES, class LMK, class POSK>
|
template<class VALUES, class LMK, class POSK>
|
||||||
class GenericProjectionFactor : public NonlinearFactor2<VALUES, POSK, LMK>, Testable<GenericProjectionFactor<VALUES, LMK, POSK> > {
|
class GenericProjectionFactor: public NonlinearFactor2<VALUES, POSK, LMK> {
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Keep a copy of measurement and calibration for I/O
|
// Keep a copy of measurement and calibration for I/O
|
||||||
|
|
@ -39,16 +39,16 @@ namespace gtsam {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// shorthand for base class type
|
/// shorthand for base class type
|
||||||
typedef NonlinearFactor2<VALUES, POSK, LMK> Base;
|
typedef NonlinearFactor2<VALUES, POSK, LMK> Base;
|
||||||
|
|
||||||
// shorthand for a smart pointer to a factor
|
/// shorthand for a smart pointer to a factor
|
||||||
typedef boost::shared_ptr<GenericProjectionFactor<VALUES, LMK, POSK> > shared_ptr;
|
typedef boost::shared_ptr<GenericProjectionFactor<VALUES, LMK, POSK> > shared_ptr;
|
||||||
|
|
||||||
/**
|
/// Default constructor
|
||||||
* Default constructor
|
GenericProjectionFactor() :
|
||||||
*/
|
K_(new Cal3_S2(444, 555, 666, 777, 888)) {
|
||||||
GenericProjectionFactor() : K_(new Cal3_S2(444, 555, 666, 777, 888)) {}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|
@ -58,9 +58,8 @@ namespace gtsam {
|
||||||
* @param landmarkNumber is the index of the landmark
|
* @param landmarkNumber is the index of the landmark
|
||||||
* @param K the constant calibration
|
* @param K the constant calibration
|
||||||
*/
|
*/
|
||||||
GenericProjectionFactor(const Point2& z,
|
GenericProjectionFactor(const Point2& z, const SharedNoiseModel& model,
|
||||||
const SharedNoiseModel& model, POSK j_pose,
|
POSK j_pose, LMK j_landmark, const shared_ptrK& K) :
|
||||||
LMK j_landmark, const shared_ptrK& K) :
|
|
||||||
Base(model, j_pose, j_landmark), z_(z), K_(K) {
|
Base(model, j_pose, j_landmark), z_(z), K_(K) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -73,17 +72,14 @@ namespace gtsam {
|
||||||
z_.print(s + ".z");
|
z_.print(s + ".z");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/// equals
|
||||||
* equals
|
bool equals(const GenericProjectionFactor<VALUES, LMK, POSK>& p
|
||||||
*/
|
, double tol = 1e-9) const {
|
||||||
bool equals(const GenericProjectionFactor<VALUES, LMK, POSK>& p, double tol = 1e-9) const {
|
|
||||||
return Base::equals(p, tol) && this->z_.equals(p.z_, tol)
|
return Base::equals(p, tol) && this->z_.equals(p.z_, tol)
|
||||||
&& this->K_->equals(*p.K_, tol);
|
&& this->K_->equals(*p.K_, tol);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Evaluate error h(x)-z and optionally derivatives
|
||||||
|
|
||||||
/** h(x)-z */
|
|
||||||
Vector evaluateError(const Pose3& pose, const Point3& point,
|
Vector evaluateError(const Pose3& pose, const Point3& point,
|
||||||
boost::optional<Matrix&> H1, boost::optional<Matrix&> H2) const {
|
boost::optional<Matrix&> H1, boost::optional<Matrix&> H2) const {
|
||||||
SimpleCamera camera(*K_, pose);
|
SimpleCamera camera(*K_, pose);
|
||||||
|
|
@ -92,7 +88,8 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Serialization function */
|
|
||||||
|
/// Serialization function
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
template<class ARCHIVE>
|
template<class ARCHIVE>
|
||||||
void serialize(ARCHIVE & ar, const unsigned int version) {
|
void serialize(ARCHIVE & ar, const unsigned int version) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue