1

对于无人机应用程序,我试图在标签框架参考中获取无人机位置,但忽略 X 和 Z 轴旋转。标签垂直定位,我想忽略 Z 和 X 轴的旋转

目标是获得与 Y 轴正交指向标签的无人机位置,无论其他轴的其他方向如何。

我是旋转矩阵的菜鸟,我真的开始了!

我使用的是 Java 和 April Tag V3,但在 AruCo Tags 中应该是一样的。

我正在尝试这种事情但没有成功

//Pose in Camera Frame (rotMatrix & trans are raw data form April Tag)
Vector3D vectorPosCamFrame = new Vector3D(trans[0][0], trans[0][1], Math.abs(trans[0][2])); //Z axis can to be only positive
Rotation rotationTag = new Rotation(rotMatrix, 1);
        
//Determining rotation whtout Y Axis rotation
Vector3D vectorPosCamEstimateYAxisTmp = new Vector3D(0, 1, 0);
Vector3D vectorPosCamEstimateYAxisTmpRotated = rotationTag.applyTo(vectorPosCamEstimateYAxisTmp);
Rotation rotationWithoutYAxis = new Rotation(vectorPosCamEstimateYAxisTmp, vectorPosCamEstimateYAxisTmpRotated);
        
//Apply rotation to current position to get position in TAG Frame
Vector3D vectorPosTagFrame = rotationTag.applyTo(vectorPosCamFrame);
vectorPosTagFrame = rotationWithoutYAxis.applyInverseTo(vectorPosCamFrame);

有没有人可以解释我做错了什么?

4

0 回答 0