From 1e76082888d316503174e12738b76c47ceb11f3e Mon Sep 17 00:00:00 2001
From: jing
Date: Sun, 9 Mar 2014 00:40:02 -0500
Subject: [PATCH 001/101] add unified projection model: a calibration class for
omni-directional camera. Not test yet
---
gtsam/geometry/Cal3Unify.cpp | 201 +++++++++++++++++++++++++++++++++++
gtsam/geometry/Cal3Unify.h | 168 +++++++++++++++++++++++++++++
2 files changed, 369 insertions(+)
create mode 100644 gtsam/geometry/Cal3Unify.cpp
create mode 100644 gtsam/geometry/Cal3Unify.h
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
new file mode 100644
index 000000000..d49417492
--- /dev/null
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -0,0 +1,201 @@
+/* ----------------------------------------------------------------------------
+
+ * GTSAM Copyright 2010, Georgia Tech Research Corporation,
+ * Atlanta, Georgia 30332-0415
+ * All Rights Reserved
+ * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
+
+ * See LICENSE for the license information
+
+ * -------------------------------------------------------------------------- */
+
+/**
+ * @file Cal3Unify.cpp
+ * @date Mar 8, 2014
+ * @author Jing Dong
+ */
+
+#include
+#include
+#include
+#include
+
+#include
+
+namespace gtsam {
+
+/* ************************************************************************* */
+Cal3Unify::Cal3Unify(const Vector &v):
+ xi_(v[0]), fx_(v[1]), fy_(v[2]), s_(v[3]), u0_(v[4]), v0_(v[5]), k1_(v[6]), k2_(v[7]), k3_(v[8]), k4_(v[9]){}
+
+/* ************************************************************************* */
+Matrix Cal3Unify::K() const {
+ return (Matrix(3, 3) << fx_, s_, u0_, 0.0, fy_, v0_, 0.0, 0.0, 1.0);
+}
+
+/* ************************************************************************* */
+Vector Cal3Unify::vector() const {
+ return (Vector(10) << xi_, fx_, fy_, s_, u0_, v0_, k1_, k2_, k3_, k4_);
+}
+
+/* ************************************************************************* */
+void Cal3Unify::print(const std::string& s) const {
+ gtsam::print(K(), s + ".K");
+ gtsam::print(Vector(k()), s + ".k");
+ gtsam::print(Vector(xi_), s + ".xi");
+}
+
+/* ************************************************************************* */
+bool Cal3Unify::equals(const Cal3Unify& K, double tol) const {
+ if (fabs(fx_ - K.fx_) > tol || fabs(fy_ - K.fy_) > tol || fabs(s_ - K.s_) > tol ||
+ fabs(u0_ - K.u0_) > tol || fabs(v0_ - K.v0_) > tol || fabs(k1_ - K.k1_) > tol ||
+ fabs(k2_ - K.k2_) > tol || fabs(k3_ - K.k3_) > tol || fabs(k4_ - K.k4_) > tol ||
+ fabs(xi_ - K.xi_) > tol)
+ return false;
+ return true;
+}
+
+/* ************************************************************************* */
+Point2 Cal3Unify::uncalibrate(const Point2& p,
+ boost::optional H1,
+ boost::optional H2) const {
+
+ // this part of code is modified from Cal3DS2,
+ // since the second part of this model (after project to normalized plane)
+ // is same as Cal3DS2
+
+ // parameters
+ const double xi = xi_, fx = fx_, fy = fy_, s = s_;
+ const double k1 = k1_, k2 = k2_, k3 = k3_, k4 = k4_;
+
+ // Part1: project 3D space to NPlane
+ const double xs = p.x(), ys = p.y(); // normalized points in 3D space
+ const double sqrt_nx = sqrt(xs * xs + ys * ys + 1.0);
+ const double xi_sqrt_nx = 1 + xi * sqrt_nx;
+ const double xi_sqrt_nx2 = xi_sqrt_nx * xi_sqrt_nx;
+ const double x = xs / xi_sqrt_nx, y = ys / xi_sqrt_nx; // points on NPlane
+
+ // Part2: project NPlane point to pixel plane: same as Cal3DS2
+ const double xy = x * y, xx = x * x, yy = y * y;
+ const double rr = xx + yy;
+ const double r4 = rr * rr;
+ const double g = 1. + k1 * rr + k2 * r4;
+ const double dx = 2. * k3 * xy + k4 * (rr + 2. * xx);
+ const double dy = 2. * k4 * xy + k3 * (rr + 2. * yy);
+
+ const double pnx = g*x + dx;
+ const double pny = g*y + dy;
+
+ // DDS2 will be used both in H1 and H2
+ Matrix DDS2;
+ if (H1 || H2) {
+ // part2
+ const double dr_dx = 2. * x;
+ const double dr_dy = 2. * y;
+ const double dg_dx = k1 * dr_dx + k2 * 2. * rr * dr_dx;
+ const double dg_dy = k1 * dr_dy + k2 * 2. * rr * dr_dy;
+
+ const double dDx_dx = 2. * k3 * y + k4 * (dr_dx + 4. * x);
+ const double dDx_dy = 2. * k3 * x + k4 * dr_dy;
+ const double dDy_dx = 2. * k4 * y + k3 * dr_dx;
+ const double dDy_dy = 2. * k4 * x + k3 * (dr_dy + 4. * y);
+
+ Matrix DK = (Matrix(2, 2) << fx, s_, 0.0, fy);
+ Matrix DR = (Matrix(2, 2) << g + x * dg_dx + dDx_dx, x * dg_dy + dDx_dy,
+ y * dg_dx + dDy_dx, g + y * dg_dy + dDy_dy);
+
+ DDS2 = DK * DR;
+ }
+
+ // Inlined derivative for calibration
+ if (H1) {
+ // part1
+ Matrix DU = (Matrix(2,1) << xs * sqrt_nx / xi_sqrt_nx2,
+ ys * sqrt_nx / xi_sqrt_nx2);
+ Matrix DDS2U = DDS2 * DU;
+ // part2
+ Matrix DDS2V = (Matrix(2, 9) << pnx, 0.0, pny, 1.0, 0.0, fx * x * rr + s * y * rr,
+ fx * x * r4 + s * y * r4, fx * 2. * xy + s * (rr + 2. * yy),
+ fx * (rr + 2. * xx) + s * (2. * xy), 0.0, pny, 0.0, 0.0, 1.0,
+ fy * y * rr, fy * y * r4, fy * (rr + 2. * yy), fy * (2. * xy));
+
+ *H1 = collect(2, &DDS2U, &DDS2V);
+ }
+ // Inlined derivative for points
+ if (H2) {
+ // part1
+ Matrix DU = (Matrix(2, 2) << (xi_sqrt_nx - xs * xs / sqrt_nx) / xi_sqrt_nx2,
+ -(ys * ys / (sqrt_nx * xi_sqrt_nx2)),
+ -(xs * xs / (sqrt_nx * xi_sqrt_nx2)),
+ (xi_sqrt_nx - ys * ys / sqrt_nx) / xi_sqrt_nx2);
+
+ *H2 = DDS2 * DU;
+ }
+
+
+ return Point2(fx * pnx + s * pny + u0_, fy * pny + v0_);
+}
+
+/* ************************************************************************* */
+Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
+ // Use the following fixed point iteration to invert the radial distortion.
+ // pn_{t+1} = (inv(K)*pi - dp(pn_{t})) / g(pn_{t})
+
+ // point on the normalized plane, input for DS2
+ Point2 pnpl = this->imageToNPlane(pi);
+ double px = pnpl.x();
+ double py = pnpl.y();
+ const Point2 invKPi ((1 / fx_) * (px - u0_ - (s_ / fy_) * (py - v0_)),
+ (1 / fy_) * (py - v0_));
+
+ // initialize by ignoring the distortion at all, might be problematic for pixels around boundary
+ Point2 pn = invKPi;
+
+ // iterate until the uncalibrate is close to the actual pixel coordinate
+ const int maxIterations = 10;
+ int iteration;
+ for ( iteration = 0; iteration < maxIterations; ++iteration ) {
+
+ if ( uncalibrate(pn).distance(pi) <= tol ) break;
+
+ // part1: image -> normalized plane
+ pnpl = this->imageToNPlane(pn);
+ // part2: normalized plane -> 3D space
+ px = pnpl.x(), py = pnpl.y();
+ const double xy = px*py, xx = px*px, yy = py*py;
+ const double rr = xx + yy;
+ const double g = (1+k1_*rr+k2_*rr*rr);
+ const double dx = 2*k3_*xy + k4_*(rr+2*xx);
+ const double dy = 2*k4_*xy + k3_*(rr+2*yy);
+ pn = (invKPi - Point2(dx,dy))/g;
+ }
+
+ if ( iteration >= maxIterations )
+ throw std::runtime_error("Cal3DS2::calibrate fails to converge. need a better initialization");
+
+ return pn;
+}
+/* ************************************************************************* */
+Point2 Cal3Unify::imageToNPlane(const Point2& p) const {
+
+ const double x = p.x(), y = p.y();
+ const double xy2 = x * x + y * y;
+ const double sq_xy = (xi_ + sqrt(1 + (1 - xi_ * xi_) * xy2)) / (xy2 + 1);
+
+ return Point2((sq_xy * x / (sq_xy - xi_)), (sq_xy * y / (sq_xy - xi_)));
+}
+
+/* ************************************************************************* */
+Cal3Unify Cal3Unify::retract(const Vector& d) const {
+ return Cal3Unify(vector() + d);
+}
+
+/* ************************************************************************* */
+Vector Cal3Unify::localCoordinates(const Cal3Unify& T2) const {
+ return T2.vector() - vector();
+}
+
+}
+/* ************************************************************************* */
+
+
diff --git a/gtsam/geometry/Cal3Unify.h b/gtsam/geometry/Cal3Unify.h
new file mode 100644
index 000000000..58f19ece5
--- /dev/null
+++ b/gtsam/geometry/Cal3Unify.h
@@ -0,0 +1,168 @@
+/* ----------------------------------------------------------------------------
+
+ * GTSAM Copyright 2010, Georgia Tech Research Corporation,
+ * Atlanta, Georgia 30332-0415
+ * All Rights Reserved
+ * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
+
+ * See LICENSE for the license information
+
+ * -------------------------------------------------------------------------- */
+
+/**
+ * @file Cal3Unify.h
+ * @brief Unified Calibration Model, see Mei07icra for details
+ * @date Mar 8, 2014
+ * @author Jing Dong
+ */
+
+/**
+ * @addtogroup geometry
+ */
+
+#pragma once
+
+#include
+#include
+
+namespace gtsam {
+
+/**
+ * @brief Calibration of a omni-directional camera with mirror + lens radial distortion
+ * @addtogroup geometry
+ * \nosubgrouping
+ */
+class GTSAM_EXPORT Cal3Unify : public DerivedValue {
+
+private:
+
+ double xi_; // mirror parameter
+ double fx_, fy_, s_, u0_, v0_ ; // focal length, skew and principal point
+ double k1_, k2_ ; // radial 2nd-order and 4th-order
+ double k3_, k4_ ; // tangential distortion
+
+ // K = [ fx s u0 ; 0 fy v0 ; 0 0 1 ]
+ // Pn = [ P.x / (1 + xi * \sqrt{P.x^2 + P.y^2 + 1}), P.y / (1 + xi * \sqrt{P.x^2 + P.y^2 + 1})]
+ // rr = Pn.x^2 + Pn.y^2
+ // \hat{pn} = (1 + k1*rr + k2*rr^2 ) pn + [ 2*k3 pn.x pn.y + k4 (rr + 2 Pn.x^2) ;
+ // k3 (rr + 2 Pn.y^2) + 2*k4 pn.x pn.y ]
+ // pi = K*pn
+
+public:
+ Matrix K() const ;
+ Eigen::Vector4d k() const { return Eigen::Vector4d(k1_, k2_, k3_, k4_); }
+ Vector vector() const ;
+
+ /// @name Standard Constructors
+ /// @{
+
+ /// Default Constructor with only unit focal length
+ Cal3Unify() : xi_(0), fx_(1), fy_(1), s_(0), u0_(0), v0_(0), k1_(0), k2_(0), k3_(0), k4_(0) {}
+
+ Cal3Unify(double xi, double fx, double fy, double s, double u0, double v0,
+ double k1, double k2, double k3 = 0.0, double k4 = 0.0) :
+ xi_(xi), fx_(fx), fy_(fy), s_(s), u0_(u0), v0_(v0), k1_(k1), k2_(k2), k3_(k3), k4_(k4) {}
+
+ /// @}
+ /// @name Advanced Constructors
+ /// @{
+
+ Cal3Unify(const Vector &v) ;
+
+ /// @}
+ /// @name Testable
+ /// @{
+
+ /// print with optional string
+ void print(const std::string& s = "") const ;
+
+ /// assert equality up to a tolerance
+ bool equals(const Cal3Unify& K, double tol = 10e-9) const;
+
+ /// @}
+ /// @name Standard Interface
+ /// @{
+
+ /// mirror parameter
+ inline double xi() const { return xi_;}
+
+ /// focal length x
+ inline double fx() const { return fx_;}
+
+ /// focal length y
+ inline double fy() const { return fy_;}
+
+ /// skew
+ inline double skew() const { return s_;}
+
+ /// image center in x
+ inline double px() const { return u0_;}
+
+ /// image center in y
+ inline double py() const { return v0_;}
+
+ /**
+ * convert intrinsic coordinates xy to image coordinates uv
+ * @param p point in intrinsic coordinates
+ * @param Dcal optional 2*9 Jacobian wrpt Cal3DS2 parameters
+ * @param Dp optional 2*2 Jacobian wrpt intrinsic coordinates
+ * @return point in image coordinates
+ */
+ Point2 uncalibrate(const Point2& p,
+ boost::optional Dcal = boost::none,
+ boost::optional Dp = boost::none) const ;
+
+ /// Conver a pixel coordinate to ideal coordinate
+ Point2 calibrate(const Point2& p, const double tol=1e-5) const;
+
+ /// Convert a image point to normalized unit plane
+ Point2 imageToNPlane(const Point2& p) const;
+
+ /// @}
+ /// @name Manifold
+ /// @{
+
+ /// Given delta vector, update calibration
+ Cal3Unify retract(const Vector& d) const ;
+
+ /// Given a different calibration, calculate update to obtain it
+ Vector localCoordinates(const Cal3Unify& T2) const ;
+
+ /// Return dimensions of calibration manifold object
+ virtual size_t dim() const { return 10 ; } //TODO: make a final dimension variable (also, usually size_t in other classes e.g. Pose2)
+
+ /// Return dimensions of calibration manifold object
+ static size_t Dim() { return 10; } //TODO: make a final dimension variable
+
+private:
+
+ /// @}
+ /// @name Advanced Interface
+ /// @{
+
+ /** Serialization function */
+ friend class boost::serialization::access;
+ template
+ void serialize(Archive & ar, const unsigned int version)
+ {
+ ar & boost::serialization::make_nvp("Cal3Unify",
+ boost::serialization::base_object(*this));
+ ar & BOOST_SERIALIZATION_NVP(xi_);
+ ar & BOOST_SERIALIZATION_NVP(fx_);
+ ar & BOOST_SERIALIZATION_NVP(fy_);
+ ar & BOOST_SERIALIZATION_NVP(s_);
+ ar & BOOST_SERIALIZATION_NVP(u0_);
+ ar & BOOST_SERIALIZATION_NVP(v0_);
+ ar & BOOST_SERIALIZATION_NVP(k1_);
+ ar & BOOST_SERIALIZATION_NVP(k2_);
+ ar & BOOST_SERIALIZATION_NVP(k3_);
+ ar & BOOST_SERIALIZATION_NVP(k4_);
+ }
+
+
+ /// @}
+
+};
+
+}
+
From e311e993ad8956ca64f3d48d1b3fd8f9745544e5 Mon Sep 17 00:00:00 2001
From: jing
Date: Sun, 9 Mar 2014 01:18:06 -0500
Subject: [PATCH 002/101] add unit test
---
gtsam/geometry/tests/testCal3Unify.cpp | 91 ++++++++++++++++++++++++++
1 file changed, 91 insertions(+)
create mode 100644 gtsam/geometry/tests/testCal3Unify.cpp
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
new file mode 100644
index 000000000..775f95159
--- /dev/null
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -0,0 +1,91 @@
+/* ----------------------------------------------------------------------------
+
+ * GTSAM Copyright 2010, Georgia Tech Research Corporation,
+ * Atlanta, Georgia 30332-0415
+ * All Rights Reserved
+ * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
+
+ * See LICENSE for the license information
+
+ * -------------------------------------------------------------------------- */
+
+/**
+ * @file testCal3Unify.cpp
+ * @brief Unit tests for transform derivatives
+ */
+
+#include
+#include
+#include
+#include
+
+using namespace gtsam;
+
+GTSAM_CONCEPT_TESTABLE_INST(Cal3Unify)
+GTSAM_CONCEPT_MANIFOLD_INST(Cal3Unify)
+
+/* ground truth data will from matlab, code :
+X = [2 3 1]';
+V = [0.01, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0, 0, 100, 105, 320, 240];
+[P, J] = spaceToImgPlane(X, V);
+matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox */
+
+static Cal3Unify K(0.01, 100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3);
+static Point2 p(2,3);
+
+/* ************************************************************************* */
+TEST( Cal3Unify, uncalibrate)
+{
+ Point2 p_i(582.5228344366194, 649.6685266099726) ;
+ Point2 q = K.uncalibrate(p);
+ CHECK(assert_equal(q,p_i));
+}
+
+TEST( Cal3Unify, calibrate )
+{
+ Point2 pi = K.uncalibrate(p);
+ Point2 pn_hat = K.calibrate(pi);
+ CHECK( p.equals(pn_hat, 1e-5));
+}
+
+Point2 uncalibrate_(const Cal3Unify& k, const Point2& pt) { return k.uncalibrate(pt); }
+
+/* ************************************************************************* */
+TEST( Cal3Unify, Duncalibrate1)
+{
+ Matrix computed;
+ K.uncalibrate(p, computed, boost::none);
+ Matrix numerical = numericalDerivative21(uncalibrate_, K, p, 1e-7);
+ CHECK(assert_equal(numerical,computed,1e-5));
+}
+
+/* ************************************************************************* */
+TEST( Cal3Unify, Duncalibrate2)
+{
+ Matrix computed;
+ K.uncalibrate(p, boost::none, computed);
+ Matrix numerical = numericalDerivative22(uncalibrate_, K, p, 1e-7);
+ CHECK(assert_equal(numerical,computed,1e-5));
+}
+
+/* ************************************************************************* */
+TEST( Cal3Unify, assert_equal)
+{
+ CHECK(assert_equal(K,K,1e-5));
+}
+
+/* ************************************************************************* */
+TEST( Cal3Unify, retract)
+{
+ Cal3Unify expected(0.01 + 1, 100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
+ 1e-3 + 7, 2.0*1e-3 + 8, 3.0*1e-3 + 9, 4.0*1e-3 + 10);
+ Vector d(10);
+ d << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+ Cal3Unify actual = K.retract(d);
+ CHECK(assert_equal(expected,actual,1e-7));
+ CHECK(assert_equal(d,K.localCoordinates(actual),1e-7));
+}
+
+/* ************************************************************************* */
+int main() { TestResult tr; return TestRegistry::runAllTests(tr); }
+/* ************************************************************************* */
From b43b84b59a20e2fc98907e613f1ca13c0ae56b3d Mon Sep 17 00:00:00 2001
From: jing
Date: Sun, 9 Mar 2014 03:34:57 -0400
Subject: [PATCH 003/101] some bug fixed, still not pass unit test: calibrate()
converge so slow, and Jacobians are buggy
---
gtsam/geometry/Cal3Unify.cpp | 31 +++++++++++++++++---------
gtsam/geometry/Cal3Unify.h | 7 ++++--
gtsam/geometry/tests/testCal3Unify.cpp | 22 +++++++++++++-----
3 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
index d49417492..1ddbcd2b2 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -142,24 +142,24 @@ Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
// pn_{t+1} = (inv(K)*pi - dp(pn_{t})) / g(pn_{t})
// point on the normalized plane, input for DS2
- Point2 pnpl = this->imageToNPlane(pi);
- double px = pnpl.x();
- double py = pnpl.y();
+ double px = pi.x();
+ double py = pi.y();
const Point2 invKPi ((1 / fx_) * (px - u0_ - (s_ / fy_) * (py - v0_)),
(1 / fy_) * (py - v0_));
// initialize by ignoring the distortion at all, might be problematic for pixels around boundary
- Point2 pn = invKPi;
+ Point2 pn = nPlaneToSpace(invKPi);
// iterate until the uncalibrate is close to the actual pixel coordinate
- const int maxIterations = 10;
+ const int maxIterations = 100;
int iteration;
for ( iteration = 0; iteration < maxIterations; ++iteration ) {
- if ( uncalibrate(pn).distance(pi) <= tol ) break;
+ pn.print();
+ if ( pn.distance(pi) <= tol ) break;
- // part1: image -> normalized plane
- pnpl = this->imageToNPlane(pn);
+ // part1: 3D space -> normalized plane
+ Point2 pnpl = spaceToNPlane(pn);
// part2: normalized plane -> 3D space
px = pnpl.x(), py = pnpl.y();
const double xy = px*py, xx = px*px, yy = py*py;
@@ -167,16 +167,16 @@ Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
const double g = (1+k1_*rr+k2_*rr*rr);
const double dx = 2*k3_*xy + k4_*(rr+2*xx);
const double dy = 2*k4_*xy + k3_*(rr+2*yy);
- pn = (invKPi - Point2(dx,dy))/g;
+ pn = nPlaneToSpace((invKPi - Point2(dx,dy))/g);
}
if ( iteration >= maxIterations )
- throw std::runtime_error("Cal3DS2::calibrate fails to converge. need a better initialization");
+ throw std::runtime_error("Cal3Unify::calibrate fails to converge. need a better initialization");
return pn;
}
/* ************************************************************************* */
-Point2 Cal3Unify::imageToNPlane(const Point2& p) const {
+Point2 Cal3Unify::nPlaneToSpace(const Point2& p) const {
const double x = p.x(), y = p.y();
const double xy2 = x * x + y * y;
@@ -185,6 +185,15 @@ Point2 Cal3Unify::imageToNPlane(const Point2& p) const {
return Point2((sq_xy * x / (sq_xy - xi_)), (sq_xy * y / (sq_xy - xi_)));
}
+/* ************************************************************************* */
+Point2 Cal3Unify::spaceToNPlane(const Point2& p) const {
+
+ const double x = p.x(), y = p.y();
+ const double sq_xy = 1 + xi_ * sqrt(x * x + y * y + 1);
+
+ return Point2((x / sq_xy), (y / sq_xy));
+}
+
/* ************************************************************************* */
Cal3Unify Cal3Unify::retract(const Vector& d) const {
return Cal3Unify(vector() + d);
diff --git a/gtsam/geometry/Cal3Unify.h b/gtsam/geometry/Cal3Unify.h
index 58f19ece5..4d70db051 100644
--- a/gtsam/geometry/Cal3Unify.h
+++ b/gtsam/geometry/Cal3Unify.h
@@ -115,8 +115,11 @@ public:
/// Conver a pixel coordinate to ideal coordinate
Point2 calibrate(const Point2& p, const double tol=1e-5) const;
- /// Convert a image point to normalized unit plane
- Point2 imageToNPlane(const Point2& p) const;
+ /// Convert a 3D point to normalized unit plane
+ Point2 spaceToNPlane(const Point2& p) const;
+
+ /// Convert a normalized unit plane point to 3D space
+ Point2 nPlaneToSpace(const Point2& p) const;
/// @}
/// @name Manifold
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
index 775f95159..9ff9d7646 100644
--- a/gtsam/geometry/tests/testCal3Unify.cpp
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -19,16 +19,20 @@
#include
#include
-using namespace gtsam;
+#include
+using namespace gtsam;
+using namespace std;
GTSAM_CONCEPT_TESTABLE_INST(Cal3Unify)
GTSAM_CONCEPT_MANIFOLD_INST(Cal3Unify)
-/* ground truth data will from matlab, code :
+/*
+ground truth from matlab, code :
X = [2 3 1]';
V = [0.01, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0, 0, 100, 105, 320, 240];
[P, J] = spaceToImgPlane(X, V);
-matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox */
+matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox
+*/
static Cal3Unify K(0.01, 100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3);
static Point2 p(2,3);
@@ -41,10 +45,18 @@ TEST( Cal3Unify, uncalibrate)
CHECK(assert_equal(q,p_i));
}
-TEST( Cal3Unify, calibrate )
+/* ************************************************************************* */
+TEST( Cal3Unify, spaceNplane)
+{
+ Point2 q = K.spaceToNPlane(p);
+ CHECK(assert_equal(p, K.nPlaneToSpace(q)));
+}
+
+/* ************************************************************************* */
+TEST( Cal3Unify, calibrate)
{
Point2 pi = K.uncalibrate(p);
- Point2 pn_hat = K.calibrate(pi);
+ Point2 pn_hat = K.calibrate(pi, 1);
CHECK( p.equals(pn_hat, 1e-5));
}
From 4affb9a0d2d9a5ecc0141f6f0f4e7ce6d3cae4b4 Mon Sep 17 00:00:00 2001
From: jing
Date: Mon, 10 Mar 2014 16:27:41 -0400
Subject: [PATCH 004/101] fix jacobians, calibration still buggy
---
gtsam/geometry/Cal3Unify.cpp | 19 ++++++++++---------
gtsam/geometry/tests/testCal3Unify.cpp | 6 +++---
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
index 1ddbcd2b2..5f2e330bd 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -42,7 +42,7 @@ Vector Cal3Unify::vector() const {
void Cal3Unify::print(const std::string& s) const {
gtsam::print(K(), s + ".K");
gtsam::print(Vector(k()), s + ".k");
- gtsam::print(Vector(xi_), s + ".xi");
+ gtsam::print((Vector)(Vector(1) << xi_), s + ".xi");
}
/* ************************************************************************* */
@@ -71,9 +71,9 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
// Part1: project 3D space to NPlane
const double xs = p.x(), ys = p.y(); // normalized points in 3D space
const double sqrt_nx = sqrt(xs * xs + ys * ys + 1.0);
- const double xi_sqrt_nx = 1 + xi * sqrt_nx;
+ const double xi_sqrt_nx = 1.0 / (1 + xi * sqrt_nx);
const double xi_sqrt_nx2 = xi_sqrt_nx * xi_sqrt_nx;
- const double x = xs / xi_sqrt_nx, y = ys / xi_sqrt_nx; // points on NPlane
+ const double x = xs * xi_sqrt_nx, y = ys * xi_sqrt_nx; // points on NPlane
// Part2: project NPlane point to pixel plane: same as Cal3DS2
const double xy = x * y, xx = x * x, yy = y * y;
@@ -110,8 +110,8 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
// Inlined derivative for calibration
if (H1) {
// part1
- Matrix DU = (Matrix(2,1) << xs * sqrt_nx / xi_sqrt_nx2,
- ys * sqrt_nx / xi_sqrt_nx2);
+ Matrix DU = (Matrix(2,1) << -xs * sqrt_nx * xi_sqrt_nx2,
+ -ys * sqrt_nx * xi_sqrt_nx2);
Matrix DDS2U = DDS2 * DU;
// part2
Matrix DDS2V = (Matrix(2, 9) << pnx, 0.0, pny, 1.0, 0.0, fx * x * rr + s * y * rr,
@@ -124,10 +124,11 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
// Inlined derivative for points
if (H2) {
// part1
- Matrix DU = (Matrix(2, 2) << (xi_sqrt_nx - xs * xs / sqrt_nx) / xi_sqrt_nx2,
- -(ys * ys / (sqrt_nx * xi_sqrt_nx2)),
- -(xs * xs / (sqrt_nx * xi_sqrt_nx2)),
- (xi_sqrt_nx - ys * ys / sqrt_nx) / xi_sqrt_nx2);
+ const double denom = 1.0 * xi_sqrt_nx2 / sqrt_nx;
+ const double mid = -(xi * xs*ys) * denom;
+ Matrix DU = (Matrix(2, 2) <<
+ (sqrt_nx + xi*(ys*ys + 1)) * denom, mid,
+ mid, (sqrt_nx + xi*(xs*xs + 1)) * denom);
*H2 = DDS2 * DU;
}
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
index 9ff9d7646..3995e03b2 100644
--- a/gtsam/geometry/tests/testCal3Unify.cpp
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -35,7 +35,7 @@ matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox
*/
static Cal3Unify K(0.01, 100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3);
-static Point2 p(2,3);
+static Point2 p(2, 3);
/* ************************************************************************* */
TEST( Cal3Unify, uncalibrate)
@@ -68,7 +68,7 @@ TEST( Cal3Unify, Duncalibrate1)
Matrix computed;
K.uncalibrate(p, computed, boost::none);
Matrix numerical = numericalDerivative21(uncalibrate_, K, p, 1e-7);
- CHECK(assert_equal(numerical,computed,1e-5));
+ CHECK(assert_equal(numerical,computed,1e-6));
}
/* ************************************************************************* */
@@ -77,7 +77,7 @@ TEST( Cal3Unify, Duncalibrate2)
Matrix computed;
K.uncalibrate(p, boost::none, computed);
Matrix numerical = numericalDerivative22(uncalibrate_, K, p, 1e-7);
- CHECK(assert_equal(numerical,computed,1e-5));
+ CHECK(assert_equal(numerical,computed,1e-6));
}
/* ************************************************************************* */
From 7ff7482792b9586682269a486a0612c380ffa86e Mon Sep 17 00:00:00 2001
From: jing
Date: Mon, 10 Mar 2014 17:09:56 -0400
Subject: [PATCH 005/101] all unit test failure fixed
---
gtsam/geometry/Cal3Unify.cpp | 5 ++---
gtsam/geometry/tests/testCal3Unify.cpp | 23 +++++++++++------------
2 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
index 5f2e330bd..8e200ff2a 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -152,12 +152,11 @@ Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
Point2 pn = nPlaneToSpace(invKPi);
// iterate until the uncalibrate is close to the actual pixel coordinate
- const int maxIterations = 100;
+ const int maxIterations = 20;
int iteration;
for ( iteration = 0; iteration < maxIterations; ++iteration ) {
- pn.print();
- if ( pn.distance(pi) <= tol ) break;
+ if ( uncalibrate(pn).distance(pi) <= tol ) break;
// part1: 3D space -> normalized plane
Point2 pnpl = spaceToNPlane(pn);
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
index 3995e03b2..370877ef3 100644
--- a/gtsam/geometry/tests/testCal3Unify.cpp
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -19,28 +19,26 @@
#include
#include
-
-#include
using namespace gtsam;
-using namespace std;
+
GTSAM_CONCEPT_TESTABLE_INST(Cal3Unify)
GTSAM_CONCEPT_MANIFOLD_INST(Cal3Unify)
/*
ground truth from matlab, code :
-X = [2 3 1]';
-V = [0.01, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0, 0, 100, 105, 320, 240];
+X = [0.5 0.7 1]';
+V = [0.1, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0, 0, 100, 105, 320, 240];
[P, J] = spaceToImgPlane(X, V);
matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox
*/
-static Cal3Unify K(0.01, 100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3);
-static Point2 p(2, 3);
+static Cal3Unify K(0.1, 100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3);
+static Point2 p(0.5, 0.7);
/* ************************************************************************* */
TEST( Cal3Unify, uncalibrate)
{
- Point2 p_i(582.5228344366194, 649.6685266099726) ;
+ Point2 p_i(364.7791831734982, 305.6677211952602) ;
Point2 q = K.uncalibrate(p);
CHECK(assert_equal(q,p_i));
}
@@ -49,6 +47,7 @@ TEST( Cal3Unify, uncalibrate)
TEST( Cal3Unify, spaceNplane)
{
Point2 q = K.spaceToNPlane(p);
+ CHECK(assert_equal(Point2(0.441731600049497, 0.618424240069295), q));
CHECK(assert_equal(p, K.nPlaneToSpace(q)));
}
@@ -56,7 +55,7 @@ TEST( Cal3Unify, spaceNplane)
TEST( Cal3Unify, calibrate)
{
Point2 pi = K.uncalibrate(p);
- Point2 pn_hat = K.calibrate(pi, 1);
+ Point2 pn_hat = K.calibrate(pi);
CHECK( p.equals(pn_hat, 1e-5));
}
@@ -68,7 +67,7 @@ TEST( Cal3Unify, Duncalibrate1)
Matrix computed;
K.uncalibrate(p, computed, boost::none);
Matrix numerical = numericalDerivative21(uncalibrate_, K, p, 1e-7);
- CHECK(assert_equal(numerical,computed,1e-6));
+ CHECK(assert_equal(numerical,computed,1e-5));
}
/* ************************************************************************* */
@@ -77,7 +76,7 @@ TEST( Cal3Unify, Duncalibrate2)
Matrix computed;
K.uncalibrate(p, boost::none, computed);
Matrix numerical = numericalDerivative22(uncalibrate_, K, p, 1e-7);
- CHECK(assert_equal(numerical,computed,1e-6));
+ CHECK(assert_equal(numerical,computed,1e-5));
}
/* ************************************************************************* */
@@ -89,7 +88,7 @@ TEST( Cal3Unify, assert_equal)
/* ************************************************************************* */
TEST( Cal3Unify, retract)
{
- Cal3Unify expected(0.01 + 1, 100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
+ Cal3Unify expected(0.1 + 1, 100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
1e-3 + 7, 2.0*1e-3 + 8, 3.0*1e-3 + 9, 4.0*1e-3 + 10);
Vector d(10);
d << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
From 6d356fbf8e278513932ad71f4d66e20ed2bf7d2e Mon Sep 17 00:00:00 2001
From: jing
Date: Thu, 27 Mar 2014 14:42:53 -0400
Subject: [PATCH 006/101] midterm commit, now Cal3Unify live on Cal3DS2,
jacobian sequnce changes
---
gtsam/geometry/Cal3DS2.h | 2 +-
gtsam/geometry/Cal3Unify.cpp | 11 +++++------
gtsam/geometry/Cal3Unify.h | 22 +++++++++++-----------
gtsam/geometry/tests/testCal3Unify.cpp | 12 ++++++------
4 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/gtsam/geometry/Cal3DS2.h b/gtsam/geometry/Cal3DS2.h
index 5453e1481..ced05086b 100644
--- a/gtsam/geometry/Cal3DS2.h
+++ b/gtsam/geometry/Cal3DS2.h
@@ -30,7 +30,7 @@ namespace gtsam {
*/
class GTSAM_EXPORT Cal3DS2 : public DerivedValue {
-private:
+protected:
double fx_, fy_, s_, u0_, v0_ ; // focal length, skew and principal point
double k1_, k2_ ; // radial 2nd-order and 4th-order
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
index 8e200ff2a..86a82ff4c 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -26,22 +26,21 @@ namespace gtsam {
/* ************************************************************************* */
Cal3Unify::Cal3Unify(const Vector &v):
- xi_(v[0]), fx_(v[1]), fy_(v[2]), s_(v[3]), u0_(v[4]), v0_(v[5]), k1_(v[6]), k2_(v[7]), k3_(v[8]), k4_(v[9]){}
+ Cal3DS2(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]), xi_(v[9]) {}
/* ************************************************************************* */
Matrix Cal3Unify::K() const {
- return (Matrix(3, 3) << fx_, s_, u0_, 0.0, fy_, v0_, 0.0, 0.0, 1.0);
+ return Base::K();
}
/* ************************************************************************* */
Vector Cal3Unify::vector() const {
- return (Vector(10) << xi_, fx_, fy_, s_, u0_, v0_, k1_, k2_, k3_, k4_);
+ return (Vector(10) << Base::vector(), xi_);
}
/* ************************************************************************* */
void Cal3Unify::print(const std::string& s) const {
- gtsam::print(K(), s + ".K");
- gtsam::print(Vector(k()), s + ".k");
+ Base::print(s);
gtsam::print((Vector)(Vector(1) << xi_), s + ".xi");
}
@@ -119,7 +118,7 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
fx * (rr + 2. * xx) + s * (2. * xy), 0.0, pny, 0.0, 0.0, 1.0,
fy * y * rr, fy * y * r4, fy * (rr + 2. * yy), fy * (2. * xy));
- *H1 = collect(2, &DDS2U, &DDS2V);
+ *H1 = collect(2, &DDS2V, &DDS2U);
}
// Inlined derivative for points
if (H2) {
diff --git a/gtsam/geometry/Cal3Unify.h b/gtsam/geometry/Cal3Unify.h
index 4d70db051..37b291994 100644
--- a/gtsam/geometry/Cal3Unify.h
+++ b/gtsam/geometry/Cal3Unify.h
@@ -22,7 +22,7 @@
#pragma once
-#include
+#include
#include
namespace gtsam {
@@ -32,14 +32,14 @@ namespace gtsam {
* @addtogroup geometry
* \nosubgrouping
*/
-class GTSAM_EXPORT Cal3Unify : public DerivedValue {
+class GTSAM_EXPORT Cal3Unify : protected Cal3DS2 {
+
+ typedef Cal3Unify This;
+ typedef Cal3DS2 Base;
private:
double xi_; // mirror parameter
- double fx_, fy_, s_, u0_, v0_ ; // focal length, skew and principal point
- double k1_, k2_ ; // radial 2nd-order and 4th-order
- double k3_, k4_ ; // tangential distortion
// K = [ fx s u0 ; 0 fy v0 ; 0 0 1 ]
// Pn = [ P.x / (1 + xi * \sqrt{P.x^2 + P.y^2 + 1}), P.y / (1 + xi * \sqrt{P.x^2 + P.y^2 + 1})]
@@ -50,18 +50,18 @@ private:
public:
Matrix K() const ;
- Eigen::Vector4d k() const { return Eigen::Vector4d(k1_, k2_, k3_, k4_); }
+ Eigen::Vector4d k() const { return Base::k(); }
Vector vector() const ;
/// @name Standard Constructors
/// @{
/// Default Constructor with only unit focal length
- Cal3Unify() : xi_(0), fx_(1), fy_(1), s_(0), u0_(0), v0_(0), k1_(0), k2_(0), k3_(0), k4_(0) {}
+ Cal3Unify() : Cal3DS2(), xi_(0) {}
- Cal3Unify(double xi, double fx, double fy, double s, double u0, double v0,
- double k1, double k2, double k3 = 0.0, double k4 = 0.0) :
- xi_(xi), fx_(fx), fy_(fy), s_(s), u0_(u0), v0_(v0), k1_(k1), k2_(k2), k3_(k3), k4_(k4) {}
+ Cal3Unify(double fx, double fy, double s, double u0, double v0,
+ double k1, double k2, double k3 = 0.0, double k4 = 0.0, double xi = 0.0) :
+ Cal3DS2(fx, fy, s, u0, v0, k1, k2, k3, k4), xi_(xi) {}
/// @}
/// @name Advanced Constructors
@@ -150,7 +150,6 @@ private:
{
ar & boost::serialization::make_nvp("Cal3Unify",
boost::serialization::base_object(*this));
- ar & BOOST_SERIALIZATION_NVP(xi_);
ar & BOOST_SERIALIZATION_NVP(fx_);
ar & BOOST_SERIALIZATION_NVP(fy_);
ar & BOOST_SERIALIZATION_NVP(s_);
@@ -160,6 +159,7 @@ private:
ar & BOOST_SERIALIZATION_NVP(k2_);
ar & BOOST_SERIALIZATION_NVP(k3_);
ar & BOOST_SERIALIZATION_NVP(k4_);
+ ar & BOOST_SERIALIZATION_NVP(xi_);
}
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
index 370877ef3..015cff237 100644
--- a/gtsam/geometry/tests/testCal3Unify.cpp
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -32,7 +32,7 @@ V = [0.1, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0, 0, 100, 105, 320, 240];
matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox
*/
-static Cal3Unify K(0.1, 100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3);
+static Cal3Unify K(100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0.1);
static Point2 p(0.5, 0.7);
/* ************************************************************************* */
@@ -67,7 +67,7 @@ TEST( Cal3Unify, Duncalibrate1)
Matrix computed;
K.uncalibrate(p, computed, boost::none);
Matrix numerical = numericalDerivative21(uncalibrate_, K, p, 1e-7);
- CHECK(assert_equal(numerical,computed,1e-5));
+ CHECK(assert_equal(numerical,computed,1e-6));
}
/* ************************************************************************* */
@@ -76,7 +76,7 @@ TEST( Cal3Unify, Duncalibrate2)
Matrix computed;
K.uncalibrate(p, boost::none, computed);
Matrix numerical = numericalDerivative22(uncalibrate_, K, p, 1e-7);
- CHECK(assert_equal(numerical,computed,1e-5));
+ CHECK(assert_equal(numerical,computed,1e-6));
}
/* ************************************************************************* */
@@ -88,10 +88,10 @@ TEST( Cal3Unify, assert_equal)
/* ************************************************************************* */
TEST( Cal3Unify, retract)
{
- Cal3Unify expected(0.1 + 1, 100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
- 1e-3 + 7, 2.0*1e-3 + 8, 3.0*1e-3 + 9, 4.0*1e-3 + 10);
+ Cal3Unify expected(100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
+ 1e-3 + 7, 2.0*1e-3 + 8, 3.0*1e-3 + 9, 4.0*1e-3 + 10, 0.1 + 1);
Vector d(10);
- d << 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+ d << 2, 3, 4, 5, 6, 7, 8, 9, 10, 1;
Cal3Unify actual = K.retract(d);
CHECK(assert_equal(expected,actual,1e-7));
CHECK(assert_equal(d,K.localCoordinates(actual),1e-7));
From 3f5bbe3fd238394d87d2c951bb7a97db891dc912 Mon Sep 17 00:00:00 2001
From: jing
Date: Thu, 27 Mar 2014 15:03:06 -0400
Subject: [PATCH 007/101] jacobian fixed, now use base class jacobians and
chain rule
---
gtsam/geometry/Cal3Unify.cpp | 52 +++++++-----------------------------
1 file changed, 9 insertions(+), 43 deletions(-)
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
index 86a82ff4c..eefd33801 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -64,8 +64,7 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
// is same as Cal3DS2
// parameters
- const double xi = xi_, fx = fx_, fy = fy_, s = s_;
- const double k1 = k1_, k2 = k2_, k3 = k3_, k4 = k4_;
+ const double xi = xi_;
// Part1: project 3D space to NPlane
const double xs = p.x(), ys = p.y(); // normalized points in 3D space
@@ -74,51 +73,19 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
const double xi_sqrt_nx2 = xi_sqrt_nx * xi_sqrt_nx;
const double x = xs * xi_sqrt_nx, y = ys * xi_sqrt_nx; // points on NPlane
- // Part2: project NPlane point to pixel plane: same as Cal3DS2
- const double xy = x * y, xx = x * x, yy = y * y;
- const double rr = xx + yy;
- const double r4 = rr * rr;
- const double g = 1. + k1 * rr + k2 * r4;
- const double dx = 2. * k3 * xy + k4 * (rr + 2. * xx);
- const double dy = 2. * k4 * xy + k3 * (rr + 2. * yy);
-
- const double pnx = g*x + dx;
- const double pny = g*y + dy;
-
- // DDS2 will be used both in H1 and H2
- Matrix DDS2;
- if (H1 || H2) {
- // part2
- const double dr_dx = 2. * x;
- const double dr_dy = 2. * y;
- const double dg_dx = k1 * dr_dx + k2 * 2. * rr * dr_dx;
- const double dg_dy = k1 * dr_dy + k2 * 2. * rr * dr_dy;
-
- const double dDx_dx = 2. * k3 * y + k4 * (dr_dx + 4. * x);
- const double dDx_dy = 2. * k3 * x + k4 * dr_dy;
- const double dDy_dx = 2. * k4 * y + k3 * dr_dx;
- const double dDy_dy = 2. * k4 * x + k3 * (dr_dy + 4. * y);
-
- Matrix DK = (Matrix(2, 2) << fx, s_, 0.0, fy);
- Matrix DR = (Matrix(2, 2) << g + x * dg_dx + dDx_dx, x * dg_dy + dDx_dy,
- y * dg_dx + dDy_dx, g + y * dg_dy + dDy_dy);
-
- DDS2 = DK * DR;
- }
+ // Part2: project NPlane point to pixel plane: use Cal3DS2
+ Point2 m(x,y);
+ Matrix H1base, H2base; // jacobians from Base class
+ Point2 puncalib = Base::uncalibrate(m, H1base, H2base);
// Inlined derivative for calibration
if (H1) {
// part1
Matrix DU = (Matrix(2,1) << -xs * sqrt_nx * xi_sqrt_nx2,
-ys * sqrt_nx * xi_sqrt_nx2);
- Matrix DDS2U = DDS2 * DU;
- // part2
- Matrix DDS2V = (Matrix(2, 9) << pnx, 0.0, pny, 1.0, 0.0, fx * x * rr + s * y * rr,
- fx * x * r4 + s * y * r4, fx * 2. * xy + s * (rr + 2. * yy),
- fx * (rr + 2. * xx) + s * (2. * xy), 0.0, pny, 0.0, 0.0, 1.0,
- fy * y * rr, fy * y * r4, fy * (rr + 2. * yy), fy * (2. * xy));
+ Matrix DDS2U = H2base * DU;
- *H1 = collect(2, &DDS2V, &DDS2U);
+ *H1 = collect(2, &H1base, &DDS2U);
}
// Inlined derivative for points
if (H2) {
@@ -129,11 +96,10 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
(sqrt_nx + xi*(ys*ys + 1)) * denom, mid,
mid, (sqrt_nx + xi*(xs*xs + 1)) * denom);
- *H2 = DDS2 * DU;
+ *H2 = H2base * DU;
}
-
- return Point2(fx * pnx + s * pny + u0_, fy * pny + v0_);
+ return puncalib;
}
/* ************************************************************************* */
From 77f494b341dadbf4b9cdcf54a7c9f55afccfe241 Mon Sep 17 00:00:00 2001
From: jing
Date: Thu, 27 Mar 2014 15:09:26 -0400
Subject: [PATCH 008/101] calibrate() done by using base class
---
gtsam/geometry/Cal3Unify.cpp | 37 +++-----------------------
gtsam/geometry/tests/testCal3Unify.cpp | 8 +++---
2 files changed, 8 insertions(+), 37 deletions(-)
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unify.cpp
index eefd33801..e837eff5d 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unify.cpp
@@ -104,41 +104,12 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
/* ************************************************************************* */
Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
- // Use the following fixed point iteration to invert the radial distortion.
- // pn_{t+1} = (inv(K)*pi - dp(pn_{t})) / g(pn_{t})
- // point on the normalized plane, input for DS2
- double px = pi.x();
- double py = pi.y();
- const Point2 invKPi ((1 / fx_) * (px - u0_ - (s_ / fy_) * (py - v0_)),
- (1 / fy_) * (py - v0_));
+ // calibrate point to Nplane use base class::calibrate()
+ Point2 pnplane = Base::calibrate(pi, tol);
- // initialize by ignoring the distortion at all, might be problematic for pixels around boundary
- Point2 pn = nPlaneToSpace(invKPi);
-
- // iterate until the uncalibrate is close to the actual pixel coordinate
- const int maxIterations = 20;
- int iteration;
- for ( iteration = 0; iteration < maxIterations; ++iteration ) {
-
- if ( uncalibrate(pn).distance(pi) <= tol ) break;
-
- // part1: 3D space -> normalized plane
- Point2 pnpl = spaceToNPlane(pn);
- // part2: normalized plane -> 3D space
- px = pnpl.x(), py = pnpl.y();
- const double xy = px*py, xx = px*px, yy = py*py;
- const double rr = xx + yy;
- const double g = (1+k1_*rr+k2_*rr*rr);
- const double dx = 2*k3_*xy + k4_*(rr+2*xx);
- const double dy = 2*k4_*xy + k3_*(rr+2*yy);
- pn = nPlaneToSpace((invKPi - Point2(dx,dy))/g);
- }
-
- if ( iteration >= maxIterations )
- throw std::runtime_error("Cal3Unify::calibrate fails to converge. need a better initialization");
-
- return pn;
+ // call nplane to space
+ return this->nPlaneToSpace(pnplane);
}
/* ************************************************************************* */
Point2 Cal3Unify::nPlaneToSpace(const Point2& p) const {
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
index 015cff237..c36b756e3 100644
--- a/gtsam/geometry/tests/testCal3Unify.cpp
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -56,7 +56,7 @@ TEST( Cal3Unify, calibrate)
{
Point2 pi = K.uncalibrate(p);
Point2 pn_hat = K.calibrate(pi);
- CHECK( p.equals(pn_hat, 1e-5));
+ CHECK( p.equals(pn_hat, 1e-8));
}
Point2 uncalibrate_(const Cal3Unify& k, const Point2& pt) { return k.uncalibrate(pt); }
@@ -82,7 +82,7 @@ TEST( Cal3Unify, Duncalibrate2)
/* ************************************************************************* */
TEST( Cal3Unify, assert_equal)
{
- CHECK(assert_equal(K,K,1e-5));
+ CHECK(assert_equal(K,K,1e-9));
}
/* ************************************************************************* */
@@ -93,8 +93,8 @@ TEST( Cal3Unify, retract)
Vector d(10);
d << 2, 3, 4, 5, 6, 7, 8, 9, 10, 1;
Cal3Unify actual = K.retract(d);
- CHECK(assert_equal(expected,actual,1e-7));
- CHECK(assert_equal(d,K.localCoordinates(actual),1e-7));
+ CHECK(assert_equal(expected,actual,1e-9));
+ CHECK(assert_equal(d,K.localCoordinates(actual),1e-9));
}
/* ************************************************************************* */
From 8eeb7e8cfb175699be8d7eb83031dae8432186b0 Mon Sep 17 00:00:00 2001
From: jing
Date: Thu, 27 Mar 2014 15:15:30 -0400
Subject: [PATCH 009/101] change name from Cal3Unify to Cal3Unified
---
.../{Cal3Unify.cpp => Cal3Unified.cpp} | 28 +++++++++----------
gtsam/geometry/{Cal3Unify.h => Cal3Unified.h} | 20 ++++++-------
gtsam/geometry/tests/testCal3Unify.cpp | 28 +++++++++----------
3 files changed, 38 insertions(+), 38 deletions(-)
rename gtsam/geometry/{Cal3Unify.cpp => Cal3Unified.cpp} (84%)
rename gtsam/geometry/{Cal3Unify.h => Cal3Unified.h} (89%)
diff --git a/gtsam/geometry/Cal3Unify.cpp b/gtsam/geometry/Cal3Unified.cpp
similarity index 84%
rename from gtsam/geometry/Cal3Unify.cpp
rename to gtsam/geometry/Cal3Unified.cpp
index e837eff5d..d2a2be287 100644
--- a/gtsam/geometry/Cal3Unify.cpp
+++ b/gtsam/geometry/Cal3Unified.cpp
@@ -18,34 +18,34 @@
#include
#include
#include
-#include
+#include
#include
namespace gtsam {
/* ************************************************************************* */
-Cal3Unify::Cal3Unify(const Vector &v):
- Cal3DS2(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]), xi_(v[9]) {}
+Cal3Unified::Cal3Unified(const Vector &v):
+ Base(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], v[8]), xi_(v[9]) {}
/* ************************************************************************* */
-Matrix Cal3Unify::K() const {
+Matrix Cal3Unified::K() const {
return Base::K();
}
/* ************************************************************************* */
-Vector Cal3Unify::vector() const {
+Vector Cal3Unified::vector() const {
return (Vector(10) << Base::vector(), xi_);
}
/* ************************************************************************* */
-void Cal3Unify::print(const std::string& s) const {
+void Cal3Unified::print(const std::string& s) const {
Base::print(s);
gtsam::print((Vector)(Vector(1) << xi_), s + ".xi");
}
/* ************************************************************************* */
-bool Cal3Unify::equals(const Cal3Unify& K, double tol) const {
+bool Cal3Unified::equals(const Cal3Unified& K, double tol) const {
if (fabs(fx_ - K.fx_) > tol || fabs(fy_ - K.fy_) > tol || fabs(s_ - K.s_) > tol ||
fabs(u0_ - K.u0_) > tol || fabs(v0_ - K.v0_) > tol || fabs(k1_ - K.k1_) > tol ||
fabs(k2_ - K.k2_) > tol || fabs(k3_ - K.k3_) > tol || fabs(k4_ - K.k4_) > tol ||
@@ -55,7 +55,7 @@ bool Cal3Unify::equals(const Cal3Unify& K, double tol) const {
}
/* ************************************************************************* */
-Point2 Cal3Unify::uncalibrate(const Point2& p,
+Point2 Cal3Unified::uncalibrate(const Point2& p,
boost::optional H1,
boost::optional H2) const {
@@ -103,7 +103,7 @@ Point2 Cal3Unify::uncalibrate(const Point2& p,
}
/* ************************************************************************* */
-Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
+Point2 Cal3Unified::calibrate(const Point2& pi, const double tol) const {
// calibrate point to Nplane use base class::calibrate()
Point2 pnplane = Base::calibrate(pi, tol);
@@ -112,7 +112,7 @@ Point2 Cal3Unify::calibrate(const Point2& pi, const double tol) const {
return this->nPlaneToSpace(pnplane);
}
/* ************************************************************************* */
-Point2 Cal3Unify::nPlaneToSpace(const Point2& p) const {
+Point2 Cal3Unified::nPlaneToSpace(const Point2& p) const {
const double x = p.x(), y = p.y();
const double xy2 = x * x + y * y;
@@ -122,7 +122,7 @@ Point2 Cal3Unify::nPlaneToSpace(const Point2& p) const {
}
/* ************************************************************************* */
-Point2 Cal3Unify::spaceToNPlane(const Point2& p) const {
+Point2 Cal3Unified::spaceToNPlane(const Point2& p) const {
const double x = p.x(), y = p.y();
const double sq_xy = 1 + xi_ * sqrt(x * x + y * y + 1);
@@ -131,12 +131,12 @@ Point2 Cal3Unify::spaceToNPlane(const Point2& p) const {
}
/* ************************************************************************* */
-Cal3Unify Cal3Unify::retract(const Vector& d) const {
- return Cal3Unify(vector() + d);
+Cal3Unified Cal3Unified::retract(const Vector& d) const {
+ return Cal3Unified(vector() + d);
}
/* ************************************************************************* */
-Vector Cal3Unify::localCoordinates(const Cal3Unify& T2) const {
+Vector Cal3Unified::localCoordinates(const Cal3Unified& T2) const {
return T2.vector() - vector();
}
diff --git a/gtsam/geometry/Cal3Unify.h b/gtsam/geometry/Cal3Unified.h
similarity index 89%
rename from gtsam/geometry/Cal3Unify.h
rename to gtsam/geometry/Cal3Unified.h
index 37b291994..d8c0251f0 100644
--- a/gtsam/geometry/Cal3Unify.h
+++ b/gtsam/geometry/Cal3Unified.h
@@ -32,9 +32,9 @@ namespace gtsam {
* @addtogroup geometry
* \nosubgrouping
*/
-class GTSAM_EXPORT Cal3Unify : protected Cal3DS2 {
+class GTSAM_EXPORT Cal3Unified : protected Cal3DS2 {
- typedef Cal3Unify This;
+ typedef Cal3Unified This;
typedef Cal3DS2 Base;
private:
@@ -57,17 +57,17 @@ public:
/// @{
/// Default Constructor with only unit focal length
- Cal3Unify() : Cal3DS2(), xi_(0) {}
+ Cal3Unified() : Base(), xi_(0) {}
- Cal3Unify(double fx, double fy, double s, double u0, double v0,
+ Cal3Unified(double fx, double fy, double s, double u0, double v0,
double k1, double k2, double k3 = 0.0, double k4 = 0.0, double xi = 0.0) :
- Cal3DS2(fx, fy, s, u0, v0, k1, k2, k3, k4), xi_(xi) {}
+ Base(fx, fy, s, u0, v0, k1, k2, k3, k4), xi_(xi) {}
/// @}
/// @name Advanced Constructors
/// @{
- Cal3Unify(const Vector &v) ;
+ Cal3Unified(const Vector &v) ;
/// @}
/// @name Testable
@@ -77,7 +77,7 @@ public:
void print(const std::string& s = "") const ;
/// assert equality up to a tolerance
- bool equals(const Cal3Unify& K, double tol = 10e-9) const;
+ bool equals(const Cal3Unified& K, double tol = 10e-9) const;
/// @}
/// @name Standard Interface
@@ -126,10 +126,10 @@ public:
/// @{
/// Given delta vector, update calibration
- Cal3Unify retract(const Vector& d) const ;
+ Cal3Unified retract(const Vector& d) const ;
/// Given a different calibration, calculate update to obtain it
- Vector localCoordinates(const Cal3Unify& T2) const ;
+ Vector localCoordinates(const Cal3Unified& T2) const ;
/// Return dimensions of calibration manifold object
virtual size_t dim() const { return 10 ; } //TODO: make a final dimension variable (also, usually size_t in other classes e.g. Pose2)
@@ -148,7 +148,7 @@ private:
template
void serialize(Archive & ar, const unsigned int version)
{
- ar & boost::serialization::make_nvp("Cal3Unify",
+ ar & boost::serialization::make_nvp("Cal3Unified",
boost::serialization::base_object(*this));
ar & BOOST_SERIALIZATION_NVP(fx_);
ar & BOOST_SERIALIZATION_NVP(fy_);
diff --git a/gtsam/geometry/tests/testCal3Unify.cpp b/gtsam/geometry/tests/testCal3Unify.cpp
index c36b756e3..b260415f1 100644
--- a/gtsam/geometry/tests/testCal3Unify.cpp
+++ b/gtsam/geometry/tests/testCal3Unify.cpp
@@ -17,12 +17,12 @@
#include
#include
#include
-#include
+#include
using namespace gtsam;
-GTSAM_CONCEPT_TESTABLE_INST(Cal3Unify)
-GTSAM_CONCEPT_MANIFOLD_INST(Cal3Unify)
+GTSAM_CONCEPT_TESTABLE_INST(Cal3Unified)
+GTSAM_CONCEPT_MANIFOLD_INST(Cal3Unified)
/*
ground truth from matlab, code :
@@ -32,11 +32,11 @@ V = [0.1, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0, 0, 100, 105, 320, 240];
matlab toolbox available at http://homepages.laas.fr/~cmei/index.php/Toolbox
*/
-static Cal3Unify K(100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0.1);
+static Cal3Unified K(100, 105, 0.0, 320, 240, 1e-3, 2.0*1e-3, 3.0*1e-3, 4.0*1e-3, 0.1);
static Point2 p(0.5, 0.7);
/* ************************************************************************* */
-TEST( Cal3Unify, uncalibrate)
+TEST( Cal3Unified, uncalibrate)
{
Point2 p_i(364.7791831734982, 305.6677211952602) ;
Point2 q = K.uncalibrate(p);
@@ -44,7 +44,7 @@ TEST( Cal3Unify, uncalibrate)
}
/* ************************************************************************* */
-TEST( Cal3Unify, spaceNplane)
+TEST( Cal3Unified, spaceNplane)
{
Point2 q = K.spaceToNPlane(p);
CHECK(assert_equal(Point2(0.441731600049497, 0.618424240069295), q));
@@ -52,17 +52,17 @@ TEST( Cal3Unify, spaceNplane)
}
/* ************************************************************************* */
-TEST( Cal3Unify, calibrate)
+TEST( Cal3Unified, calibrate)
{
Point2 pi = K.uncalibrate(p);
Point2 pn_hat = K.calibrate(pi);
CHECK( p.equals(pn_hat, 1e-8));
}
-Point2 uncalibrate_(const Cal3Unify& k, const Point2& pt) { return k.uncalibrate(pt); }
+Point2 uncalibrate_(const Cal3Unified& k, const Point2& pt) { return k.uncalibrate(pt); }
/* ************************************************************************* */
-TEST( Cal3Unify, Duncalibrate1)
+TEST( Cal3Unified, Duncalibrate1)
{
Matrix computed;
K.uncalibrate(p, computed, boost::none);
@@ -71,7 +71,7 @@ TEST( Cal3Unify, Duncalibrate1)
}
/* ************************************************************************* */
-TEST( Cal3Unify, Duncalibrate2)
+TEST( Cal3Unified, Duncalibrate2)
{
Matrix computed;
K.uncalibrate(p, boost::none, computed);
@@ -80,19 +80,19 @@ TEST( Cal3Unify, Duncalibrate2)
}
/* ************************************************************************* */
-TEST( Cal3Unify, assert_equal)
+TEST( Cal3Unified, assert_equal)
{
CHECK(assert_equal(K,K,1e-9));
}
/* ************************************************************************* */
-TEST( Cal3Unify, retract)
+TEST( Cal3Unified, retract)
{
- Cal3Unify expected(100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
+ Cal3Unified expected(100 + 2, 105 + 3, 0.0 + 4, 320 + 5, 240 + 6,
1e-3 + 7, 2.0*1e-3 + 8, 3.0*1e-3 + 9, 4.0*1e-3 + 10, 0.1 + 1);
Vector d(10);
d << 2, 3, 4, 5, 6, 7, 8, 9, 10, 1;
- Cal3Unify actual = K.retract(d);
+ Cal3Unified actual = K.retract(d);
CHECK(assert_equal(expected,actual,1e-9));
CHECK(assert_equal(d,K.localCoordinates(actual),1e-9));
}
From fe81828a2cc0514492aa23868b547873a736743c Mon Sep 17 00:00:00 2001
From: jing
Date: Fri, 11 Apr 2014 15:33:35 -0400
Subject: [PATCH 010/101] add Serialization function to Unit3 and
EssentialMatrix classes
---
gtsam/geometry/EssentialMatrix.h | 27 +++++++++++++++++++++++++++
gtsam/geometry/Unit3.h | 18 ++++++++++++++++++
2 files changed, 45 insertions(+)
diff --git a/gtsam/geometry/EssentialMatrix.h b/gtsam/geometry/EssentialMatrix.h
index 7de68c7a1..adde77511 100644
--- a/gtsam/geometry/EssentialMatrix.h
+++ b/gtsam/geometry/EssentialMatrix.h
@@ -157,6 +157,33 @@ public:
/// @}
+private:
+
+ /// @name Advanced Interface
+ /// @{
+
+ /** Serialization function */
+ friend class boost::serialization::access;
+ template
+ void serialize(ARCHIVE & ar, const unsigned int version) {
+ ar & boost::serialization::make_nvp("EssentialMatrix",
+ boost::serialization::base_object(*this));
+ ar & BOOST_SERIALIZATION_NVP(aRb_);
+ ar & BOOST_SERIALIZATION_NVP(aTb_);
+
+ ar & boost::serialization::make_nvp("E11", E_(0,0));
+ ar & boost::serialization::make_nvp("E12", E_(0,1));
+ ar & boost::serialization::make_nvp("E13", E_(0,2));
+ ar & boost::serialization::make_nvp("E21", E_(1,0));
+ ar & boost::serialization::make_nvp("E22", E_(1,1));
+ ar & boost::serialization::make_nvp("E23", E_(1,2));
+ ar & boost::serialization::make_nvp("E31", E_(2,0));
+ ar & boost::serialization::make_nvp("E32", E_(2,1));
+ ar & boost::serialization::make_nvp("E33", E_(2,2));
+ }
+
+ /// @}
+
};
} // gtsam
diff --git a/gtsam/geometry/Unit3.h b/gtsam/geometry/Unit3.h
index 9e2ef0945..8eac7f1a8 100644
--- a/gtsam/geometry/Unit3.h
+++ b/gtsam/geometry/Unit3.h
@@ -136,6 +136,24 @@ public:
Vector localCoordinates(const Unit3& s) const;
/// @}
+
+private:
+
+ /// @name Advanced Interface
+ /// @{
+
+ /** Serialization function */
+ friend class boost::serialization::access;
+ template
+ void serialize(ARCHIVE & ar, const unsigned int version) {
+ ar & boost::serialization::make_nvp("Unit3",
+ boost::serialization::base_object(*this));
+ ar & BOOST_SERIALIZATION_NVP(p_);
+ ar & BOOST_SERIALIZATION_NVP(B_);
+ }
+
+ /// @}
+
};
} // namespace gtsam
From d3333c1c853f12942851ba4b5d71a34655135d3c Mon Sep 17 00:00:00 2001
From: Chris Beall
Date: Thu, 17 Apr 2014 22:07:55 -0400
Subject: [PATCH 011/101] Fix errors on Windows with VS 2010
---
gtsam/geometry/EssentialMatrix.h | 2 +-
gtsam/geometry/Unit3.h | 2 +-
gtsam/geometry/tests/testPoint3.cpp | 2 +-
gtsam/geometry/tests/testSphere2.cpp | 2 +-
gtsam/navigation/tests/testGeographicLib.cpp | 1 +
gtsam/slam/EssentialMatrixConstraint.h | 2 +-
6 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/gtsam/geometry/EssentialMatrix.h b/gtsam/geometry/EssentialMatrix.h
index adde77511..74a1cd798 100644
--- a/gtsam/geometry/EssentialMatrix.h
+++ b/gtsam/geometry/EssentialMatrix.h
@@ -20,7 +20,7 @@ namespace gtsam {
* but here we choose instead to parameterize it as a (Rot3,Unit3) pair.
* We can then non-linearly optimize immediately on this 5-dimensional manifold.
*/
-class EssentialMatrix: public DerivedValue {
+class GTSAM_EXPORT EssentialMatrix: public DerivedValue {
private:
diff --git a/gtsam/geometry/Unit3.h b/gtsam/geometry/Unit3.h
index 8eac7f1a8..39e2c9799 100644
--- a/gtsam/geometry/Unit3.h
+++ b/gtsam/geometry/Unit3.h
@@ -27,7 +27,7 @@
namespace gtsam {
/// Represents a 3D point on a unit sphere.
-class Unit3: public DerivedValue {
+class GTSAM_EXPORT Unit3: public DerivedValue {
private:
diff --git a/gtsam/geometry/tests/testPoint3.cpp b/gtsam/geometry/tests/testPoint3.cpp
index ab0d12b9e..65c610c25 100644
--- a/gtsam/geometry/tests/testPoint3.cpp
+++ b/gtsam/geometry/tests/testPoint3.cpp
@@ -81,7 +81,7 @@ TEST( Point3, stream) {
TEST (Point3, normalize) {
Matrix actualH;
Point3 point(1, -2, 3); // arbitrary point
- Point3 expected(point / sqrt(14));
+ Point3 expected(point / sqrt(14.0));
EXPECT(assert_equal(expected, point.normalize(actualH), 1e-8));
Matrix expectedH = numericalDerivative11(
boost::bind(&Point3::normalize, _1, boost::none), point);
diff --git a/gtsam/geometry/tests/testSphere2.cpp b/gtsam/geometry/tests/testSphere2.cpp
index 2725df061..3009d5d0d 100644
--- a/gtsam/geometry/tests/testSphere2.cpp
+++ b/gtsam/geometry/tests/testSphere2.cpp
@@ -43,7 +43,7 @@ Point3 point3_(const Unit3& p) {
TEST(Unit3, point3) {
vector ps;
ps += Point3(1, 0, 0), Point3(0, 1, 0), Point3(0, 0, 1), Point3(1, 1, 0)
- / sqrt(2);
+ / sqrt(2.0);
Matrix actualH, expectedH;
BOOST_FOREACH(Point3 p,ps) {
Unit3 s(p);
diff --git a/gtsam/navigation/tests/testGeographicLib.cpp b/gtsam/navigation/tests/testGeographicLib.cpp
index 44964c569..aaa01b54d 100644
--- a/gtsam/navigation/tests/testGeographicLib.cpp
+++ b/gtsam/navigation/tests/testGeographicLib.cpp
@@ -19,6 +19,7 @@
#include
#include
+#include
#include
#include
diff --git a/gtsam/slam/EssentialMatrixConstraint.h b/gtsam/slam/EssentialMatrixConstraint.h
index f2eb76e2d..0e4fb48cf 100644
--- a/gtsam/slam/EssentialMatrixConstraint.h
+++ b/gtsam/slam/EssentialMatrixConstraint.h
@@ -27,7 +27,7 @@ namespace gtsam {
* Binary factor between two Pose3 variables induced by an EssentialMatrix measurement
* @addtogroup SLAM
*/
-class EssentialMatrixConstraint: public NoiseModelFactor2 {
+class GTSAM_EXPORT EssentialMatrixConstraint: public NoiseModelFactor2 {
private:
From 1ed27005156c8b086701beb32b1194436d3e591d Mon Sep 17 00:00:00 2001
From: Chris Beall
Date: Thu, 17 Apr 2014 22:49:04 -0400
Subject: [PATCH 012/101] Fix errors on Windows with VS 2010
---
gtsam/geometry/EssentialMatrix.h | 4 ++--
gtsam/geometry/tests/testSphere2.cpp | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gtsam/geometry/EssentialMatrix.h b/gtsam/geometry/EssentialMatrix.h
index 74a1cd798..3c9568c3d 100644
--- a/gtsam/geometry/EssentialMatrix.h
+++ b/gtsam/geometry/EssentialMatrix.h
@@ -150,10 +150,10 @@ public:
/// @{
/// stream to stream
- friend std::ostream& operator <<(std::ostream& os, const EssentialMatrix& E);
+ GTSAM_EXPORT friend std::ostream& operator <<(std::ostream& os, const EssentialMatrix& E);
/// stream from stream
- friend std::istream& operator >>(std::istream& is, EssentialMatrix& E);
+ GTSAM_EXPORT friend std::istream& operator >>(std::istream& is, EssentialMatrix& E);
/// @}
diff --git a/gtsam/geometry/tests/testSphere2.cpp b/gtsam/geometry/tests/testSphere2.cpp
index 3009d5d0d..eb45ea60f 100644
--- a/gtsam/geometry/tests/testSphere2.cpp
+++ b/gtsam/geometry/tests/testSphere2.cpp
@@ -26,6 +26,7 @@
#include
#include
#include
+#include
#include
#include
@@ -233,7 +234,7 @@ TEST(Unit3, localCoordinates_retract) {
for (size_t i = 0; i < numIterations; i++) {
// Sleep for the random number generator (TODO?: Better create all of them first).
- sleep(0);
+ boost::this_thread::sleep(boost::posix_time::milliseconds(0));
// Create the two Unit3s.
// NOTE: You can not create two totally random Unit3's because you cannot always compute
@@ -263,7 +264,7 @@ TEST(Unit3, localCoordinates_retract_expmap) {
for (size_t i = 0; i < numIterations; i++) {
// Sleep for the random number generator (TODO?: Better create all of them first).
- sleep(0);
+ boost::this_thread::sleep(boost::posix_time::milliseconds(0));
// Create the two Unit3s.
// Unlike the above case, we can use any two sphers.
From 36f53f7226efc964966a0120c3fe9deda3e7d2bc Mon Sep 17 00:00:00 2001
From: Chris Beall
Date: Thu, 17 Apr 2014 23:53:41 -0400
Subject: [PATCH 013/101] Fix errors on Windows with VS 2010
---
gtsam/inference/VariableSlots.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gtsam/inference/VariableSlots.h b/gtsam/inference/VariableSlots.h
index d393b61b1..9a16ca788 100644
--- a/gtsam/inference/VariableSlots.h
+++ b/gtsam/inference/VariableSlots.h
@@ -55,7 +55,7 @@ class VariableSlots : public FastMap > {
public:
typedef FastMap > Base;
- static const size_t Empty;
+ GTSAM_EXPORT static const size_t Empty;
/// @name Standard Constructors
/// @{
From 9dbabbc847b51b52412e9704c2665946643a6a59 Mon Sep 17 00:00:00 2001
From: Chris Beall
Date: Fri, 18 Apr 2014 10:36:33 -0400
Subject: [PATCH 014/101] Another Windows fix. Everything now builds, as long
as METIS and GeographicLIB are off.
---
gtsam/navigation/AttitudeFactor.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gtsam/navigation/AttitudeFactor.h b/gtsam/navigation/AttitudeFactor.h
index 44dd4183a..64603bd99 100644
--- a/gtsam/navigation/AttitudeFactor.h
+++ b/gtsam/navigation/AttitudeFactor.h
@@ -61,7 +61,7 @@ public:
* Version of AttitudeFactor for Rot3
* @addtogroup Navigation
*/
-class Rot3AttitudeFactor: public NoiseModelFactor1, public AttitudeFactor {
+class GTSAM_EXPORT Rot3AttitudeFactor: public NoiseModelFactor1, public AttitudeFactor {
typedef NoiseModelFactor1 Base;
@@ -129,7 +129,7 @@ private:
* Version of AttitudeFactor for Pose3
* @addtogroup Navigation
*/
-class Pose3AttitudeFactor: public NoiseModelFactor1,
+class GTSAM_EXPORT Pose3AttitudeFactor: public NoiseModelFactor1,
public AttitudeFactor {
typedef NoiseModelFactor1 Base;
From b82524882c58d44fcfdc285c5b01cf049b4cd569 Mon Sep 17 00:00:00 2001
From: Richard Roberts
Date: Wed, 30 Apr 2014 18:21:00 -0700
Subject: [PATCH 015/101] Fix typo in conditional in SymmetricBlockMatrix,
fixes #75
---
gtsam/base/SymmetricBlockMatrix.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gtsam/base/SymmetricBlockMatrix.cpp b/gtsam/base/SymmetricBlockMatrix.cpp
index d95fe84b7..546b6a7f1 100644
--- a/gtsam/base/SymmetricBlockMatrix.cpp
+++ b/gtsam/base/SymmetricBlockMatrix.cpp
@@ -53,7 +53,7 @@ SymmetricBlockMatrix SymmetricBlockMatrix::LikeActiveViewOf(
VerticalBlockMatrix SymmetricBlockMatrix::choleskyPartial(
DenseIndex nFrontals) {
// Do dense elimination
- if (!blockStart() == 0)
+ if (blockStart() != 0)
throw std::invalid_argument(
"Can only do Cholesky when the SymmetricBlockMatrix is not a restricted view, i.e. when blockStart == 0.");
if (!gtsam::choleskyPartial(matrix_, offset(nFrontals)))
From 2b20d612212cd54d29fbabf384c536fc14671b1a Mon Sep 17 00:00:00 2001
From: Vadim Indelman
Date: Wed, 30 Apr 2014 22:32:59 -0400
Subject: [PATCH 016/101] Wrapped measured() for BearingRangeFactor.
---
gtsam.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/gtsam.h b/gtsam.h
index de4c1381d..56a1a601d 100644
--- a/gtsam.h
+++ b/gtsam.h
@@ -2140,6 +2140,8 @@ template
virtual class BearingRangeFactor : gtsam::NoiseModelFactor {
BearingRangeFactor(size_t poseKey, size_t pointKey, const ROTATION& measuredBearing, double measuredRange, const gtsam::noiseModel::Base* noiseModel);
+ pair measured() const;
+
// enabling serialization functionality
void serialize() const;
};
From d8121a25bb0689302810f18d34453f43d4590d4c Mon Sep 17 00:00:00 2001
From: cbeall3
Date: Thu, 1 May 2014 12:53:05 -0400
Subject: [PATCH 017/101] Trivial change, but VS 2012 was choking on this in
release mode.
---
gtsam/linear/HessianFactor.cpp | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/gtsam/linear/HessianFactor.cpp b/gtsam/linear/HessianFactor.cpp
index 18fa44e8b..e62af9a05 100644
--- a/gtsam/linear/HessianFactor.cpp
+++ b/gtsam/linear/HessianFactor.cpp
@@ -367,13 +367,12 @@ void HessianFactor::hessianDiagonal(double* d) const {
typedef Eigen::Map DMap;
// Loop over all variables in the factor
- for (DenseIndex pos = 0; pos < (DenseIndex)size(); ++pos) {
- Key j = keys_[pos];
- // Get the diagonal block, and insert its diagonal
- Matrix B = info_(pos, pos).selfadjointView();
- DVector dj = B.diagonal();
- DMap(d + 9 * j) += dj;
- }
+ for (DenseIndex pos = 0; pos < (DenseIndex)size(); ++pos) {
+ Key j = keys_[pos];
+ // Get the diagonal block, and insert its diagonal
+ const Matrix& B = info_(pos, pos).selfadjointView();
+ DMap(d + 9 * j) += B.diagonal();
+ }
}
/* ************************************************************************* */
From 312d3fac1e28b40c41b3324f13a3e1d5af0fe3d9 Mon Sep 17 00:00:00 2001
From: cbeall3
Date: Sat, 3 May 2014 11:53:10 -0400
Subject: [PATCH 018/101] ignore /doc*
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 030d51b09..6d274af09 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/build*
+/doc*
*.pyc
*.DS_Store
\ No newline at end of file
From 267b86ec1412a1b9cfffce639237ea26838b24fb Mon Sep 17 00:00:00 2001
From: cbeall3
Date: Sat, 3 May 2014 11:54:01 -0400
Subject: [PATCH 019/101] Remove svd inverse_square_root
---
gtsam/base/Matrix.cpp | 22 ----------------------
gtsam/base/Matrix.h | 2 +-
2 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp
index 3b16beb51..92c9a525e 100644
--- a/gtsam/base/Matrix.cpp
+++ b/gtsam/base/Matrix.cpp
@@ -642,29 +642,7 @@ Matrix cholesky_inverse(const Matrix &A)
// return BNU::prod(trans(inv), inv);
}
-#if 0
/* ************************************************************************* */
-// TODO, would be faster with Cholesky
-Matrix inverse_square_root(const Matrix& A) {
- size_t m = A.cols(), n = A.rows();
- if (m!=n)
- throw invalid_argument("inverse_square_root: A must be square");
-
- // Perform SVD, TODO: symmetric SVD?
- Matrix U,V;
- Vector S;
- svd(A,U,S,V);
-
- // invert and sqrt diagonal of S
- // We also arbitrarily choose sign to make result have positive signs
- for(size_t i = 0; i
inline Matrix3 skewSymmetric(const Eigen::MatrixBase& w) { return skewSymmetric(w(0),w(1),w(2));}
-/** Use SVD to calculate inverse square root of a matrix */
+/** Use Cholesky to calculate inverse square root of a matrix */
GTSAM_EXPORT Matrix inverse_square_root(const Matrix& A);
/** Calculate the LL^t decomposition of a S.P.D matrix */
From 1ed07ca4ed30311e4e97c8642c9b28cb999e7622 Mon Sep 17 00:00:00 2001
From: dellaert
Date: Sat, 3 May 2014 12:23:20 -0400
Subject: [PATCH 020/101] Moved to unstable
---
{tests => gtsam_unstable/slam/tests}/testOccupancyGrid.cpp | 0
1 file changed, 0 insertions(+), 0 deletions(-)
rename {tests => gtsam_unstable/slam/tests}/testOccupancyGrid.cpp (100%)
diff --git a/tests/testOccupancyGrid.cpp b/gtsam_unstable/slam/tests/testOccupancyGrid.cpp
similarity index 100%
rename from tests/testOccupancyGrid.cpp
rename to gtsam_unstable/slam/tests/testOccupancyGrid.cpp
From 92c9e9c0aa41d210e60476241998d6af3445a46d Mon Sep 17 00:00:00 2001
From: dellaert
Date: Sat, 3 May 2014 12:23:49 -0400
Subject: [PATCH 021/101] Fixed "unused" warnings
---
gtsam/geometry/tests/testPinholeCamera.cpp | 13 ++++++-------
.../linear/tests/testGaussianBayesNetUnordered.cpp | 2 +-
gtsam/symbolic/tests/testSymbolicBayesNet.cpp | 1 -
.../dynamics/tests/testSimpleHelicopter.cpp | 2 +-
tests/testGaussianISAM2.cpp | 2 --
5 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/gtsam/geometry/tests/testPinholeCamera.cpp b/gtsam/geometry/tests/testPinholeCamera.cpp
index dcf3b2596..6ed49d0d9 100644
--- a/gtsam/geometry/tests/testPinholeCamera.cpp
+++ b/gtsam/geometry/tests/testPinholeCamera.cpp
@@ -183,12 +183,11 @@ TEST( PinholeCamera, Dproject)
}
/* ************************************************************************* */
-static Point2 projectInfinity3(const Pose3& pose, const Point2& point2D, const Cal3_S2& cal) {
- Point3 point(point2D.x(), point2D.y(), 1.0);
- return Camera(pose,cal).projectPointAtInfinity(point);
-}
-
-/* ************************************************************************* */
+//static Point2 projectInfinity3(const Pose3& pose, const Point2& point2D, const Cal3_S2& cal) {
+// Point3 point(point2D.x(), point2D.y(), 1.0);
+// return Camera(pose,cal).projectPointAtInfinity(point);
+//}
+//
//TEST( PinholeCamera, Dproject_Infinity)
//{
// Matrix Dpose, Dpoint, Dcal;
@@ -202,7 +201,7 @@ static Point2 projectInfinity3(const Pose3& pose, const Point2& point2D, const C
// CHECK(assert_equal(numerical_point, Dpoint, 1e-7));
// CHECK(assert_equal(numerical_cal, Dcal, 1e-7));
//}
-
+//
/* ************************************************************************* */
static Point2 project4(const Camera& camera, const Point3& point) {
return camera.project2(point);
diff --git a/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp b/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp
index d87007d0b..ca2b4c3d2 100644
--- a/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp
+++ b/gtsam/linear/tests/testGaussianBayesNetUnordered.cpp
@@ -35,7 +35,7 @@ using namespace boost::assign;
using namespace std;
using namespace gtsam;
-static const Key _x_=0, _y_=1, _z_=2;
+static const Key _x_=0, _y_=1;
static GaussianBayesNet smallBayesNet = list_of
(GaussianConditional(_x_, (Vector(1) << 9.0), (Matrix(1, 1) << 1.0), _y_, (Matrix(1, 1) << 1.0)))
diff --git a/gtsam/symbolic/tests/testSymbolicBayesNet.cpp b/gtsam/symbolic/tests/testSymbolicBayesNet.cpp
index 610e98c58..99a09adc9 100644
--- a/gtsam/symbolic/tests/testSymbolicBayesNet.cpp
+++ b/gtsam/symbolic/tests/testSymbolicBayesNet.cpp
@@ -31,7 +31,6 @@ static const Key _A_ = 1;
static const Key _B_ = 2;
static const Key _C_ = 3;
static const Key _D_ = 4;
-static const Key _E_ = 5;
static SymbolicConditional::shared_ptr
B(new SymbolicConditional(_B_)),
diff --git a/gtsam_unstable/dynamics/tests/testSimpleHelicopter.cpp b/gtsam_unstable/dynamics/tests/testSimpleHelicopter.cpp
index 25d996772..82197302b 100644
--- a/gtsam_unstable/dynamics/tests/testSimpleHelicopter.cpp
+++ b/gtsam_unstable/dynamics/tests/testSimpleHelicopter.cpp
@@ -14,8 +14,8 @@ using namespace gtsam::symbol_shorthand;
const double tol=1e-5;
const double h = 0.01;
-const double deg2rad = M_PI/180.0;
+//const double deg2rad = M_PI/180.0;
//Pose3 g1(Rot3::ypr(deg2rad*10.0, deg2rad*20.0, deg2rad*30.0), Point3(100.0, 200.0, 300.0));
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0));
//LieVector v1((Vector(6) << 0.1, 0.05, 0.02, 10.0, 20.0, 30.0));
diff --git a/tests/testGaussianISAM2.cpp b/tests/testGaussianISAM2.cpp
index 3bcb313b0..55329d8e9 100644
--- a/tests/testGaussianISAM2.cpp
+++ b/tests/testGaussianISAM2.cpp
@@ -35,8 +35,6 @@ using namespace std;
using namespace gtsam;
using boost::shared_ptr;
-const double tol = 1e-4;
-
// SETDEBUG("ISAM2 update", true);
// SETDEBUG("ISAM2 update verbose", true);
// SETDEBUG("ISAM2 recalculate", true);
From 46859474cb39bdcfcfae7f7d58ceb5b23f29ca79 Mon Sep 17 00:00:00 2001
From: Chris Beall
Date: Sat, 3 May 2014 12:55:51 -0400
Subject: [PATCH 022/101] Fix warning
---
gtsam/base/Matrix.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gtsam/base/Matrix.cpp b/gtsam/base/Matrix.cpp
index 92c9a525e..d9ab7d71c 100644
--- a/gtsam/base/Matrix.cpp
+++ b/gtsam/base/Matrix.cpp
@@ -695,7 +695,7 @@ Matrix expm(const Matrix& A, size_t K) {
/* ************************************************************************* */
Matrix Cayley(const Matrix& A) {
- int n = A.cols();
+ size_t n = A.cols();
assert(A.rows() == n);
// original
From a6ae176a54d1bfe29c7b7f913dd6a605010935c7 Mon Sep 17 00:00:00 2001
From: cbeall3
Date: Sat, 3 May 2014 14:44:39 -0400
Subject: [PATCH 023/101] Upgraded to GeographicLib 1.35
---
gtsam/3rdparty/GeographicLib/CMakeLists.txt | 51 ++++--
gtsam/3rdparty/GeographicLib/Makefile.am | 2 +-
gtsam/3rdparty/GeographicLib/Makefile.in | 2 +-
gtsam/3rdparty/GeographicLib/NEWS | 25 ++-
.../GeographicLib/cmake/CMakeLists.txt | 15 +-
.../cmake/project-config.cmake.in | 2 +-
gtsam/3rdparty/GeographicLib/configure | 24 +--
gtsam/3rdparty/GeographicLib/configure.ac | 6 +-
.../GeographicLib/doc/GeographicLib.dox | 151 +++++++++++-------
.../GeographicLib/doc/NETGeographicLib.dox | 14 +-
.../doc/scripts/GeographicLib/Geodesic.js | 2 +-
.../doc/scripts/geod-google-instructions.html | 4 +-
.../doc/scripts/geod-google.html | 15 +-
.../include/GeographicLib/Config.h | 4 +-
.../include/GeographicLib/Constants.hpp | 11 ++
.../include/GeographicLib/Geodesic.hpp | 4 +-
.../include/GeographicLib/GeodesicExact.hpp | 10 +-
.../include/GeographicLib/GeodesicLine.hpp | 4 +-
.../GeographicLib/GeodesicLineExact.hpp | 6 +-
.../include/GeographicLib/Math.hpp | 7 +-
.../include/GeographicLib/UTMUPS.hpp | 2 +-
.../GeographicLib/legacy/C/geodesic.c | 2 +-
.../GeographicLib/legacy/Fortran/geodesic.for | 2 +-
.../3rdparty/GeographicLib/man/CMakeLists.txt | 2 +-
.../3rdparty/GeographicLib/man/CartConvert.1 | 2 +-
.../GeographicLib/man/CartConvert.1.html | 2 +-
.../GeographicLib/man/CartConvert.usage | 2 +-
gtsam/3rdparty/GeographicLib/man/ConicProj.1 | 2 +-
.../GeographicLib/man/ConicProj.1.html | 2 +-
.../GeographicLib/man/ConicProj.usage | 2 +-
gtsam/3rdparty/GeographicLib/man/GeoConvert.1 | 2 +-
.../GeographicLib/man/GeoConvert.1.html | 2 +-
.../GeographicLib/man/GeoConvert.usage | 2 +-
gtsam/3rdparty/GeographicLib/man/GeodSolve.1 | 2 +-
.../GeographicLib/man/GeodSolve.1.html | 2 +-
.../GeographicLib/man/GeodSolve.usage | 2 +-
.../3rdparty/GeographicLib/man/GeodesicProj.1 | 2 +-
.../GeographicLib/man/GeodesicProj.1.html | 2 +-
.../GeographicLib/man/GeodesicProj.usage | 2 +-
gtsam/3rdparty/GeographicLib/man/GeoidEval.1 | 2 +-
.../GeographicLib/man/GeoidEval.1.html | 2 +-
.../GeographicLib/man/GeoidEval.usage | 2 +-
gtsam/3rdparty/GeographicLib/man/Gravity.1 | 2 +-
.../3rdparty/GeographicLib/man/Gravity.1.html | 2 +-
.../3rdparty/GeographicLib/man/Gravity.usage | 2 +-
.../GeographicLib/man/MagneticField.1 | 2 +-
.../GeographicLib/man/MagneticField.1.html | 2 +-
.../GeographicLib/man/MagneticField.usage | 2 +-
gtsam/3rdparty/GeographicLib/man/Makefile.am | 2 +-
gtsam/3rdparty/GeographicLib/man/Makefile.in | 2 +-
gtsam/3rdparty/GeographicLib/man/Planimeter.1 | 4 +-
.../GeographicLib/man/Planimeter.1.html | 4 +-
.../3rdparty/GeographicLib/man/Planimeter.pod | 2 +-
.../GeographicLib/man/Planimeter.usage | 4 +-
.../man/TransverseMercatorProj.1 | 2 +-
.../man/TransverseMercatorProj.1.html | 2 +-
.../man/TransverseMercatorProj.usage | 2 +-
.../GeographicLib/matlab/geodesicdirect.cpp | 92 ++++++-----
.../GeographicLib/matlab/geodesicinverse.cpp | 90 ++++++-----
.../GeographicLib/matlab/geodesicline.cpp | 68 ++++----
gtsam/3rdparty/GeographicLib/pom.xml | 82 ++++++++++
gtsam/3rdparty/GeographicLib/src/UTMUPS.cpp | 10 +-
.../GeographicLib/tools/CMakeLists.txt | 139 +++++++++-------
63 files changed, 584 insertions(+), 336 deletions(-)
create mode 100644 gtsam/3rdparty/GeographicLib/pom.xml
diff --git a/gtsam/3rdparty/GeographicLib/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/CMakeLists.txt
index a72a06bf1..e698f622a 100644
--- a/gtsam/3rdparty/GeographicLib/CMakeLists.txt
+++ b/gtsam/3rdparty/GeographicLib/CMakeLists.txt
@@ -2,21 +2,48 @@ project (GeographicLib)
# Version information
set (PROJECT_VERSION_MAJOR 1)
-set (PROJECT_VERSION_MINOR 34)
+set (PROJECT_VERSION_MINOR 35)
set (PROJECT_VERSION_PATCH 0)
set (PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
if (PROJECT_VERSION_PATCH GREATER 0)
set (PROJECT_VERSION "${PROJECT_VERSION}.${PROJECT_VERSION_PATCH}")
endif ()
-set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
-set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
-set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+if (DEFINED CPACK_PACKAGE_VERSION_COUNT)
+
+ # majic (version 0.1.9 and later) invokes cmake defining, e.g.,
+ # -D CPACK_PACKAGE_VERSION=1.35-SNAPSHOT
+ # -D CPACK_PACKAGE_VERSION_COUNT=2
+ # -D CPACK_PACKAGE_VERSION_MAJOR=1
+ # -D CPACK_PACKAGE_VERSION_MINOR=35
+ # -D CPACK_PACKAGE_VERSION_SUFFIX=-SNAPSHOT
+ # Check that the first two version numbers are consistent.
+ if (CPACK_PACKAGE_VERSION_COUNT EQUAL 2)
+ set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+ elseif (CPACK_PACKAGE_VERSION_COUNT LESS 2)
+ message (FATAL_ERROR "CPACK_PACKAGE_VERSION_COUNT must be 2 or more")
+ endif ()
+ if (NOT (
+ CPACK_PACKAGE_VERSION_MAJOR EQUAL PROJECT_VERSION_MAJOR AND
+ CPACK_PACKAGE_VERSION_MINOR EQUAL PROJECT_VERSION_MINOR))
+ message (FATAL_ERROR "Inconsistency in CPACK and PROJECT version numbers")
+ endif ()
+ set (PROJECT_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH})
+ set (PROJECT_VERSION ${CPACK_PACKAGE_VERSION})
+
+else ()
+
+ set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
+ set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
+ set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
+ set (CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
+
+endif ()
# The library version tracks the numbering given by libtool in the
# autoconf set up.
set (LIBVERSION 10)
-set (LIBVERSIONFULL 10.1.1)
+set (LIBVERSIONFULL 10.1.2)
string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
@@ -201,8 +228,9 @@ if (NOT MSVC)
endif ()
endif ()
-if (NOT CYGWIN)
- # cygwin has a long double but the support for ::cbrtl etc is missing
+if (NOT (CYGWIN OR ANDROID))
+ # cygwin and android have a long double but the support for ::cbrtl,
+ # etc., is missing
include (CheckTypeSize)
check_type_size ("long double" LONG_DOUBLE BUILTIN_TYPES_ONLY)
endif ()
@@ -296,7 +324,12 @@ if (MSVC)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else ()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
- # check for C++11 support
+ # check for C++11 support. If available, the C++11 static_assert and
+ # various math functions (std::atanh, etc.) are used. This flag is
+ # *not* propagated to clients that use GeographicLib. However, this
+ # is of no consequence. When the client code is being compiled (and
+ # the GeographicLib headers being included), work-alike substitutions
+ # for static_assert and std::atanh are used.
include (CheckCXXCompilerFlag)
set (CXX11FLAG "-std=c++11")
check_cxx_compiler_flag (${CXX11FLAG} CXX11TEST1)
@@ -388,7 +421,7 @@ set (CPACK_SOURCE_IGNORE_FILES
"${PROJECT_SOURCE_DIR}/BUILD"
"${PROJECT_SOURCE_DIR}/(tests|testdata|cgi-bin|.*\\\\.cache)/"
"${PROJECT_SOURCE_DIR}/(distrib|.*-distrib|.*-installer|geodesic-papers)/"
- "${PROJECT_SOURCE_DIR}/[^/]*\\\\.(html|kmz|pdf|xml)\$"
+ "${PROJECT_SOURCE_DIR}/[^/]*\\\\.(html|kmz|pdf)\$"
"${PROJECT_SOURCE_DIR}/(autogen|biblio|js-compress)\\\\.sh\$"
"${PROJECT_SOURCE_DIR}/(geodesic-biblio.txt|makefile-admin|[^/]*\\\\.png)\$"
"${PROJECT_SOURCE_DIR}/matlab/matlab-.*blurb.txt\$" )
diff --git a/gtsam/3rdparty/GeographicLib/Makefile.am b/gtsam/3rdparty/GeographicLib/Makefile.am
index 4008b07b8..8accc4719 100644
--- a/gtsam/3rdparty/GeographicLib/Makefile.am
+++ b/gtsam/3rdparty/GeographicLib/Makefile.am
@@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src man tools doc include matlab python cmake examples
-EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL \
+EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL pom.xml \
Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet
dist-hook:
diff --git a/gtsam/3rdparty/GeographicLib/Makefile.in b/gtsam/3rdparty/GeographicLib/Makefile.in
index 44520c36c..a8345a2e2 100644
--- a/gtsam/3rdparty/GeographicLib/Makefile.in
+++ b/gtsam/3rdparty/GeographicLib/Makefile.in
@@ -276,7 +276,7 @@ top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src man tools doc include matlab python cmake examples
-EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL \
+EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL pom.xml \
Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet
all: all-recursive
diff --git a/gtsam/3rdparty/GeographicLib/NEWS b/gtsam/3rdparty/GeographicLib/NEWS
index 1d5614ce7..71b3d25d2 100644
--- a/gtsam/3rdparty/GeographicLib/NEWS
+++ b/gtsam/3rdparty/GeographicLib/NEWS
@@ -4,7 +4,30 @@ For more information, see
http://geographiclib.sourceforge.net/
-The current version of the library is 1.34.
+The current version of the library is 1.35.
+
+Changes between 1.35 (released 2014-03-13) and 1.34 versions:
+
+ * Fix blunder in UTMUPS::EncodeEPSG (found by Ben Adler).
+
+ * Matlab wrapper routines geodesic{direct,inverse,line} switch to
+ "exact" routes if |f| > 0.02.
+
+ * GeodSolve.cgi allows ellipsoid to be set (and uses the -E option
+ for GeodSolve).
+
+ * Set title in HTML versions of man pages for the utility programs.
+
+ * Changes in cmake support:
+ + add _d to names of executables in debug mode of Visual Studio;
+ + add support for Android (cmake-only), thanks to Pullan Yu;
+ + check CPACK version numbers supplied on command line;
+ + configured version of project-config.cmake.in is
+ project-config.cmake (instead of geographiclib-config.cmake), to
+ prevent find_package incorrectly using this file;
+ + fix tests with multi-line output;
+ + this release includes a file, pom.xml, which is used by an
+ experimental build system (based on maven) at SRI.
Changes between 1.34 (released 2013-12-11) and 1.33 versions:
diff --git a/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt
index 51e6c44b2..bbb5192cf 100644
--- a/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt
+++ b/gtsam/3rdparty/GeographicLib/cmake/CMakeLists.txt
@@ -31,14 +31,17 @@ endif ()
# it to prevent the source and build paths appearing in the installed
# config files
set (PROJECT_INCLUDE_DIRS)
-configure_file (project-config.cmake.in
- ${PROJECT_NAME_LOWER}-config.cmake @ONLY)
+configure_file (project-config.cmake.in project-config.cmake @ONLY)
configure_file (project-config-version.cmake.in
- ${PROJECT_NAME_LOWER}-config-version.cmake @ONLY)
+ project-config-version.cmake @ONLY)
install (FILES
- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake"
- DESTINATION "${INSTALL_CMAKE_DIR}")
+ "${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+ RENAME "${PROJECT_NAME_LOWER}-config.cmake")
+install (FILES
+ "${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+ RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
# Make information about the cmake targets (the library and the tools)
# available.
install (EXPORT depends
diff --git a/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in b/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in
index a8b15a098..9bd50c24d 100644
--- a/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in
+++ b/gtsam/3rdparty/GeographicLib/cmake/project-config.cmake.in
@@ -30,7 +30,7 @@ if (IS_ABSOLUTE "@PROJECT_ROOT_DIR@")
set (_ROOT "@PROJECT_ROOT_DIR@")
set (@PROJECT_NAME@_INCLUDE_DIRS "@PROJECT_INCLUDE_DIRS@")
set (@PROJECT_NAME@_LIBRARY_DIRS "${_ROOT}/src")
- set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/src")
+ set (@PROJECT_NAME@_BINARY_DIRS "${_ROOT}/tools")
else ()
# This is an installed package; figure out the paths relative to the
# current directory.
diff --git a/gtsam/3rdparty/GeographicLib/configure b/gtsam/3rdparty/GeographicLib/configure
index cc81327f5..a9a70828a 100755
--- a/gtsam/3rdparty/GeographicLib/configure
+++ b/gtsam/3rdparty/GeographicLib/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GeographicLib 1.34.
+# Generated by GNU Autoconf 2.69 for GeographicLib 1.35.
#
# Report bugs to .
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='GeographicLib'
PACKAGE_TARNAME='geographiclib'
-PACKAGE_VERSION='1.34'
-PACKAGE_STRING='GeographicLib 1.34'
+PACKAGE_VERSION='1.35'
+PACKAGE_STRING='GeographicLib 1.35'
PACKAGE_BUGREPORT='charles@karney.com'
PACKAGE_URL=''
@@ -1339,7 +1339,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures GeographicLib 1.34 to adapt to many kinds of systems.
+\`configure' configures GeographicLib 1.35 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1410,7 +1410,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of GeographicLib 1.34:";;
+ short | recursive ) echo "Configuration of GeographicLib 1.35:";;
esac
cat <<\_ACEOF
@@ -1519,7 +1519,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-GeographicLib configure 1.34
+GeographicLib configure 1.35
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2063,7 +2063,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by GeographicLib $as_me 1.34, which was
+It was created by GeographicLib $as_me 1.35, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3001,7 +3001,7 @@ fi
# Define the identity of the package.
PACKAGE='geographiclib'
- VERSION='1.34'
+ VERSION='1.35'
cat >>confdefs.h <<_ACEOF
@@ -3049,7 +3049,7 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
GEOGRAPHICLIB_VERSION_MAJOR=1
-GEOGRAPHICLIB_VERSION_MINOR=34
+GEOGRAPHICLIB_VERSION_MINOR=35
GEOGRAPHICLIB_VERSION_PATCH=0
cat >>confdefs.h <<_ACEOF
@@ -3098,7 +3098,7 @@ ac_config_headers="$ac_config_headers include/GeographicLib/Config-ac.h"
LT_CURRENT=11
-LT_REVISION=1
+LT_REVISION=2
LT_AGE=1
@@ -16672,7 +16672,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by GeographicLib $as_me 1.34, which was
+This file was extended by GeographicLib $as_me 1.35, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -16738,7 +16738,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-GeographicLib config.status 1.34
+GeographicLib config.status 1.35
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/gtsam/3rdparty/GeographicLib/configure.ac b/gtsam/3rdparty/GeographicLib/configure.ac
index e9fb7b6f2..c0b539c5c 100644
--- a/gtsam/3rdparty/GeographicLib/configure.ac
+++ b/gtsam/3rdparty/GeographicLib/configure.ac
@@ -1,7 +1,7 @@
dnl
dnl Copyright (C) 2009, Francesco P. Lovergine
-AC_INIT([GeographicLib],[1.34],[charles@karney.com])
+AC_INIT([GeographicLib],[1.35],[charles@karney.com])
AC_CANONICAL_SYSTEM
AC_PREREQ(2.61)
AC_CONFIG_SRCDIR(src/Geodesic.cpp)
@@ -9,7 +9,7 @@ AC_CONFIG_MACRO_DIR(m4)
AM_INIT_AUTOMAKE
GEOGRAPHICLIB_VERSION_MAJOR=1
-GEOGRAPHICLIB_VERSION_MINOR=34
+GEOGRAPHICLIB_VERSION_MINOR=35
GEOGRAPHICLIB_VERSION_PATCH=0
AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_MAJOR],
[$GEOGRAPHICLIB_VERSION_MAJOR],[major version number])
@@ -35,7 +35,7 @@ dnl Interfaces changed/added/removed: CURRENT++ REVISION=0
dnl Interfaces added: AGE++
dnl Interfaces removed: AGE=0
LT_CURRENT=11
-LT_REVISION=1
+LT_REVISION=2
LT_AGE=1
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
diff --git a/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox b/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox
index b0f980d19..7fd60e992 100644
--- a/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox
+++ b/gtsam/3rdparty/GeographicLib/doc/GeographicLib.dox
@@ -11,8 +11,8 @@
/**
\mainpage GeographicLib library
\author Charles F. F. Karney (charles@karney.com)
-\version 1.34
-\date 2013-12-11
+\version 1.35
+\date 2014-03-13
\section abstract Abstract
@@ -45,22 +45,22 @@ The main project page is at
http://sourceforge.net/projects/geographiclib
.
The code is available for download at
--
- GeographicLib-1.34.tar.gz
--
- GeographicLib-1.34.zip
+-
+ GeographicLib-1.35.tar.gz
+-
+ GeographicLib-1.35.zip
.
as either a compressed tar file (tar.gz) or a zip file. (The two
archives have identical contents, except that the zip file has DOS
line endings.) Alternatively you can get the latest release using git
\verbatim
- git clone -b r1.34 git://git.code.sf.net/p/geographiclib/code geographiclib
+ git clone -b r1.35 git://git.code.sf.net/p/geographiclib/code geographiclib
\endverbatim
There are also binary installers for Windows available at
--
- GeographicLib-1.34-win32.exe
--
- GeographicLib-1.34-win64.exe
+-
+ GeographicLib-1.35-win32.exe
+-
+ GeographicLib-1.35-win64.exe
.
It is licensed under the
MIT/X11 License;
@@ -180,14 +180,14 @@ Back to \ref intro. Forward to \ref start. Up to \ref contents.
(versions 4.0 and later) and under Windows with Visual Studio 2005, 2008,
and 2010. Earlier versions were tested also under Darwin and Solaris. It
should compile on a wide range of other systems. First download either
-
-GeographicLib-1.34.tar.gz or
-
-GeographicLib-1.34.zip (or
-
-GeographicLib-1.34-win32.exe or
-
-GeographicLib-1.34-win64.exe for binary installation under Windows).
+
+GeographicLib-1.35.tar.gz or
+
+GeographicLib-1.35.zip (or
+
+GeographicLib-1.35-win32.exe or
+
+GeographicLib-1.35-win64.exe for binary installation under Windows).
Then pick one of the first five options below:
- \ref cmake. This is the preferred installation method as it will work
on the widest range of platforms. However it requires that you have
@@ -262,10 +262,10 @@ g++ on Linux and with the Visual Studio IDE on Windows.
Here are the steps to compile and install %GeographicLib:
- Unpack the source, running one of \verbatim
- tar xfpz GeographicLib-1.34.tar.gz
- unzip -q GeographicLib-1.34.zip \endverbatim
+ tar xfpz GeographicLib-1.35.tar.gz
+ unzip -q GeographicLib-1.35.zip \endverbatim
then enter the directory created with one of \verbatim
- cd GeographicLib-1.34 \endverbatim
+ cd GeographicLib-1.35 \endverbatim
- Create a separate build directory and enter it, for example, \verbatim
mkdir BUILD
cd BUILD \endverbatim
@@ -273,8 +273,8 @@ Here are the steps to compile and install %GeographicLib:
and MacOSX systems, the command is \verbatim
cmake .. \endverbatim
For Windows, the command is typically one of \verbatim
- cmake -G "Visual Studio 10" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10/GeographicLib-1.34 ..
- cmake -G "Visual Studio 9 2008" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc9/GeographicLib-1.34 ..
+ cmake -G "Visual Studio 10" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10/GeographicLib-1.35 ..
+ cmake -G "Visual Studio 9 2008" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc9/GeographicLib-1.35 ..
\endverbatim
The definitions of CMAKE_INSTALL_PREFIX are optional (see below). The
settings given above are recommended to ensure that packages that use
@@ -290,7 +290,7 @@ Here are the steps to compile and install %GeographicLib:
convention. If it is on ON (the Linux default), the installation
is to a common directory, e.g., /usr/local. If it is OFF (the
Windows default), the installation directory contains the package
- name, e.g., C:/pkg/GeographicLib-1.34. The installation
+ name, e.g., C:/pkg/GeographicLib-1.35. The installation
directories for the documentation, cmake configuration, python and
matlab interfaces all depend on the variable with deeper paths
relative to CMAKE_INSTALL_PREFIX being used when it's ON:
@@ -305,7 +305,7 @@ Here are the steps to compile and install %GeographicLib:
For windows systems, it is recommended to use a prefix which
includes the compiler version, as shown above (and also, possibly,
whether this is a 64-bit build, e.g., cmake -G "Visual Studio
- 10 Win64" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10-x64/GeographicLib-1.34
+ 10 Win64" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10-x64/GeographicLib-1.35
..). If you just want to try the library to see if it suits
your needs, pick, for example,
CMAKE_INSTALL_PREFIX=/tmp/geographic.
@@ -394,9 +394,9 @@ Here are the steps to compile and install %GeographicLib:
The method works on most Unix-like systems including Linux and Mac OS X.
Here are the steps to compile and install %GeographicLib:
- Unpack the source, running \verbatim
- tar xfpz GeographicLib-1.34.tar.gz \endverbatim
+ tar xfpz GeographicLib-1.35.tar.gz \endverbatim
then enter the directory created \verbatim
- cd GeographicLib-1.34 \endverbatim
+ cd GeographicLib-1.35 \endverbatim
- Create a separate build directory and enter it, for example, \verbatim
mkdir BUILD
cd BUILD \endverbatim
@@ -425,9 +425,9 @@ and g++. This builds a static library and the examples.
Here are the steps to compile and install %GeographicLib:
- Unpack the source, running \verbatim
- tar xfpz GeographicLib-1.34.tar.gz \endverbatim
+ tar xfpz GeographicLib-1.35.tar.gz \endverbatim
then enter the directory created \verbatim
- cd GeographicLib-1.34 \endverbatim
+ cd GeographicLib-1.35 \endverbatim
- Edit \verbatim
include/GeographicLib/Config.h \endverbatim
If your C++ compiler does not recognize the long double type
@@ -458,8 +458,8 @@ static library and the utilities. If you only have Visual Studio 2003,
use cmake to create the necessary solution file, see \ref cmake. (cmake
is needed to build the Matlab interface and to run the tests.)
- Unpack the source, running \verbatim
- unzip -q GeographicLib-1.34.zip \endverbatim
-- Open GeographicLib-1.34/windows/GeographicLib-vc10.sln in Visual Studio
+ unzip -q GeographicLib-1.35.zip \endverbatim
+- Open GeographicLib-1.35/windows/GeographicLib-vc10.sln in Visual Studio
2010 (for Visual Studio 2005 and 2008, replace -vc10 by -vc8 or -vc9).
- Pick the build type (e.g., Release), and select "Build Solution".
- The library and the compiled examples are in the windows/Release.
@@ -486,14 +486,14 @@ be advisable to build it with the compiler you are using for your own
code using either \ref cmake or \ref windows.
Download and run
-
-GeographicLib-1.34-win32.exe or
-
-GeographicLib-1.34-win64.exe:
+
+GeographicLib-1.35-win32.exe or
+
+GeographicLib-1.35-win64.exe:
- read the MIT/X11 License agreement,
- select whether you want your PATH modified,
- select the installation folder, by default
- C:\\pkg-vc10\\GeographicLib-1.34 or C:\\pkg-vc10-x64\\GeographicLib-1.34,
+ C:\\pkg-vc10\\GeographicLib-1.35 or C:\\pkg-vc10-x64\\GeographicLib-1.35,
- select the start menu folder,
- and install.
.
@@ -501,7 +501,7 @@ GeographicLib-1.34-win64.exe:
given in \ref cmake.) The start menu will now include links to the
documentation for the library and for the utilities (and a link for
uninstalling the library). If you ask for your PATH to be modified, it
-will include C:/pkg-vc10/GeographicLib-1.34/bin where the utilities are
+will include C:/pkg-vc10/GeographicLib-1.35/bin where the utilities are
installed. The headers and library are installed in the
include/GeographicLib and lib folders. With the 64-bit installer, the
Matlab interface is installed in the matlab folder. Add this to your
@@ -552,7 +552,7 @@ Check the code out of git with \verbatim
Here the "master" branch is checked out. There are three branches in
the git repository:
- master: the main branch for code maintainence. Releases are
- tagged on this branch as, e.g., v1.34.
+ tagged on this branch as, e.g., v1.35.
- devel: the development branch; changes made here are merged
into master.
- release: the release branch created by unpacking the source
@@ -562,7 +562,7 @@ the git repository:
specifying a branch). This differs from the master branch in that
some administrative files are excluded while some intermediate files
are included (in order to aid building on as many platforms as
- possible). Releases are tagged on this branch as, e.g., r1.34.
+ possible). Releases are tagged on this branch as, e.g., r1.35.
.
The autoconf configuration script and the formatted man pages are not
checked into master branch of the repository. In order to create the
@@ -578,8 +578,8 @@ In the case of cmake, you then run \verbatim
which will copy the man pages from the build directory back into the
source tree and package the resulting source tree for distribution as
\verbatim
- GeographicLib-1.34.tar.gz
- GeographicLib-1.34.zip \endverbatim
+ GeographicLib-1.35.tar.gz
+ GeographicLib-1.35.zip \endverbatim
Finally, \verbatim
make package \endverbatim
or building PACKAGE in Visual Studio will create a binary installer for
@@ -605,7 +605,7 @@ With configure, run \verbatim
make dist-gzip \endverbatim
which will create the additional files and packages the results ready
for distribution as \verbatim
- geographiclib-1.34.tar.gz \endverbatim
+ geographiclib-1.35.tar.gz \endverbatim
Back to \ref intro. Forward to \ref start. Up to \ref contents.
@@ -695,7 +695,7 @@ In order to use %GeographicLib from C++ code, you will need to
If %GeographicLib is found, then the following cmake variables are set:
- GeographicLib_FOUND = 1
- - GeographicLib_VERSION = 1.34
+ - GeographicLib_VERSION = 1.35
- GeographicLib_INCLUDE_DIRS
- GeographicLib_LIBRARIES = one of the following two:
- GeographicLib_SHARED_LIBRARIES = %GeographicLib
@@ -1120,9 +1120,9 @@ feature of %GeographicLib, but want your code still to work with older
versions. In that case, you can test the values of the macros
GEOGRAPHICLIB_VERSION_MAJOR, GEOGRAPHICLIB_VERSION_MINOR, and
GEOGRAPHICLIB_VERSION_PATCH; these expand to numbers (and the last one
-is usually 0); these macros appeared starting in version 1.34. There's
+is usually 0); these macros appeared starting in version 1.31. There's
also a macro GEOGRAPHICLIB_VERSION_STRING which expands to, e.g.,
-"1.34"; this macro has been defined since version 1.9.
+"1.35"; this macro has been defined since version 1.9.
Back to \ref utilities. Forward to \ref other. Up to \ref contents.
@@ -1274,7 +1274,7 @@ The matlab directory contains
- Native Matlab implementations of the geodesic routines. To use
these, start Matlab or Octave and run one of (for example) \verbatim
addpath /usr/local/libexec/GeographicLib/matlab
- addpath 'C:/pkg-vc10-x64/GeographicLib-1.34/libexec/GeographicLib/matlab'
+ addpath 'C:/pkg-vc10-x64/GeographicLib-1.35/libexec/GeographicLib/matlab'
\endverbatim
The available functions are:
- geoddoc: briefly descibe the routines
@@ -1345,9 +1345,9 @@ There are two ways of compiling the interface code: (1) using cmake and
- Invoking the compiler from Matlab or Octave: Start Matlab or
Octave and run, e.g., \code
mex -setup
- cd 'C:/pkg-vc10-x64/GeographicLib-1.34/matlab'
+ cd 'C:/pkg-vc10-x64/GeographicLib-1.35/matlab'
help geographiclibinterface
- geographiclibinterface('C:/pkg-vc10/GeographicLib-1.34');
+ geographiclibinterface('C:/pkg-vc10/GeographicLib-1.35');
addpath(pwd);
\endcode
The first command allows you to select the compiler to use (which
@@ -1356,7 +1356,7 @@ There are two ways of compiling the interface code: (1) using cmake and
To use the interface routines for %GeographicLib, run one of (for
example) \verbatim
addpath /usr/local/libexec/GeographicLib/matlab
- addpath 'C:/pkg-vc10-x64/GeographicLib-1.34/libexec/GeographicLib/matlab'
+ addpath 'C:/pkg-vc10-x64/GeographicLib-1.35/libexec/GeographicLib/matlab'
\endverbatim
in Octave or Matlab. The available functions are:
- geodesicdirect: solve direct geodesic problem
@@ -4048,7 +4048,7 @@ starting point of this geodesic is \f$\beta_1 = 87.48^\circ\f$, \f$\omega_1 =
0^\circ\f$, and \f$\alpha_1 = 90^\circ\f$.
If the starting point is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 \in
-(0^\circ, 180^\circ)\f$, and \f$\alpha_1 = 0^\circ\f$, then the geodesic
+(0^\circ, 180^\circ)\f$, and \f$\alpha_1 = 180^\circ\f$, then the geodesic
encircles the ellipsoid in a "transpolar" sense. The geodesic
oscillates east and west of the ellipse \f$x = 0\f$; on each oscillation
it completes slightly more that a full circuit around the ellipsoid
@@ -4067,7 +4067,7 @@ Fig. 4
Fig. 4:
Example of a transpolar geodesic on a triaxial ellipsoid. The
starting point of this geodesic is \f$\beta_1 = 90^\circ\f$, \f$\omega_1 =
-39.9^\circ\f$, and \f$\alpha_1 = 0^\circ\f$.
+39.9^\circ\f$, and \f$\alpha_1 = 180^\circ\f$.
).
- If only one point is an umbilicial point, the azimuth at the
non-umbilical point is found using the generalization of Clairaut's
equation (given above) with \f$\gamma = 0\f$.
- - If both points lie on the equator \f$\beta = 0\f$, then determine the
- reduced length \f$m_{12}\f$ for the geodesic which is the shorter
- path along the ellipse \f$z = 0\f$. If \f$m_{12} \ge 0\f$, then this
- is the shortest path on the ellipsoid; otherwise proceed to the
- general case (next).
+ - Treat the cases where the geodesic might follow a line of constant
+ \f$\beta\f$. There are two such cases: (a) the points lie on the
+ ellipse \f$z = 0\f$ on a general ellipsoid and (b) the points lie on
+ an ellipse whose major axis is the \f$x\f$ axis on a prolate ellipsoid
+ (\f$a = b > c\f$). Determine the reduced length \f$m_{12}\f$ for the
+ geodesic which is the shorter path along the ellipse. If \f$m_{12}
+ \ge 0\f$, then this is the shortest path on the ellipsoid; otherwise
+ proceed to the general case (next).
- Swap the points, if necessary, so that the first point is the one
closest to a pole. Estimate \f$\alpha_1\f$ (by some means) and solve
the \e hybrid problem, i.e., determine the longitude \f$\omega_2\f$
@@ -4238,6 +4241,12 @@ The shortest path found by this method is unique unless:
- The points are opposite umbilical points. In this case,
\f$\alpha_1\f$ can take on any value and \f$\alpha_2\f$ needs to be
adjusted to maintain the value of \f$\tan\alpha_1 / \tan\alpha_2\f$.
+ Note that \f$\alpha\f$ increases by \f$\pm 90^\circ\f$ as the
+ geodesic passes through an umbilical point, depending on whether the
+ geodesic is considered as passing to the right or left of the point.
+ Here \f$\alpha_2\f$ is the \e forward azimuth at the second umbilical
+ point, i.e., its azimuth immediately \e after passage through the
+ umbilical point.
- \f$\beta_1 + \beta_2 = 0\f$ and \f$\cos\alpha_1\f$ and
\f$\cos\alpha_2\f$ have opposite signs. In this case, there another
shortest geodesic with azimuths \f$\pi - \alpha_1\f$ and
@@ -4757,6 +4766,26 @@ been migrated to the archive subdirectory). All the releases are
available as tags “rm.nn” in the the "release" branch
of the git repository for %GeographicLib.
+ - Version 1.35
+ (released 2014-03-13)
+ - Fix blunder in GeographicLib::UTMUPS::EncodeEPSG (found by Ben
+ Adler).
+ - Matlab wrapper routines geodesic{direct,inverse,line} switch to
+ "exact" routes if |f| > 0.02.
+ - GeodSolve.cgi allows ellipsoid to be set (and uses the -E option
+ for GeodSolve).
+ - Set title in HTML versions of man pages for the \ref utilities.
+ - Changes in cmake support:
+ - add _d to names of executables in debug mode of Visual Studio;
+ - add support for Android (cmake-only), thanks to Pullan Yu;
+ - check CPACK version numbers supplied on command line;
+ - configured version of project-config.cmake.in is
+ project-config.cmake (instead of geographiclib-config.cmake), to
+ prevent find_package incorrectly using this file;
+ - fix tests with multi-line output;
+ - this release includes a file, pom.xml, which is used by an
+ experimental build system (based on maven) at SRI.
+
- Version 1.34
(released 2013-12-11)
- Many changes in cmake support:
diff --git a/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox
index 89b934a7d..fd8f5e057 100644
--- a/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox
+++ b/gtsam/3rdparty/GeographicLib/doc/NETGeographicLib.dox
@@ -11,8 +11,8 @@
/**
\mainpage NETGeographicLib library
\author Scott Heiman (mrmtdew2@outlook.com)
-\version 1.34
-\date 2013-12-11
+\version 1.35
+\date 2014-03-13
\section abstract Abstract
@@ -26,14 +26,14 @@ to the GeographicLib classes. GeographicLib and NETGeographicLib is an
integrated product.
The NETGeographic project in the GeographicLib-vc10.sln file located in
-\/GeographicLib-1.34/windows will create the NETGeographicLib
+\/GeographicLib-1.35/windows will create the NETGeographicLib
DLL. The source code for NETGeographicLib is located in
-\/GeographicLib-1.34/dotnet/NETGeographicLib. NETGeographicLib
+\/GeographicLib-1.35/dotnet/NETGeographicLib. NETGeographicLib
is not available for older versions of Microsoft Visual Studio.
NETGeographicLib has been tested with C#, Managed C++, and Visual Basic.
Sample code snippets can be found in
-\/GeographicLib-1.34/dotnet/examples.
+\/GeographicLib-1.35/dotnet/examples.
\section differences Differences between NETGeographicLib and GeographicLib
@@ -135,7 +135,7 @@ to any Visual Basic source that uses NETGeographicLib classes.
A C# sample application is provided that demonstrates NETGeographicLib classes.
The source code for the sample application is located in
-\/GeographicLib-1.34/dotnet/Projections. The sample
+\/GeographicLib-1.35/dotnet/Projections. The sample
application creates a tabbed dialog. Each tab provides data entry fields that
allow the user to exercise one or more NETGeographicLib classes.
@@ -200,7 +200,7 @@ code using the installed library: \verbatim
project (geodesictest)
cmake_minimum_required (VERSION 2.8.7) # required for VS_DOTNET_REFERENCES
-find_package (GeographicLib 1.34 REQUIRED COMPONENTS NETGeographicLib)
+find_package (GeographicLib 1.35 REQUIRED COMPONENTS NETGeographicLib)
add_executable (${PROJECT_NAME} example-Geodesic-small.cpp)
set_target_properties (${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "/clr")
diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js
index 09d22593a..cf059126f 100644
--- a/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js
+++ b/gtsam/3rdparty/GeographicLib/doc/scripts/GeographicLib/Geodesic.js
@@ -753,7 +753,7 @@ GeographicLib.GeodesicLine = {};
// Add the check for sig12 since zero length geodesics might yield
// m12 < 0. Test case was
//
- // echo 20.001 0 20.001 0 | Geod -i
+ // echo 20.001 0 20.001 0 | GeodSolve -i
//
// In fact, we will have sig12 > pi/2 for meridional geodesic
// which is not a shortest path.
diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html
index 8d6f25c56..89c2e5605 100644
--- a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html
+++ b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google-instructions.html
@@ -101,8 +101,8 @@
In putting together this Google Maps demonstration, I started with
the sample code
-
- geometry-headings.html.
+
+ geometry-headings.
Charles Karney
diff --git a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html
index 35576cf87..5a48d7e2e 100644
--- a/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html
+++ b/gtsam/3rdparty/GeographicLib/doc/scripts/geod-google.html
@@ -24,13 +24,18 @@
Google Maps,
WGS84 ellipsoid,
GeographicLib" />
-
+
-
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h
index 1e5e30b9b..2249dd127 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Config.h
@@ -1,8 +1,8 @@
// This will be overwritten by ./configure
-#define GEOGRAPHICLIB_VERSION_STRING "1.34"
+#define GEOGRAPHICLIB_VERSION_STRING "1.35"
#define GEOGRAPHICLIB_VERSION_MAJOR 1
-#define GEOGRAPHICLIB_VERSION_MINOR 34
+#define GEOGRAPHICLIB_VERSION_MINOR 35
#define GEOGRAPHICLIB_VERSION_PATCH 0
// Undefine HAVE_LONG_DOUBLE if this type is unknown to the compiler
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp
index e37ec62ce..99baff31f 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Constants.hpp
@@ -21,6 +21,17 @@
# elif defined(__GXX_EXPERIMENTAL_CXX0X__)
# define STATIC_ASSERT static_assert
# elif defined(_MSC_VER) && _MSC_VER >= 1600
+// For reference, here is a table of Visual Studio and _MSC_VER
+// correspondences:
+//
+// _MSC_VER Visual Studio
+// 1300 vc7
+// 1311 vc7.1 (2003)
+// 1400 vc8 (2005)
+// 1500 vc9 (2008)
+// 1600 vc10 (2010)
+// 1700 vc11 (2012)
+// 1800 vc12 (2013)
# define STATIC_ASSERT static_assert
# else
# define STATIC_ASSERT(cond,reason) \
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp
index cd687acce..6cec279a2 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Geodesic.hpp
@@ -162,8 +162,8 @@ namespace GeographicLib {
* Example of use:
* \include example-Geodesic.cpp
*
- * Geod is a command-line utility providing access
- * to the functionality of Geodesic and GeodesicLine.
+ * GeodSolve is a command-line utility
+ * providing access to the functionality of Geodesic and GeodesicLine.
**********************************************************************/
class GEOGRAPHICLIB_EXPORT Geodesic {
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp
index c0444f70e..e76daee4c 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicExact.hpp
@@ -25,7 +25,7 @@ namespace GeographicLib {
class GeodesicLineExact;
/**
- * \brief Exact %Geodesic calculations
+ * \brief Exact geodesic calculations
*
* The equations for geodesics on an ellipsoid can be expressed in terms of
* incomplete elliptic integrals. The Geodesic class expands these integrals
@@ -67,14 +67,14 @@ namespace GeographicLib {
* about 8 decimal digits for \e b/\e a ∈ [1/4, 4].
*
* See \ref geodellip for the formulation. See the documentation on the
- * Geodesic class for additional information on the geodesics problems.
+ * Geodesic class for additional information on the geodesic problems.
*
* Example of use:
* \include example-GeodesicExact.cpp
*
- * Geod is a command-line utility providing access
- * to the functionality of GeodesicExact and GeodesicLineExact (via the -E
- * option).
+ * GeodSolve is a command-line utility
+ * providing access to the functionality of GeodesicExact and
+ * GeodesicLineExact (via the -E option).
**********************************************************************/
class GEOGRAPHICLIB_EXPORT GeodesicExact {
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp
index fd968e2cf..c901b3007 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLine.hpp
@@ -52,8 +52,8 @@ namespace GeographicLib {
* Example of use:
* \include example-GeodesicLine.cpp
*
- * Geod is a command-line utility providing access
- * to the functionality of Geodesic and GeodesicLine.
+ * GeodSolve is a command-line utility
+ * providing access to the functionality of Geodesic and GeodesicLine.
**********************************************************************/
class GEOGRAPHICLIB_EXPORT GeodesicLine {
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp
index ca7d0d211..a2e19f845 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/GeodesicLineExact.hpp
@@ -27,9 +27,9 @@ namespace GeographicLib {
* Example of use:
* \include example-GeodesicLineExact.cpp
*
- * Geod is a command-line utility providing access
- * to the functionality of GeodesicExact and GeodesicLineExact (via the -E
- * option).
+ * GeodSolve is a command-line utility
+ * providing access to the functionality of GeodesicExact and
+ * GeodesicLineExact (via the -E option).
**********************************************************************/
class GEOGRAPHICLIB_EXPORT GeodesicLineExact {
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp
index 9971ebdf0..2ef649e96 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/Math.hpp
@@ -18,8 +18,11 @@
* Are C++11 math functions available?
**********************************************************************/
#if !defined(GEOGRAPHICLIB_CPLUSPLUS11_MATH)
-# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 8 \
- && __cplusplus >= 201103
+# if defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ >= 7 \
+ && __cplusplus >= 201103 && !(defined(__ANDROID__) || defined(ANDROID))
+// The android toolchain uses g++ and supports C++11, but not, apparently, the
+// new mathematical functions introduced with C++11. Android toolchains might
+// define __ANDROID__ or ANDROID; so need to check both.
# define GEOGRAPHICLIB_CPLUSPLUS11_MATH 1
# elif defined(_MSC_VER) && _MSC_VER >= 1800
# define GEOGRAPHICLIB_CPLUSPLUS11_MATH 1
diff --git a/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp b/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp
index 512ba5c43..9fc19c66e 100644
--- a/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp
+++ b/gtsam/3rdparty/GeographicLib/include/GeographicLib/UTMUPS.hpp
@@ -70,7 +70,7 @@ namespace GeographicLib {
static const int epsg01N = 32601; // EPSG code for UTM 01N
static const int epsg60N = 32660; // EPSG code for UTM 60N
static const int epsgN = 32661; // EPSG code for UPS N
- static const int epsg01S = 32701; // EPSG code for UTM 01N
+ static const int epsg01S = 32701; // EPSG code for UTM 01S
static const int epsg60S = 32760; // EPSG code for UTM 60S
static const int epsgS = 32761; // EPSG code for UPS S
static real CentralMeridian(int zone) throw()
diff --git a/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c b/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c
index bd9fc960f..f46a6ff41 100644
--- a/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c
+++ b/gtsam/3rdparty/GeographicLib/legacy/C/geodesic.c
@@ -700,7 +700,7 @@ real geod_geninverse(const struct geod_geodesic* g,
/* Add the check for sig12 since zero length geodesics might yield m12 <
* 0. Test case was
*
- * echo 20.001 0 20.001 0 | Geod -i
+ * echo 20.001 0 20.001 0 | GeodSolve -i
*
* In fact, we will have sig12 > pi/2 for meridional geodesic which is
* not a shortest path. */
diff --git a/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for
index 6501363c1..aaef081c5 100644
--- a/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for
+++ b/gtsam/3rdparty/GeographicLib/legacy/Fortran/geodesic.for
@@ -685,7 +685,7 @@
* Add the check for sig12 since zero length geodesics might yield m12 <
* 0. Test case was
*
-* echo 20.001 0 20.001 0 | Geod -i
+* echo 20.001 0 20.001 0 | GeodSolve -i
*
* In fact, we will have sig12 > pi/2 for meridional geodesic which is
* not a shortest path.
diff --git a/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt b/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt
index d8af12998..ccdf213c3 100644
--- a/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt
+++ b/gtsam/3rdparty/GeographicLib/man/CMakeLists.txt
@@ -34,7 +34,7 @@ foreach (TOOL ${TOOLS})
MAIN_DEPENDENCY ${TOOL}.pod)
add_custom_command (OUTPUT ${TOOL}.1.html
COMMAND
- pod2html --noindex ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod |
+ pod2html --title "'${TOOL}(1)'" --noindex ${CMAKE_CURRENT_SOURCE_DIR}/${TOOL}.pod |
sed -e 's%%%'
-e 's%\\\([^<>]*\\\)\(\\\(.\\\)\)%&%'g > ${TOOL}.1.html &&
cp ${TOOL}.1.html ../doc/html-stage/
diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.1 b/gtsam/3rdparty/GeographicLib/man/CartConvert.1
index 02dfbfa5a..9a2f74660 100644
--- a/gtsam/3rdparty/GeographicLib/man/CartConvert.1
+++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "CARTCONVERT 1"
-.TH CARTCONVERT 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH CARTCONVERT 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html b/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html
index 38dcd6af1..17ec77507 100644
--- a/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.1.html
@@ -2,7 +2,7 @@
-
+CartConvert(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/CartConvert.usage b/gtsam/3rdparty/GeographicLib/man/CartConvert.usage
index f9f6f05ac..57374a78f 100644
--- a/gtsam/3rdparty/GeographicLib/man/CartConvert.usage
+++ b/gtsam/3rdparty/GeographicLib/man/CartConvert.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" CartConvert --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/CartConvert.1.html\n";
+" http://geographiclib.sf.net/1.35/CartConvert.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.1 b/gtsam/3rdparty/GeographicLib/man/ConicProj.1
index 85f65f9a6..997017d7f 100644
--- a/gtsam/3rdparty/GeographicLib/man/ConicProj.1
+++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "CONICPROJ 1"
-.TH CONICPROJ 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH CONICPROJ 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html b/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html
index e4af0e6b5..9de3fd683 100644
--- a/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.1.html
@@ -2,7 +2,7 @@
-
+ConicProj(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/ConicProj.usage b/gtsam/3rdparty/GeographicLib/man/ConicProj.usage
index 3fbcc4481..a84aa4fde 100644
--- a/gtsam/3rdparty/GeographicLib/man/ConicProj.usage
+++ b/gtsam/3rdparty/GeographicLib/man/ConicProj.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" ConicProj --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/ConicProj.1.html\n";
+" http://geographiclib.sf.net/1.35/ConicProj.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.1 b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1
index 0dfa11283..747b8cd3f 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeoConvert.1
+++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "GEOCONVERT 1"
-.TH GEOCONVERT 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH GEOCONVERT 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html
index c46e2e7c0..5c117b49e 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.1.html
@@ -2,7 +2,7 @@
-
+GeoConvert(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage b/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage
index 7a0f8a852..19d78a3ef 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage
+++ b/gtsam/3rdparty/GeographicLib/man/GeoConvert.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" GeoConvert --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/GeoConvert.1.html\n";
+" http://geographiclib.sf.net/1.35/GeoConvert.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.1 b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1
index 06ca388e4..3bd025aa4 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeodSolve.1
+++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "GEODSOLVE 1"
-.TH GEODSOLVE 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH GEODSOLVE 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html
index 262bccf3b..8af2af9e7 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.1.html
@@ -2,7 +2,7 @@
-
+GeodSolve(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage b/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage
index 48bc7261e..78ec73ec7 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage
+++ b/gtsam/3rdparty/GeographicLib/man/GeodSolve.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" GeodSolve --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/GeodSolve.1.html\n";
+" http://geographiclib.sf.net/1.35/GeodSolve.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1 b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1
index a4cc6680e..9b87078a3 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1
+++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "GEODESICPROJ 1"
-.TH GEODESICPROJ 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH GEODESICPROJ 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html
index c40ca5a4d..2b63cf7de 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.1.html
@@ -2,7 +2,7 @@
-
+GeodesicProj(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage
index 9a5ab2517..013fb7acf 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage
+++ b/gtsam/3rdparty/GeographicLib/man/GeodesicProj.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" GeodesicProj --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/GeodesicProj.1.html\n";
+" http://geographiclib.sf.net/1.35/GeodesicProj.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.1 b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1
index 681a096f0..7c5086e1c 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeoidEval.1
+++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "GEOIDEVAL 1"
-.TH GEOIDEVAL 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH GEOIDEVAL 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html
index 91f8f3610..ea131d8a7 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.1.html
@@ -2,7 +2,7 @@
-
+GeoidEval(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage b/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage
index 727811108..4fa144ca7 100644
--- a/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage
+++ b/gtsam/3rdparty/GeographicLib/man/GeoidEval.usage
@@ -10,7 +10,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" GeoidEval --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/GeoidEval.1.html\n";
+" http://geographiclib.sf.net/1.35/GeoidEval.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.1 b/gtsam/3rdparty/GeographicLib/man/Gravity.1
index 97e247b7f..96462b244 100644
--- a/gtsam/3rdparty/GeographicLib/man/Gravity.1
+++ b/gtsam/3rdparty/GeographicLib/man/Gravity.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "GRAVITY 1"
-.TH GRAVITY 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH GRAVITY 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.1.html b/gtsam/3rdparty/GeographicLib/man/Gravity.1.html
index 3fbdba19b..cca8ad941 100644
--- a/gtsam/3rdparty/GeographicLib/man/Gravity.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/Gravity.1.html
@@ -2,7 +2,7 @@
-
+Gravity(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/Gravity.usage b/gtsam/3rdparty/GeographicLib/man/Gravity.usage
index 20b522307..d60547f09 100644
--- a/gtsam/3rdparty/GeographicLib/man/Gravity.usage
+++ b/gtsam/3rdparty/GeographicLib/man/Gravity.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" Gravity --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/Gravity.1.html\n";
+" http://geographiclib.sf.net/1.35/Gravity.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/MagneticField.1 b/gtsam/3rdparty/GeographicLib/man/MagneticField.1
index 0659f2325..3d520cb6b 100644
--- a/gtsam/3rdparty/GeographicLib/man/MagneticField.1
+++ b/gtsam/3rdparty/GeographicLib/man/MagneticField.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "MAGNETICFIELD 1"
-.TH MAGNETICFIELD 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH MAGNETICFIELD 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
diff --git a/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html b/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html
index cac6794c8..dd1884602 100644
--- a/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/MagneticField.1.html
@@ -2,7 +2,7 @@
-
+MagneticField(1)
diff --git a/gtsam/3rdparty/GeographicLib/man/MagneticField.usage b/gtsam/3rdparty/GeographicLib/man/MagneticField.usage
index b6b89d0de..9f1ca8b9b 100644
--- a/gtsam/3rdparty/GeographicLib/man/MagneticField.usage
+++ b/gtsam/3rdparty/GeographicLib/man/MagneticField.usage
@@ -10,7 +10,7 @@ int usage(int retval, bool brief) {
"For full documentation type:\n"
" MagneticField --help\n"
"or visit:\n"
-" http://geographiclib.sf.net/1.34/MagneticField.1.html\n";
+" http://geographiclib.sf.net/1.35/MagneticField.1.html\n";
else
( retval ? std::cerr : std::cout ) << "Man page:\n"
"NAME\n"
diff --git a/gtsam/3rdparty/GeographicLib/man/Makefile.am b/gtsam/3rdparty/GeographicLib/man/Makefile.am
index 8fae122f6..cad9e45ce 100644
--- a/gtsam/3rdparty/GeographicLib/man/Makefile.am
+++ b/gtsam/3rdparty/GeographicLib/man/Makefile.am
@@ -62,7 +62,7 @@ if HAVE_PODPROGS
$(POD2MAN) $^ > $@
.pod.1.html:
- pod2html --noindex $^ | $(PODFIX) > $@
+ pod2html --noindex --tile "$*(1)" $^ | $(PODFIX) > $@
else
diff --git a/gtsam/3rdparty/GeographicLib/man/Makefile.in b/gtsam/3rdparty/GeographicLib/man/Makefile.in
index b434fd523..3399f753c 100644
--- a/gtsam/3rdparty/GeographicLib/man/Makefile.in
+++ b/gtsam/3rdparty/GeographicLib/man/Makefile.in
@@ -567,7 +567,7 @@ htmlman: $(HTMLMAN)
@HAVE_PODPROGS_TRUE@ $(POD2MAN) $^ > $@
@HAVE_PODPROGS_TRUE@.pod.1.html:
-@HAVE_PODPROGS_TRUE@ pod2html --noindex $^ | $(PODFIX) > $@
+@HAVE_PODPROGS_TRUE@ pod2html --noindex --tile "$*(1)" $^ | $(PODFIX) > $@
@HAVE_PODPROGS_FALSE@CartConvert.usage:
@HAVE_PODPROGS_FALSE@ $(USAGECMD)
diff --git a/gtsam/3rdparty/GeographicLib/man/Planimeter.1 b/gtsam/3rdparty/GeographicLib/man/Planimeter.1
index 28bbbf46f..07e1563cd 100644
--- a/gtsam/3rdparty/GeographicLib/man/Planimeter.1
+++ b/gtsam/3rdparty/GeographicLib/man/Planimeter.1
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "PLANIMETER 1"
-.TH PLANIMETER 1 "2013-12-11" "GeographicLib 1.34" "GeographicLib Utilities"
+.TH PLANIMETER 1 "2014-03-13" "GeographicLib 1.35" "GeographicLib Utilities"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
@@ -200,7 +200,7 @@ is allowed for \fIf\fR. (Also, if \fIf\fR > 1, the flattening is set to
1/\fIf\fR.) By default, the \s-1WGS84\s0 ellipsoid is used, \fIa\fR = 6378137 m,
\&\fIf\fR = 1/298.257223563. If entering vertices as \s-1UTM/UPS\s0 or \s-1MGRS\s0
coordinates, use the default ellipsoid, since the conversion of these
-coordinates to latitude and longitude uses the \s-1WGS84\s0 parameters.
+coordinates to latitude and longitude always uses the \s-1WGS84\s0 parameters.
.IP "\fB\-\-comment\-delimiter\fR" 4
.IX Item "--comment-delimiter"
set the comment delimiter to \fIcommentdelim\fR (e.g., \*(L"#\*(R" or \*(L"//\*(R"). If
diff --git a/gtsam/3rdparty/GeographicLib/man/Planimeter.1.html b/gtsam/3rdparty/GeographicLib/man/Planimeter.1.html
index b86a5ecd7..7a6eb52c4 100644
--- a/gtsam/3rdparty/GeographicLib/man/Planimeter.1.html
+++ b/gtsam/3rdparty/GeographicLib/man/Planimeter.1.html
@@ -2,7 +2,7 @@
-
+Planimeter(1)
@@ -56,7 +56,7 @@
-e
-
specify the ellipsoid via af; the equatorial radius is a and the flattening is f. Setting f = 0 results in a sphere. Specify f < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563. If entering vertices as UTM/UPS or MGRS coordinates, use the default ellipsoid, since the conversion of these coordinates to latitude and longitude uses the WGS84 parameters.
+
specify the ellipsoid via af; the equatorial radius is a and the flattening is f. Setting f = 0 results in a sphere. Specify f < 0 for a prolate ellipsoid. A simple fraction, e.g., 1/297, is allowed for f. (Also, if f > 1, the flattening is set to 1/f.) By default, the WGS84 ellipsoid is used, a = 6378137 m, f = 1/298.257223563. If entering vertices as UTM/UPS or MGRS coordinates, use the default ellipsoid, since the conversion of these coordinates to latitude and longitude always uses the WGS84 parameters.