OSVR-Core
Classes | Namespaces | Typedefs | Functions
EigenQuatExponentialMap.h File Reference

Header. More...

#include <osvr/Util/EigenCoreGeometry.h>

Go to the source code of this file.

Classes

struct  osvr::util::ei_quat_exp_map::FourthRootMachineEps< Scalar >
 
struct  osvr::util::ei_quat_exp_map::FourthRootMachineEps< double >
 
struct  osvr::util::ei_quat_exp_map::FourthRootMachineEps< float >
 
struct  osvr::util::ei_quat_exp_map::ScalarTrait< Derived >
 
class  osvr::util::ei_quat_exp_map::QuatExpMapBase< Derived_ >
 CRTP base for quaternion exponential map. More...
 
class  osvr::util::ei_quat_exp_map::VecWrapper< Scalar_ >
 
struct  osvr::util::ei_quat_exp_map::ScalarTrait< VecWrapper< Scalar_ > >
 
class  osvr::util::ei_quat_exp_map::VecWrapper< Scalar_ >
 
class  osvr::util::ei_quat_exp_map::QuatWrapper< Scalar_ >
 Wrapper class for a quaternion to provide access to ln() in its exponential-map meaning. More...
 
struct  osvr::util::ei_quat_exp_map::ScalarTrait< QuatWrapper< Scalar_ > >
 
class  osvr::util::ei_quat_exp_map::QuatWrapper< Scalar_ >
 Wrapper class for a quaternion to provide access to ln() in its exponential-map meaning. More...
 

Namespaces

 osvr
 The main namespace for all C++ elements of the framework, internal and external.
 
 osvr::util
 The Util library: Functionality not necessarily coupled to any particular core library, serving more as a common base layer behind all systems.
 

Typedefs

template<typename Derived >
using osvr::util::ei_quat_exp_map::ScalarType = typename ScalarTrait< Derived >::type
 
template<typename Derived >
using osvr::util::ei_quat_exp_map::QuatType = Eigen::Quaternion< ScalarType< Derived >>
 
template<typename Derived >
using osvr::util::ei_quat_exp_map::VecType = Eigen::Matrix< ScalarType< Derived >, 3, 1 >
 

Functions

template<typename Scalar >
Scalar osvr::util::ei_quat_exp_map::sinc (Scalar theta)
 Computes the "historical" (un-normalized) sinc(Theta) (sine(theta)/theta for theta != 0, defined as the limit value of 0 at theta = 0) More...
 
template<typename Derived >
Eigen::Quaternion< typename Derived::Scalar > osvr::util::ei_quat_exp_map::quat_exp (Eigen::MatrixBase< Derived > const &vec)
 fully-templated free function for quaternion expontiation More...
 
template<typename Scalar >
Scalar osvr::util::ei_quat_exp_map::cscTaylorExpansion (Scalar theta)
 Taylor series expansion of theta over sin(theta), aka cosecant, for use near 0 when you want continuity and validity at 0. More...
 
template<typename Scalar >
Eigen::Matrix< Scalar, 3, 1 > osvr::util::ei_quat_exp_map::quat_ln (Eigen::Quaternion< Scalar > const &quat)
 fully-templated free function for quaternion log map, intended for implementation use within the class. More...
 
template<typename Scalar >
QuatWrapper< Scalar > osvr::util::ei_quat_exp_map::quat_exp_map (Eigen::Quaternion< Scalar > const &q)
 
template<typename Scalar >
VecWrapper< Scalar > osvr::util::ei_quat_exp_map::quat_exp_map (Eigen::Matrix< Scalar, 3, 1 > const &v)
 

Detailed Description

Header.

Date
2016
Author
Sensics, Inc. http://sensics.com/osvr

Function Documentation

§ cscTaylorExpansion()

template<typename Scalar >
Scalar osvr::util::ei_quat_exp_map::cscTaylorExpansion ( Scalar  theta)
inline

Taylor series expansion of theta over sin(theta), aka cosecant, for use near 0 when you want continuity and validity at 0.

§ quat_exp()

template<typename Derived >
Eigen::Quaternion<typename Derived::Scalar> osvr::util::ei_quat_exp_map::quat_exp ( Eigen::MatrixBase< Derived > const &  vec)
inline

fully-templated free function for quaternion expontiation

Implementation inspired by Grassia, F. S. (1998). Practical Parameterization of Rotations Using the Exponential Map. Journal of Graphics Tools, 3(3), 29–48. http://doi.org/10.1080/10867651.1998.10487493

However, that work introduced a factor of 1/2 which I could not derive from the definition of quaternion exponentiation and whose absence thus distinguishes this implementation. Without that factor of 1/2, the exp and ln functions successfully round-trip and match other implementations.

§ quat_ln()

template<typename Scalar >
Eigen::Matrix<Scalar, 3, 1> osvr::util::ei_quat_exp_map::quat_ln ( Eigen::Quaternion< Scalar > const &  quat)
inline

fully-templated free function for quaternion log map, intended for implementation use within the class.

Assumes a unit quaternion.

Todo:
seems to be off by a factor of two in testing?

§ sinc()

template<typename Scalar >
Scalar osvr::util::ei_quat_exp_map::sinc ( Scalar  theta)
inline

Computes the "historical" (un-normalized) sinc(Theta) (sine(theta)/theta for theta != 0, defined as the limit value of 0 at theta = 0)

fourth root of machine epsilon is recommended cutoff for taylor series expansion vs. direct computation per Grassia, F. S. (1998). Practical Parameterization of Rotations Using the Exponential Map. Journal of Graphics Tools, 3(3), 29-48. http://doi.org/10.1080/10867651.1998.10487493