浏览代码

新增切换轴代码

lvjincheng 3 年之前
父节点
当前提交
0842a99386

+ 4 - 1
Assets/BowArrow/Scripts/Bluetooth/AimHandler.cs

@@ -37,8 +37,11 @@ public class AimHandler : MonoBehaviour
         ins = this;
         BluetoothDispatcher.aim = OnDataReceived;
 
-        m_axisHandler = new Axis9NopackHandler(this);
+        // m_axisHandler = new Axis9NopackHandler(this); //九轴旧
+        m_axisHandler = new Axis9Handler(this);  //九轴新
+        // m_axisHandler = new Axis663Handler(this); //双陀螺仪
         m_axisHandler.Init();
+
         //  StartCoroutine(TestRecord());
     }
 

+ 1 - 0
Assets/BowArrow/Scripts/Bluetooth/New/Axis663Handler.cs

@@ -25,6 +25,7 @@ public class Axis663Handler : AxisBaseHandler
 
     public override void Init()
     {
+        CommonConfig.devicePlan = 4;
         _663Axis = new o0.Bow.o0663Axis(GyrByteIndex, GyrByteIndex, AccByteIndex, AccByteIndex, MagByteIndex);
         _663Axis.Attitude = new o0.IMU._663AxisPreProcessor(GyrByteIndex, GyrByteIndex, AccByteIndex, AccByteIndex, MagByteIndex);
         _663Axis.LoadIdentity();

+ 1 - 0
Assets/BowArrow/Scripts/Bluetooth/New/Axis9Handler.cs

@@ -25,6 +25,7 @@ public class Axis9Handler : AxisBaseHandler
 
     public override void Init()
     {
+        CommonConfig.devicePlan = 3;
         _9Axis = new o0.Bow.o09AxisAfterXiaMenFromDll(GyrByteIndex, AccByteIndex, MagByteIndex);
         _9Axis.Attitude = new o0.IMU._9AxisPreProcessor(GyrByteIndex, AccByteIndex, MagByteIndex);
         _9Axis.LoadIdentity();

+ 1 - 0
Assets/BowArrow/Scripts/Bluetooth/New/Axis9NopackHandler.cs

@@ -14,6 +14,7 @@ public class Axis9NopackHandler : AxisBaseHandler
 
     public override void Init()
     {
+        CommonConfig.devicePlan = 3;
         _9Axis.LoadIdentity();
         InitGyr(null);
         InitMag(null);

+ 1 - 1
Assets/BowArrow/Scripts/CommonConfig.cs

@@ -22,7 +22,7 @@ public class CommonConfig
     public static bool isReleaseVersion = false;
 
     //设备方案
-    public static readonly int devicePlan = 3;
+    public static int devicePlan = 3;
 
     /**环数精度小数位 */
     public static readonly int ringsPrecision = 1;