Esempio n. 1
0
 public void TestCalcOffset()
 {
     ArmHandler_Accessor target = new ArmHandler_Accessor(12345); // TODO: 初始化为适当的值
     ArmHandler jh = new ArmHandler(12345);
     string baseString = "roll:-74.60|pitch:8.41|yaw:-169.16|roll2:33.45|pitch2:36.33|yaw2:-104.82";
     string testString = "roll:-75.60|pitch:6.41|yaw:169.16|roll2:-33.45|pitch2:37.33|yaw2:-102.82";
     target._baseData = target.ResolveCoordinates(baseString);
     target._latestData = target.ResolveCoordinates(testString);
     target.CalcOffset();
     Assert.AreEqual( -1,target._offsetData[0]);
     Assert.AreEqual(-2, target._offsetData[1]);
     Assert.AreEqual(338.32, target._offsetData[2]);
     Assert.AreEqual(-66.9, target._offsetData[3]);
     Assert.AreEqual(1, target._offsetData[4]);
     Assert.AreEqual(2, target._offsetData[5]);
 }