29typename SO<N>::MatrixNN
SO<N>::Hat(
const TangentVector& xi) {
35typename SO<N>::TangentVector
SO<N>::Vee(
const MatrixNN& X) {
41 if (H)
throw std::runtime_error(
"SO<N>::Retract jacobian not implemented.");
42 const Matrix X =
Hat(xi / 2.0);
43 size_t n = AmbientDim(xi.size());
44 const auto I = Eigen::MatrixXd::Identity(n, n);
52 if (H)
throw std::runtime_error(
"SO<N>::Local jacobian not implemented.");
53 const size_t n = R.rows();
54 const auto I = Eigen::MatrixXd::Identity(n, n);
55 const Matrix X = (I - R.matrix_) * (I + R.matrix_).inverse();
61 if (N==2)
return I_1x1;
62 throw std::runtime_error(
63 "SO<N>::AdjointMap only implemented for SO2, SO3 and SO4.");
68 throw std::runtime_error(
"SO<N>::Expmap only implemented for SO3 and SO4.");
73 throw std::runtime_error(
"SO<N>::ExpmapDerivative only implemented for SO3.");
78 throw std::runtime_error(
"SO<N>::Logmap only implemented for SO3.");
83 throw std::runtime_error(
"O<N>::LogmapDerivative only implemented for SO3.");
91 VectorN2 X = Eigen::Map<const VectorN2>(
matrix_.data());
99 for (
size_t i = 0; i < N; i++) {
100 H->block(i * N, 0, N, dimension) =
101 matrix_ * P.block(i * N, 0, N, dimension);
109 std::cout << s <<
matrix_ << std::endl;
typedef and functions to augment Eigen's MatrixXd
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
Manifold of special orthogonal rotation matrices SO<N>.
Definition: SOn.h:50
static SO Expmap(const TangentVector &omega, ChartJacobian H=boost::none)
Exponential map at identity - create a rotation from canonical coordinates.
Definition: SOn-inl.h:67
static Matrix VectorizedGenerators()
Calculate N^2 x dim matrix of vectorized Lie algebra generators for SO(N)
Definition: SOn.h:297
SO inverse() const
inverse of a rotation = transpose
Definition: SOn.h:190
VectorN2 vec(OptionalJacobian< internal::NSquaredSO(N), dimension > H=boost::none) const
Return vectorized rotation matrix in column order.
Definition: SOn-inl.h:88
static TangentVector Vee(const MatrixNN &X)
Inverse of Hat. See note about xi element order in Hat.
Definition: SOn-inl.h:35
MatrixNN matrix_
Rotation matrix.
Definition: SOn.h:60
static TangentVector Logmap(const SO &R, ChartJacobian H=boost::none)
Log map at identity - returns the canonical coordinates of this rotation.
Definition: SOn-inl.h:77
MatrixDD AdjointMap() const
Adjoint map.
Definition: SO4.cpp:159
static MatrixNN Hat(const TangentVector &xi)
Hat operator creates Lie algebra element corresponding to d-vector, where d is the dimensionality of ...
Definition: SOn-inl.h:29
static MatrixDD ExpmapDerivative(const TangentVector &omega)
Derivative of Expmap, currently only defined for SO3.
Definition: SOn-inl.h:72
static MatrixDD LogmapDerivative(const TangentVector &omega)
Derivative of Logmap, currently only defined for SO3.
Definition: SOn-inl.h:82
SO()
Construct SO<N> identity for N >= 2.
Definition: SOn.h:77
static TangentVector Local(const SO &R, ChartJacobian H=boost::none)
Inverse of Retract.
Definition: SOn-inl.h:50
static SO Retract(const TangentVector &xi, ChartJacobian H=boost::none)
Retract uses Cayley map.
Definition: SOn-inl.h:40