According to Eigen's doccumentation, passing fixed sized eigen objects can "be illegal or make your program crash." This is because the alignment modifiers Eigen uses are not respected when the objects are passed by value. You should change your function so that it takes a const reference instead.
Matrix3d quat2DCM(const Vector4d& quat)
{
…
}
即将Vector4d quat 改为 const Vector4d& quat
Matrix3d quat2DCM(const Vector4d& quat)
{
…
}
即将Vector4d quat 改为 const Vector4d& quat