This commit is contained in:
havoc420ubuntu 2025-05-15 15:27:06 +00:00
parent a8574fc1db
commit ef08a40adb
2 changed files with 1 additions and 9 deletions

View File

@ -351,14 +351,8 @@ def move_to_hori_line(ctrl, msg, target_distance=0.5, observe=False, scan_qrcode
time.sleep(0.05) # 小间隔检查位置 time.sleep(0.05) # 小间隔检查位置
# 使用平滑停止方法
if forward:
current_vel = [move_speed, 0, 0]
else:
current_vel = [-move_speed, 0, 0]
# 使用平滑停止 # 使用平滑停止
ctrl.base_msg.stop_smooth(current_vel=current_vel) ctrl.base_msg.stop_force()
if observe: if observe:
print(f"移动完成,平稳停止,通过里程计计算的移动距离: {distance_moved:.3f}") print(f"移动完成,平稳停止,通过里程计计算的移动距离: {distance_moved:.3f}")

View File

@ -81,8 +81,6 @@ class ImageProcessor:
def decode_qrcode(self, img = None): def decode_qrcode(self, img = None):
if img is None: if img is None:
img = self.get_current_image() img = self.get_current_image()
if img is None:
return None
decoded_info = self.qreader.detect_and_decode(image=img) decoded_info = self.qreader.detect_and_decode(image=img)
if decoded_info and len(decoded_info) > 0: if decoded_info and len(decoded_info) > 0:
return decoded_info[0] return decoded_info[0]