update 初次融合+调试

This commit is contained in:
FrankCV2048
2024-09-03 23:28:16 +08:00
parent 051de571a8
commit 0af995b9cd
10 changed files with 108 additions and 69 deletions

View File

@ -1,4 +1,4 @@
from Constant import position_accuracy
class Position:
def __init__(self):
self.X = 0.0

View File

@ -5,7 +5,7 @@ class DATARequest:
self.queryAddr = []
def toString(self):
model_str = '{'+f'"dsID":"{self.dsID}","reqType":"{self.reqType}","queryAddr":[' \
f'"{self.queryAddr[0].toString()}"]'+'}'
f'{self.queryAddr[0].toString()}]'+'}'
return model_str
@ -22,7 +22,12 @@ class DataAddress:
self.output_n = ''
self.axisNum = '6'
self.axis_n = ''
self.world_n = ''
self.world_0 = 0
self.world_1 = 0
self.world_2 = 0
self.world_3 = 0
self.world_4 = 0
self.world_5 = 0
self.curAlarm = ''
self.curCycle = ''
self.lastCycle = ''
@ -35,9 +40,17 @@ class DataAddress:
self.isMoving = ''
self.M_n = ''
#return
def setPosition(self,w0,w1,w2,w3,w4,w5):
self.world_0 = int(w0)
self.world_1 = int(w1)
self.world_2 = int(w2)
self.world_3 = int(w3)
self.world_4 = int(w4)
self.world_5 = int(w5)
def toString(self):
model_str = f'"world_n"'
model_str = f'"world_0","world_1","world_2","world_3","world_4","world_5"'
return model_str
@ -48,8 +61,8 @@ class DATAReply:
def __init__(self):
self.dsID = ''
self.reqType = ''
self.queryData = DataAddress()
return
self.queryData = []
def JsonToObject(self):
@ -72,7 +85,7 @@ class CMDReply:
class Instruction:
def __init__(self):
self.oneshot = 1
self.action = 4 #4 自由路径 10 姿势直线 17 姿势曲线
self.action = 10 #4 自由路径 10 姿势直线 17 姿势曲线
self.m0 = 0.0
self.m1 = 0.0
self.m2 = 0.0
@ -80,13 +93,14 @@ class Instruction:
self.m4 = 0.0
self.m5 = 0.0
self.ckStatus = '0x3F'
self.speed =10
self.speed = 10
self.delay = 1.0
self.smooth = 0
def toString(self):
model_str = f'"oneshot":"{self.oneshot}","action":"{self.action}","m0":"{self.m0}","m1":"{self.m1}","m2":"{self.m2}",' \
f'"m3":"{self.m3}","m4":"{self.m4}","m5":"{self.m5}"'
f'"m3":"{self.m3}","m4":"{self.m4}","m5":"{self.m5}","ckStatus":"{self.ckStatus}","speed":"{self.speed}",' \
f'"delay":"{self.delay}","smooth":"{self.smooth}"'
return model_str