From f7ad80673c0a2263812aa2f47ae8509269f3b583 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Mon, 6 May 2019 16:37:34 -0400 Subject: [PATCH] Moved things to inl --- gtsam/geometry/SOn-inl.h | 26 ++++++++++++++++++++++++++ gtsam/geometry/SOn.h | 23 ++++++++++------------- 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/gtsam/geometry/SOn-inl.h b/gtsam/geometry/SOn-inl.h index 26dc2229b..826efe1ee 100644 --- a/gtsam/geometry/SOn-inl.h +++ b/gtsam/geometry/SOn-inl.h @@ -97,6 +97,32 @@ typename SO::TangentVector SO::ChartAtOrigin::Local(const SO& R, return -2 * Vee(X); } +template +typename SO::MatrixDD SO::AdjointMap() const { + throw std::runtime_error( + "SO::AdjointMap only implemented for SO3 and SO4."); +} + +template +SO SO::Expmap(const TangentVector& omega, ChartJacobian H) { + throw std::runtime_error("SO::Expmap only implemented for SO3 and SO4."); +} + +template +typename SO::MatrixDD SO::ExpmapDerivative(const TangentVector& omega) { + throw std::runtime_error("SO::ExpmapDerivative only implemented for SO3."); +} + +template +typename SO::TangentVector SO::Logmap(const SO& R, ChartJacobian H) { + throw std::runtime_error("SO::Logmap only implemented for SO3 and SO4."); +} + +template +typename SO::MatrixDD SO::LogmapDerivative(const TangentVector& omega) { + throw std::runtime_error("O::LogmapDerivative only implemented for SO3."); +} + template typename SO::VectorN2 SO::vec( OptionalJacobian H) const { diff --git a/gtsam/geometry/SOn.h b/gtsam/geometry/SOn.h index 64718ed5f..45fe43519 100644 --- a/gtsam/geometry/SOn.h +++ b/gtsam/geometry/SOn.h @@ -220,27 +220,24 @@ class SO : public LieGroup, internal::DimensionSO(N)> { /// @name Lie Group /// @{ - MatrixDD AdjointMap() const { - throw std::runtime_error( - "SO::AdjointMap only implemented for SO3 and SO4."); - } + /// Adjoint map + MatrixDD AdjointMap() const; /** * Exponential map at identity - create a rotation from canonical coordinates */ - static SO Expmap(const TangentVector& omega, ChartJacobian H = boost::none) { - throw std::runtime_error("SO::Expmap only implemented for SO3 and SO4."); - } + static SO Expmap(const TangentVector& omega, ChartJacobian H = boost::none); + + /// Derivative of Expmap, currently only defined for SO3 + static MatrixDD ExpmapDerivative(const TangentVector& omega); /** * Log map at identity - returns the canonical coordinates of this rotation */ - static TangentVector Logmap(const SO& R, ChartJacobian H = boost::none) { - throw std::runtime_error("SO::Logmap only implemented for SO3 and SO4."); - } + static TangentVector Logmap(const SO& R, ChartJacobian H = boost::none); - // template > - static Matrix3 LogmapDerivative(const Vector3& omega); + /// Derivative of Logmap, currently only defined for SO3 + static MatrixDD LogmapDerivative(const TangentVector& omega); // inverse with optional derivative using LieGroup, internal::DimensionSO(N)>::inverse; @@ -288,4 +285,4 @@ struct traits> : public internal::LieGroup> {}; } // namespace gtsam -#include "SOn-inl.h" \ No newline at end of file +#include "SOn-inl.h"