Browse Source

Debug调整

lvjincheng 3 years ago
parent
commit
faefbb4ae0

+ 5 - 0
Assets/BowArrow/Scripts/Bluetooth/New/AttitudeJson.cs

@@ -35,6 +35,11 @@ public class AttitudeJson : JCUnityLib.CustomJson
         InitJsonClass<ByteToShorts>(() => new ByteToShorts(3),
             "ByteToShort"
         );
+        InitJsonClass<ByteToShort>(() => new ByteToShort(null),
+            "MinCount",
+            "Reverse",
+            "Short"
+        );
         InitJsonClass<MeanMaintainer<Vector<double>>>(() => new MeanMaintainer<Vector<double>>(),
             "Count",
             "Mean"

+ 12 - 2
Assets/BowArrow/Scripts/Bluetooth/New/o09AxisAfterXiaMenFromDll.cs

@@ -141,10 +141,11 @@ namespace o0.Bow
             // TestVector.SetAcc(state.AccSmooth.ToUnityVector(), 1);
             // TestVector.SetMag(state.MagSmooth.ToUnityVector(), 1);
         }
+        public static double vari = 0.001;
         public double CalGyrVariance(State Last, State state)
         {
             //return Last.Variance + (state.Gyr * state.TimeGap).Length * 0.3 + 0.001;
-            return Last.Variance + (state.Gyr * state.TimeGap).Length * 0.3 + 0.001 * state.TimeGap;//0.00000002331017
+            return Last.Variance + (state.Gyr * state.TimeGap).Length * 0.3 + vari * state.TimeGap;//0.00000002331017
         }
         public double CalAccVariance(State Last, State state)
         {
@@ -184,7 +185,7 @@ namespace o0.Bow
                 || double.IsNaN(quaternion.x) || double.IsNaN(quaternion.y) || double.IsNaN(quaternion.z) || double.IsNaN(quaternion.w))
                 quaternion = backUp;
         }
-
+        // public static string debugInfo = "";
         public Geometry.Quaternion Process9Axis(State Last, State state)
         {
             MagSmooth(Last, state);
@@ -198,6 +199,15 @@ namespace o0.Bow
             o0UIRawImageTester.UpdateAllOffset();
 
             //Debug.Log(Gyr.Length);
+            // debugInfo = $"Acc:{Acc}\n";
+            // debugInfo += $"AccLen:{Acc.Length}\n";
+            // debugInfo += $"Gyr:{Gyr}\n";
+            // debugInfo += $"GyrLen:{Gyr.Length}\n";
+            // debugInfo += $"Mag:{Mag}\n";
+            // debugInfo += $"MagLen:{Mag.Length}\n";
+            // debugInfo += $"TimeGap:{TimeGap}\n";
+            // debugInfo += $"GyrMeanLen:{Attitude.GyrCalibrater.Mean.Length}\n";
+            // debugInfo += $"MagVariance:{Attitude.MagCalibrater.Variance}\n";
 
             var LastQuaternion = Last.QuaSmooth;
 

BIN
Assets/BowArrow/Scripts/Bluetooth/o0Lib/o0NetIMU.dll


BIN
Assets/BowArrow/Scripts/Bluetooth/o0Lib/o0NetLib.dll


+ 1 - 1
Assets/BowArrow/Scripts/Network/SocketComp/UserComp.cs

@@ -37,7 +37,7 @@ public class UserComp : JCUnityLib.Singleton<UserComp>
         }
         int type = AimHandler.ins.DeviceType;
         if (type > 0) {
-            UserPlayer.ins.call("userComp.saveCalibrateRecord", type, record, mac);
+            UserPlayer.ins.call("userComp.saveCalibrateRecord2", type, record, mac);
         }
     }
 

+ 3 - 2
Assets/BowArrow/Scripts/View/SideTipView.cs

@@ -46,7 +46,8 @@ public class SideTipView : ViewBase
 
     public static void ShowTip(string text, Color color)
     {
-        if (!ins) Instantiate(Resources.Load("Prefabs/Views/SideTipView"));
-        ins?._ShowTip(text, color);
+        Debug.Log(text);
+        // if (!ins) Instantiate(Resources.Load("Prefabs/Views/SideTipView"));
+        // ins?._ShowTip(text, color);
     }
 }