瀏覽代碼

重载默认x方向巡线

zx 2 年之前
父節點
當前提交
f6b55f703a
共有 2 個文件被更改,包括 14 次插入7 次删除
  1. 3 0
      ControllWidget.py
  2. 11 7
      RobotData.py

+ 3 - 0
ControllWidget.py

@@ -184,6 +184,9 @@ class ControlFrame(QFrame):
                     self.endStreetQc.setCurrentText(self.targetId_)
                     self.endSpaceQc.setCurrentText("------")
 
+        if self.robot_.IsMainModeStatu():
+            self.btnAutoDirect.setCheckState(Qt.Unchecked)
+
 
     def AutoCheck(self):
         if self.btnAuto.checkState()==Qt.Checked:

+ 11 - 7
RobotData.py

@@ -274,7 +274,7 @@ class Robot(MqttAsync):
             [type,nodes]=action
             if type=="input":
                 [street,space]=nodes
-                protoSpace=self.generateProtoNode(space,[0.02,0.02,0.5*math.pi/180.0])
+                protoSpace=self.generateProtoNode(space,[0.01,0.01,0.3*math.pi/180.0])
                 protoStreet=self.generateProtoNode(street,[0.02,0.02,1*math.pi/180.0])
                 act=message.NewAction()
                 act.type=1
@@ -309,12 +309,11 @@ class Robot(MqttAsync):
         if cmd is None:
             print("Nav cmd is None")
             return False
-        published=False
-        while self.IsNavigating() == False:
-            if not self.ActionType() == ActType.eReady:
-                published=True
-            if published==False:
-                self.publish(self.navCmdTopic_, jtf.MessageToJson(cmd))
+
+        count=3
+        while self.ActionType() == ActType.eReady and count>0:
+            self.publish(self.navCmdTopic_, jtf.MessageToJson(cmd))
+            count-=1
             time.sleep(1)
         print("send nav cmd completed!!!")
         return True
@@ -364,6 +363,11 @@ class Robot(MqttAsync):
                     else:
                         pose.theta=0
 
+                    if self.IsMainModeStatu() and count==0:
+                        accuracy.x=0.05
+                        accuracy.y=0.1
+                        accuracy.theta=0.5*math.pi/(180.0)
+
                     if count==size-1:
                         accuracy.x=0.02
                         accuracy.y=0.02