C++ Eigen:使用四元数设置Eigen::Isometry3d的旋转矩阵

C++ Eigen:使用四元数设置Eigen::Isometry3d的旋转矩阵,c++,matrix,eigen,C++,Matrix,Eigen,有人能帮我处理艾根吗? 我有一个四元数值(w,x,y,z)来设置Isometry3D变量的旋转矩阵。 为此,我尝试使用方法matrix()和toRotationMatrix(),但出现了错误: error: no match for ‘operator=’ (operand types are ‘const LinearMatrixType {aka const Eigen::Matrix<double, 3, 3>}’ and ‘Eigen::RotationBase<Eig

有人能帮我处理艾根吗? 我有一个四元数值(w,x,y,z)来设置Isometry3D变量的旋转矩阵。 为此,我尝试使用方法
matrix()
toRotationMatrix()
,但出现了错误:

error: no match for ‘operator=’ (operand types are ‘const LinearMatrixType {aka const Eigen::Matrix<double, 3, 3>}’ and ‘Eigen::RotationBase<Eigen::Quaternion<double>, 3>::RotationMatrixType {aka Eigen::Matrix<double, 3, 3>}’)
     transform.rotation() = quaternion.matrix();error: no match for ‘operator=’ (operand types are ‘const LinearMatrixType {aka const Eigen::Matrix<double, 3, 3>}’ and ‘Eigen::RotationBase<Eigen::Quaternion<double>, 3>::RotationMatrixType {aka Eigen::Matrix<double, 3, 3>}’)
     transform.rotation() = quaternion.matrix();
变量的完整声明如下:

Eigen::Isometry3d transform;
transform.translation() << 0.0, 0.0, 0.88446;
Eigen::Quaternion<double> quaternion(0.96593, 0.0, 0.25878, 0.0);
transform.rotation(quaternion.matrix()); 
Eigen::Isometry3d变换;

transform.translation()尝试
transform.rotate(quaternion.matrix())
谢谢您的帮助,解决了我的问题!
Eigen::Isometry3d transform;
transform.translation() << 0.0, 0.0, 0.88446;
Eigen::Quaternion<double> quaternion(0.96593, 0.0, 0.25878, 0.0);
transform.rotation(quaternion.matrix());