From d36836e1ec9d75034e083ac88d61fff70549000b Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Wed, 10 Jul 2013 20:24:00 +0000 Subject: [PATCH 1/6] adding some accessor functions --- gtsam/geometry/StereoPoint2.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gtsam/geometry/StereoPoint2.h b/gtsam/geometry/StereoPoint2.h index 470c3496f..acaad08d7 100644 --- a/gtsam/geometry/StereoPoint2.h +++ b/gtsam/geometry/StereoPoint2.h @@ -128,9 +128,18 @@ namespace gtsam { /// @name Standard Interface /// @{ + /// get uL + inline double uL() const {return uL_;} + + /// get uR + inline double uR() const {return uR_;} + + /// get v + inline double v() const {return v_;} + /** convert to vector */ - Vector vector() const { - return Vector_(3, uL_, uR_, v_); + Vector3 vector() const { + return Vector3(uL_, uR_, v_); } /** convenient function to get a Point2 from the left image */ From 59f2620f4ce4dec2b413596f3b59f7460bc8acc4 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Thu, 18 Jul 2013 14:09:19 +0000 Subject: [PATCH 2/6] Needed to link wrap with Boost Regex library --- wrap/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrap/CMakeLists.txt b/wrap/CMakeLists.txt index 6c1cf8d4b..399600b7e 100644 --- a/wrap/CMakeLists.txt +++ b/wrap/CMakeLists.txt @@ -1,6 +1,6 @@ # Build/install Wrap -set(WRAP_BOOST_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY}) +set(WRAP_BOOST_LIBRARIES ${Boost_SYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${Boost_REGEX_LIBRARY}) # Build the executable itself file(GLOB wrap_srcs "*.cpp") From 0889501c93303561c2b5199ff98da46a42b924bc Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Mon, 22 Jul 2013 20:25:44 +0000 Subject: [PATCH 3/6] Constructor from vector --- gtsam/geometry/Cal3_S2.h | 1 + gtsam/geometry/Cal3_S2Stereo.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/gtsam/geometry/Cal3_S2.h b/gtsam/geometry/Cal3_S2.h index b8cfda9ba..e3ae8859d 100644 --- a/gtsam/geometry/Cal3_S2.h +++ b/gtsam/geometry/Cal3_S2.h @@ -52,6 +52,7 @@ namespace gtsam { fx_(fx), fy_(fy), s_(s), u0_(u0), v0_(v0) { } + /// constructor from vector Cal3_S2(const Vector &d): fx_(d(0)), fy_(d(1)), s_(d(2)), u0_(d(3)), v0_(d(4)){} diff --git a/gtsam/geometry/Cal3_S2Stereo.h b/gtsam/geometry/Cal3_S2Stereo.h index 58fa1cd2d..811264967 100644 --- a/gtsam/geometry/Cal3_S2Stereo.h +++ b/gtsam/geometry/Cal3_S2Stereo.h @@ -49,6 +49,9 @@ namespace gtsam { K_(fx, fy, s, u0, v0), b_(b) { } + /// constructor from vector + Cal3_S2Stereo(const Vector &d): K_(d(0), d(1), d(2), d(3), d(4)), b_(d(5)){} + /// @} /// @name Testable /// @{ From 0278b0a3b7e1d205902053b157feb2e84f8de720 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Mon, 22 Jul 2013 20:26:20 +0000 Subject: [PATCH 4/6] Constructor from vector --- gtsam.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gtsam.h b/gtsam.h index ee069e0d3..ef5553220 100644 --- a/gtsam.h +++ b/gtsam.h @@ -637,6 +637,7 @@ class Cal3_S2Stereo { // Standard Constructors Cal3_S2Stereo(); Cal3_S2Stereo(double fx, double fy, double s, double u0, double v0, double b); + Cal3_S2Stereo(Vector v); // Testable void print(string s) const; From c27a551634617729eb399219a88ba5035bdf5818 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Tue, 23 Jul 2013 15:32:38 +0000 Subject: [PATCH 5/6] wrapped StereoCamera --- gtsam.h | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/gtsam.h b/gtsam.h index ef5553220..dde44c074 100644 --- a/gtsam.h +++ b/gtsam.h @@ -641,7 +641,7 @@ class Cal3_S2Stereo { // Testable void print(string s) const; - bool equals(const gtsam::Cal3_S2Stereo& pose, double tol) const; + bool equals(const gtsam::Cal3_S2Stereo& K, double tol) const; // Standard Interface double fx() const; @@ -763,6 +763,34 @@ virtual class PinholeCamera : gtsam::Value { void serialize() const; }; +virtual class StereoCamera : gtsam::Value { + // Standard Constructors and Named Constructors + StereoCamera(); + StereoCamera(const gtsam::Pose3& pose, const gtsam::Cal3_S2Stereo* K); + + // Testable + void print(string s) const; + bool equals(const gtsam::StereoCamera& camera, double tol) const; + + // Standard Interface + gtsam::Pose3 pose() const; + double baseline() const; + gtsam::Cal3_S2Stereo* calibration() const; + + // Manifold + gtsam::StereoCamera retract(const Vector& d) const; + Vector localCoordinates(const gtsam::StereoCamera& T2) const; + size_t dim() const; + static size_t Dim(); + + // Transformations and measurement functions + gtsam::StereoPoint2 project(const gtsam::Point3& point); + gtsam::Point3 backproject(const gtsam::StereoPoint2& p) const; + + // enabling serialization functionality + void serialize() const; +}; + //************************************************************************* // inference //************************************************************************* From f03983548f656b73388ed781821ad85dfa5e9519 Mon Sep 17 00:00:00 2001 From: Chris Beall Date: Thu, 25 Jul 2013 17:01:33 +0000 Subject: [PATCH 6/6] add accessors to StereoPoint2 --- gtsam.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtsam.h b/gtsam.h index dde44c074..a28bade6a 100644 --- a/gtsam.h +++ b/gtsam.h @@ -317,6 +317,9 @@ virtual class StereoPoint2 : gtsam::Value { // Standard Interface Vector vector() const; + double uL() const; + double uR() const; + double v() const; // enabling serialization functionality void serialize() const;