فهرست منبع

getDeviationInfo

rambo 4 ماه پیش
والد
کامیت
ac3a156af2
1فایلهای تغییر یافته به همراه10 افزوده شده و 6 حذف شده
  1. 10 6
      python/mcu/DeviceControl.py

+ 10 - 6
python/mcu/DeviceControl.py

@@ -261,12 +261,16 @@ class DeviceControl(BaseClass, metaclass=SingletonType):
 
     async def getDeviationInfo(self):
         await asyncio.sleep(0.01)
-        # 发送获取偏移量
-        data = [self.command["get_deviation"], 1]
-        self.add_send_data_queue(data)
-        # if self.serial_ins:
-        #     self.serial_ins.write_cmd(data)
-        print("发送获取偏移量")
+        try:
+            # 发送获取偏移量
+            data = [self.command["get_deviation"], 1]
+            self.add_send_data_queue(data)
+            # if self.serial_ins:
+            #     self.serial_ins.write_cmd(data)
+            print("发送获取偏移量")
+        except Exception as e:
+            print(e)
+            print("getDeviationInfo", "暂未获取到self.command")
 
     def set_deviation(self, device_name, _type=0, deviation=0):
         # turntable----0 angle_ratio   1 turntable_steering_deviation