我正在使用MISB KLV Local Dataset中的数据和NASA Worldwind中提供的Matrix操作。 MISB数据提供了偏航,俯仰和横滚的平台方向以及偏航,俯仰和横滚平台相对于平台的传感器方位。我试图根据平台方向和传感器相对方向来计算传感器相对于北方的绝对方位(偏航,俯仰,滚动)。绝对传感器方向
我目前正在计算平台旋转矩阵和传感器相对旋转矩阵并将结果相乘。由此产生的旋转矩阵似乎不正确。根据第6.2.4节中的MISB文件,欧拉角操作顺序是偏航,俯仰,然后滚动。结合旋转矩阵以获得绝对旋转的正确方法是什么?
//use transpose for clockwise rotation
Matrix mpYaw = Matrix.fromRotationZ(pYaw).getTranspose();
Matrix mpPitch = Matrix.fromRotationY(pPitch).getTranspose();
Matrix mpRoll = Matrix.fromRotationX(pRoll).getTranspose();
Matrix msYaw = Matrix.fromRotationZ(sYaw).getTranspose();
Matrix msPitch = Matrix.fromRotationY(sPitch).getTranspose();
Matrix msRoll = Matrix.fromRotationX(sRoll).getTranspose();
Matrix mpRot = mpYaw.multiply(mpPitch).multiply(mpRoll); //platform
Matrix msRot = msYaw.multiply(msPitch).multiply(msRoll); //sensor
Matrix maRot = mpRot.multiply(msRot); //absolute
样品MISB数据:
Platform Heading Angle:175.66308079652094
Platform Pitch Angle:3.4296700949125647
Platform Roll Angle:-0.3982665486617634
Sensor Rel. Az. Angle:326.08593764856596
Sensor Rel. El. Angle:-21.60937493741949
Sensor Rel. Roll Angle:0.0
Sensor Latitude:33.03482410173622
Sensor Longitude:-114.45451377632772
Sensor True Altitude:1022.4368657969026
Frame Center Lat.:33.01531312661958
Frame Center Lon.:-114.4367867216639
Frame Center El.:79.58953231097883
Slant Range:2883.640118614687
编辑1:
通过@anjruu应用建议的修复后,它看起来像结果接近,但还是稍微偏离。我通过将旋转矩阵的正向矢量乘以MISB提供的目标距离来计算局部NED坐标到目标位置。然后,我计算了MISB提供的目标位置的本地NED坐标(使用ViewUtil),其中原点设置为提供的平台位置,结果稍微偏离。
Matrix mpYaw = Matrix.fromRotationZ(pYaw).getTranspose();
Matrix mpPitch = Matrix.fromRotationY(pPitch).getTranspose();
Matrix mpRoll = Matrix.fromRotationX(pRoll).getTranspose();
Matrix msYaw = Matrix.fromRotationZ(sYaw).getTranspose();
Matrix msPitch = Matrix.fromRotationY(sPitch).getTranspose();
Matrix msRoll = Matrix.fromRotationX(sRoll).getTranspose();
Matrix mpRot = mpRoll.multiply(mpPitch).multiply(mpYaw); //platform
Matrix msRot = msRoll.multiply(msPitch).multiply(msYaw); //sensor
Matrix maRot = msRot.multiply(mpRot); //absolute
Globe globe = new Earth();
Position pPlatform = Position.fromDegrees(33.03482410173622, -114.45451377632772, 1022.4368657969026);
Position pTarget = Position.fromDegrees(33.01531312661958, -114.4367867216639, 79.58953231097883);
double targetRange = 2883.640118614687;
Vec4 vTarNED = new Vec4(1,0,0).transformBy3(maRot.getTranspose()).multiply3(targetRange);
//NED = (-2165.935747907422, 1656.9597179630864, 937.3298046411029, 1.0)
Matrix localENU = ViewUtil.computePositionTransform(globe, pPlatform);
Vec4 vTarENU = globe.computePointFromPosition(pTarget).transformBy4(localENU);
//ENU = (1656.3846316600684, -2163.7501770820236, -943.4305881811306, 1.0)
//NED = (-2163.7501770820236, 1656.3846316600684, 943.4305881811306, 1.0)
你能包括Matrix类,或者至少为规范'multiply'?我猜想'Matrix :: multiply'是一个右乘,并且相机姿势与平台姿势有关,这意味着它应该是'msRot。乘法(mpRot)',并且您应该颠倒乘法链来获得'mpRot'和'msRot',但是我不知道'multiply'实际上做了什么。 – anjruu 2014-09-23 15:35:40
@anjruu美国宇航局WorldWind链接中的帖子链接到Matrix类。 – user66332 2014-09-23 15:38:10
所以确实如此,对不起。是的,'A.multiply(B)'是'A * B'(这是理智的),所以我认为它应该是'Matrix mpRot = mpRoll.multiply(mpPitch).multiply(mpYaw);' msRot'和'maRot'。 – anjruu 2014-09-23 15:40:58