使用Eigen创建具有俯仰,偏航,滚转的旋转矩阵 [英] Creating a rotation matrix with pitch, yaw, roll using Eigen

查看:1789
本文介绍了使用Eigen创建具有俯仰,偏航,滚转的旋转矩阵的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用特征库创建一个使用俯仰,偏航和滚动的旋转矩阵?

How do I create a rotation matrix using pitch, yaw, roll with Eigen library?

推荐答案

没有找到一个预构建的函数,这样做,我建了一个,这里是为了有人今后发现这个问题

Seeing as how I couldn't find a prebuilt function that does this, I built one and here it is in case someone finds this question in the future

Eigen::AngleAxisd rollAngle(roll, Eigen::Vector3d::UnitZ());
Eigen::AngleAxisd yawAngle(yaw, Eigen::Vector3d::UnitY());
Eigen::AngleAxisd pitchAngle(pitch, Eigen::Vector3d::UnitX());

Eigen::Quaternion<double> q = rollAngle * yawAngle * pitchAngle;

Eigen::Matrix3d rotationMatrix = q.matrix();

这篇关于使用Eigen创建具有俯仰,偏航,滚转的旋转矩阵的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆