@@ -39,7 +39,11 @@ namespace eigenpy
3939 template <>
4040 struct UnalignedEquivalent <Eigen::Quaterniond>
4141 {
42- typedef Eigen::Quaternion<double ,Eigen::DontAlign> type;
42+ #ifndef EIGENPY_ALIGNED
43+ typedef Eigen::Quaternion<Eigen::Quaterniond::Scalar,Eigen::DontAlign> type;
44+ #else
45+ typedef Eigen::Quaterniond type;
46+ #endif
4347 };
4448
4549 namespace bp = boost::python;
@@ -51,10 +55,15 @@ namespace eigenpy
5155 typedef Eigen::QuaternionBase<Quaternion> QuaternionBase;
5256 typedef typename eigenpy::UnalignedEquivalent<Quaternion>::type QuaternionUnaligned;
5357
54- typedef typename QuaternionUnaligned::Scalar Scalar;
55- typedef Eigen::Matrix<Scalar,3 ,1 ,Eigen::DontAlign> Vector3;
58+ typedef typename QuaternionBase::Scalar Scalar;
5659 typedef typename QuaternionUnaligned::Coefficients Coefficients;
60+ #ifndef EIGENPY_ALIGNED
61+ typedef Eigen::Matrix<Scalar,3 ,1 ,Eigen::DontAlign> Vector3;
5762 typedef Eigen::Matrix<Scalar,3 ,3 ,Eigen::DontAlign> Matrix3;
63+ #else
64+ typedef Eigen::Matrix<Scalar,3 ,1 ,0 > Vector3;
65+ typedef Eigen::Matrix<Scalar,3 ,3 ,0 > Matrix3;
66+ #endif
5867
5968 typedef Eigen::AngleAxis<Scalar> AngleAxisUnaligned;
6069
@@ -169,8 +178,10 @@ namespace eigenpy
169178 bp::init<>())
170179 .def (QuaternionVisitor<Quaternion>())
171180 ;
172-
181+
182+ #ifndef EIGENPY_ALIGNED
173183 bp::to_python_converter< Quaternion,QuaternionVisitor<Quaternion> >();
184+ #endif
174185 }
175186
176187 };
0 commit comments