Fix Eigen error in 2D sphere manifolds

Since Eigen does not allow to have a RowMajor column vector (see
https://gitlab.com/libeigen/eigen/-/issues/416), the storage order
must be set to ColMajor in that case. This fix adds that special
case when generating 2D sphere manifolds.

Change-Id: I594932e0dafc878e0b348f72524478588e61b34d
This commit is contained in:
Julio L. Paneque
2022-08-05 11:25:29 +02:00
parent 1cf59f61eb
commit df55682ba5
+6 -1
View File
@@ -114,12 +114,17 @@ class SphereManifold final : public Manifold {
static constexpr int TangentSpaceDimension =
AmbientSpaceDimension > 0 ? AmbientSpaceDimension - 1 : Eigen::Dynamic;
// NOTE: Eigen does not allow to have a RowMajor column vector.
// In that case, change the storage order
static constexpr int SafeRowMajor =
TangentSpaceDimension == 1 ? Eigen::ColMajor : Eigen::RowMajor;
using AmbientVector = Eigen::Matrix<double, AmbientSpaceDimension, 1>;
using TangentVector = Eigen::Matrix<double, TangentSpaceDimension, 1>;
using MatrixPlusJacobian = Eigen::Matrix<double,
AmbientSpaceDimension,
TangentSpaceDimension,
Eigen::RowMajor>;
SafeRowMajor>;
using MatrixMinusJacobian = Eigen::Matrix<double,
TangentSpaceDimension,
AmbientSpaceDimension,