feat: 增加最後對準基地運行

feat: 增加原始模型參數和任務版本
This commit is contained in:
bmy
2024-07-15 23:25:40 +08:00
parent 6205fabf34
commit de8012a590
13 changed files with 3151 additions and 23 deletions

View File

@@ -34,15 +34,16 @@ def signal_handler(sig, frame):
offset = 0
signal.signal(signal.SIGTERM, signal_handler)
cmd_py_obj.send_speed_x(15)
while True:
time.sleep(0.2)
ret, box = filter.get(tlabel.LMARK)
if ret:
# 宽度大于 41 停车
print(f"width: {box[0][2] - box[0][0]} height: {box[0][3] - box[0][1]}")
time.sleep(0.02)
ret, box = filter.get(tlabel.BASE)
# if ret:
# error = (box[0][2] + box[0][0] - 320) / 2 + offset
# print(error)
# cmd_py_obj.send_speed_omega(-error * 0.8)
# 宽度大于 41 停车
# print(f"width: {box[0][2] - box[0][0]} height: {box[0][3] - box[0][1]}")
if ret:
error = (box[0][2] + box[0][0] - 320) / 2 + offset
print(error)
cmd_py_obj.send_speed_omega(-error * 0.8)
car_stop()