【问题标题】:how to obtain quaternion from transformation matrix 4 X 4 in point cloud library c++如何从点云库c ++中的变换矩阵4 X 4中获取四元数
【发布时间】:2021-12-21 02:19:02
【问题描述】:

我有一个从点云和旋转矩阵获得的 4 X 4 变换矩阵 我需要使用 Eigen::Quaternionf 将此转换矩阵转换为四元数 我该怎么办?

【问题讨论】:

  • 您只能将旋转矩阵而不是变换转换为四元数。当你构造四元数时,你可以直接传递你的旋转矩阵。
  • 那么如何获取从pcd文件中读取的某个点云的旋转矩阵
  • 为此,您最好向人们展示您的输入文件/数据和所需输出的最小可行示例。

标签: c++ computer-vision point-cloud-library point-clouds


【解决方案1】:

你可以从一个旋转矩阵创建一个Eigen::Quaternionf

// mat is a 4x4 transformation matrix
auto rot = mat.block<3,3>(0,0);
Quaternionf q(rot);

【讨论】:

  • 你能告诉我之后如何在屏幕上打印四元数的输出
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-01-15
  • 1970-01-01
相关资源
最近更新 更多