StereoFactor improvements
parent
cc3db4f918
commit
e55aafd9bc
|
@ -68,6 +68,21 @@ namespace gtsam {
|
||||||
return StereoCamera(pose().expmap(d),K(),baseline());
|
return StereoCamera(pose().expmap(d),K(),baseline());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Vector logmap(const StereoCamera &camera) const {
|
||||||
|
const Vector v1(leftCamPose_.logmap(camera.leftCamPose_));
|
||||||
|
return v1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool equals (const StereoCamera &camera, double tol = 1e-9) const {
|
||||||
|
return leftCamPose_.equals(camera.leftCamPose_, tol) &&
|
||||||
|
K_.equals(camera.K_, tol);
|
||||||
|
}
|
||||||
|
|
||||||
|
void print(const std::string& s = "") const {
|
||||||
|
leftCamPose_.print(s + ".camera.") ;
|
||||||
|
K_.print(s + ".calibration.") ;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** utility functions */
|
/** utility functions */
|
||||||
Matrix Dproject_to_stereo_camera1(const Point3& P) const;
|
Matrix Dproject_to_stereo_camera1(const Point3& P) const;
|
||||||
|
|
|
@ -43,6 +43,8 @@ public:
|
||||||
// shorthand for a smart pointer to a factor
|
// shorthand for a smart pointer to a factor
|
||||||
typedef boost::shared_ptr<GenericStereoFactor> shared_ptr;
|
typedef boost::shared_ptr<GenericStereoFactor> shared_ptr;
|
||||||
|
|
||||||
|
typedef typename KEY1::Value CamPose;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor
|
* Default constructor
|
||||||
*/
|
*/
|
||||||
|
@ -61,7 +63,7 @@ public:
|
||||||
Base(model, j_pose, j_landmark), z_(z), K_(K), baseline_(baseline) {
|
Base(model, j_pose, j_landmark), z_(z), K_(K), baseline_(baseline) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~GenericStereoFactor() {}
|
~GenericStereoFactor() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* print
|
* print
|
||||||
|
@ -90,7 +92,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/** h(x)-z */
|
/** h(x)-z */
|
||||||
Vector evaluateError(const Pose3& pose, const Point3& point,
|
Vector evaluateError(const CamPose& pose, const Point3& point,
|
||||||
boost::optional<Matrix&> H1, boost::optional<Matrix&> H2) const {
|
boost::optional<Matrix&> H1, boost::optional<Matrix&> H2) const {
|
||||||
StereoCamera stereoCam(pose, *K_, baseline_);
|
StereoCamera stereoCam(pose, *K_, baseline_);
|
||||||
return (stereoCam.project(point, H1, H2) - z_).vector();
|
return (stereoCam.project(point, H1, H2) - z_).vector();
|
||||||
|
|
Loading…
Reference in New Issue