旋转向量到旋转矩阵
double alpha = M_PI / 3;
AngleAxisd rotation_vector(alpha, Vector3d(1, 0, 0));
MatrixXd rotation_matrix;
rotation_matrix = rotation_vector.matrix();
cout << rotation_matrix << endl;
旋转向量到欧拉角
Vector3d eulerAngle = rotation_vector.matrix().eulerAngles(2, 1, 0);
cout << eulerAngle << endl;
旋转向量到四元数
Quaterniond quaternion(rotation_vector);
cout << quaternion.coeffs() << endl;
cout << quaternion.x() << endl;
cout << quaternion.y() << endl;
cout << quaternion.z() << endl;
cout << quaternion.w() << endl;
Quaterniond quaternion2;
quaternion2 = rotation_vector;
cout << quaternion2.coeffs() << endl;
Quaterniond quaternion(w, x, y, z);