Added Measurement type

release/4.3a0
dellaert 2015-02-23 12:41:33 +01:00
parent 4c7f0eba00
commit 59e6a636f2
1 changed files with 10 additions and 2 deletions

View File

@ -42,6 +42,14 @@ public:
*/ */
class GTSAM_EXPORT PinholeBase { class GTSAM_EXPORT PinholeBase {
public:
/**
* Some classes template on either PinholeCamera or StereoCamera,
* and this typedef informs those classes what "project" returns.
*/
typedef Point2 Measurement;
private: private:
Pose3 pose_; ///< 3D pose of camera Pose3 pose_; ///< 3D pose of camera
@ -263,8 +271,8 @@ public:
} }
/* ************************************************************************* */ /* ************************************************************************* */
Point2 project2(const Point3& point, OptionalJacobian<2, 6> Dpose, Point2 project2(const Point3& point, OptionalJacobian<2, 6> Dpose = boost::none,
OptionalJacobian<2, 3> Dpoint) const { OptionalJacobian<2, 3> Dpoint = boost::none) const {
Matrix3 Rt; // calculated by transform_to if needed Matrix3 Rt; // calculated by transform_to if needed
const Point3 q = pose().transform_to(point, boost::none, Dpoint ? &Rt : 0); const Point3 q = pose().transform_to(point, boost::none, Dpoint ? &Rt : 0);