How to use Fusion library function to get pitch and roll

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to use Fusion library function to get pitch and roll

跳至解决方案
1,982 次查看
a8Chcx
Contributor V

Hi,

 

I am trying to use fusion library based K64F and Multi2-B to calculate the pitch and roll based on the reference of 0 YAW to see if the real measurement pitch and roll are accurate enough?

ex. I have pitch=30 degrees, roll=50 degrees @YAW=0, then, I want to calculate pitch & roll @ yaw=75 degrees. Is it possible to call any function in library to get these angles?

 

Thanks,

 

Christie

标签 (1)
0 项奖励
回复
1 解答
1,501 次查看
markpedley
NXP Employee
NXP Employee

Assuming the Aerospace coordinate system, the sequence of Euler angle rotations is:

First, the yaw rotation which is about the vertical z axis

Second, the pitch rotation iabout the y axis

Third, the roll rotation about x axis.

I think you're referring to performing a fourth rotation about the z axis. The z axis was the yaw axis at the start of the rotation sequence but it's no longer the yaw axis as a result of the roll and pitch rotations.

To perform a fourth rotation about the z axis by angle psi, pre-multiply your orientation matrix R by the z axis rotation matrix Rz)psi) (equation 3 in AN5017) to obtain a new orientation matrix Rz.R:

Rz(psi)={cos(psi), sin(psi), 0}

{-sin(psi), cos(psi), 0}

{0, 0, 0}

From the new rotation matrix Rz.R you can extract the new Euler angles with a call to: fNEDAnglesDegFromRotationMatrix

Mark

在原帖中查看解决方案

0 项奖励
回复
6 回复数
1,501 次查看
a8Chcx
Contributor V

Hi Mark,

Thanks.

Christie

0 项奖励
回复
1,501 次查看
markpedley
NXP Employee
NXP Employee

There's a small typo in my reply: the z axis rotation matrix obviously has a 1 and not a 0 in the [z][z] position.

The correct matrix is:

Rz(psi)={cos(psi), sin(psi), 0}

{-sin(psi), cos(psi), 0}

{0, 0, 1}

0 项奖励
回复
1,501 次查看
markpedley
NXP Employee
NXP Employee

The yaw rotation occurs first in all three coordinate systems that are supported in the software. Changing the yaw angle therefore has no effect on roll and pitch angles. Any initial yaw rotation has no effect on the accelerometer measurement since all accelerometers are insensitive to rotation about the vertical axis.

0 项奖励
回复
1,501 次查看
a8Chcx
Contributor V

Hi Mark,

It should be changed on pitch & roll on tilted surface when I turn YAW only?

Ex. You have pitch=30 roll=50 and turn YAW 180 degrees on tilted surface, after turn, pitch will be -30 degree, roll will change as well, right?

Can I use any function in fusion library to get pitch & roll?

Thanks,

Christie

0 项奖励
回复
1,502 次查看
markpedley
NXP Employee
NXP Employee

Assuming the Aerospace coordinate system, the sequence of Euler angle rotations is:

First, the yaw rotation which is about the vertical z axis

Second, the pitch rotation iabout the y axis

Third, the roll rotation about x axis.

I think you're referring to performing a fourth rotation about the z axis. The z axis was the yaw axis at the start of the rotation sequence but it's no longer the yaw axis as a result of the roll and pitch rotations.

To perform a fourth rotation about the z axis by angle psi, pre-multiply your orientation matrix R by the z axis rotation matrix Rz)psi) (equation 3 in AN5017) to obtain a new orientation matrix Rz.R:

Rz(psi)={cos(psi), sin(psi), 0}

{-sin(psi), cos(psi), 0}

{0, 0, 0}

From the new rotation matrix Rz.R you can extract the new Euler angles with a call to: fNEDAnglesDegFromRotationMatrix

Mark

0 项奖励
回复
1,501 次查看
a8Chcx
Contributor V

Thanks, Mark.

0 项奖励
回复