made cameras virtual and simplified pose factor (with Frank)
parent
dcce21639f
commit
2d9fddbcaa
|
@ -142,7 +142,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a bunch of measurements and uses the same noise model for all of them
|
* Add a bunch of measurements and use the same noise model for all of them
|
||||||
*/
|
*/
|
||||||
void add(std::vector<Z>& measurements, std::vector<Key>& cameraKeys,
|
void add(std::vector<Z>& measurements, std::vector<Key>& cameraKeys,
|
||||||
const SharedNoiseModel& noise) {
|
const SharedNoiseModel& noise) {
|
||||||
|
@ -177,7 +177,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Collect all cameras: important that in key order
|
/// Collect all cameras: important that in key order
|
||||||
Cameras cameras(const Values& values) const {
|
virtual Cameras cameras(const Values& values) const {
|
||||||
Cameras cameras;
|
Cameras cameras;
|
||||||
BOOST_FOREACH(const Key& k, this->keys_)
|
BOOST_FOREACH(const Key& k, this->keys_)
|
||||||
cameras.push_back(values.at<CAMERA>(k));
|
cameras.push_back(values.at<CAMERA>(k));
|
||||||
|
|
|
@ -103,24 +103,6 @@ public:
|
||||||
return e && Base::equals(p, tol);
|
return e && Base::equals(p, tol);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Linearize to Gaussian Factor
|
|
||||||
* @param values Values structure which must contain camera poses for this factor
|
|
||||||
* @return a Gaussian factor
|
|
||||||
*/
|
|
||||||
boost::shared_ptr<GaussianFactor> linearizeDamped(const Values& values,
|
|
||||||
const double lambda = 0.0) const {
|
|
||||||
// depending on flag set on construction we may linearize to different linear factors
|
|
||||||
typename Base::Cameras cameras = this->cameras(values);
|
|
||||||
return Base::linearizeDamped(cameras, lambda);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// linearize
|
|
||||||
virtual boost::shared_ptr<GaussianFactor> linearize(
|
|
||||||
const Values& values) const {
|
|
||||||
return linearizeDamped(values);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* error calculates the error of the factor.
|
* error calculates the error of the factor.
|
||||||
*/
|
*/
|
||||||
|
@ -156,15 +138,6 @@ public:
|
||||||
return cameras;
|
return cameras;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Triangulate and compute derivative of error with respect to point
|
|
||||||
* @return whether triangulation worked
|
|
||||||
*/
|
|
||||||
bool triangulateAndComputeE(Matrix& E, const Values& values) const {
|
|
||||||
typename Base::Cameras cameras = this->cameras(values);
|
|
||||||
return Base::triangulateAndComputeE(E, cameras);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/// Serialization function
|
/// Serialization function
|
||||||
|
|
Loading…
Reference in New Issue