From 53f347ec93f6d7fe193acf9decac63b4559132d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=96=B5?= Date: Wed, 17 Jun 2026 11:24:18 +0800 Subject: [PATCH] =?UTF-8?q?2026.6.17=E5=B0=8F=E6=9B=B4=E6=96=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9json=E5=86=85=E5=AE=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- infer_camera_modular.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/infer_camera_modular.py b/infer_camera_modular.py index 6b0aaad..2aa1eb9 100644 --- a/infer_camera_modular.py +++ b/infer_camera_modular.py @@ -9,6 +9,8 @@ import json import sys import logging +from mpmath.math2 import NAN + # ================== 昇腾 NPU SDK(保护性导入) ===================== # 开发机可能无昇腾环境,try-except 确保 import 错误仅告警不崩溃。 # 部署到香橙派 AI Pro 时只需安装 ais_bench 即可无缝运行。 @@ -391,8 +393,14 @@ class UAVControlLoop: if alt_rel < takeoff_alt * 0.9: self.logger.info("高度 %.1fm < 目标 %.1fm,执行起飞...", alt_rel, takeoff_alt) ok, ack = self.proxy.send_waypoint( - action="TAKEOFF", alt=takeoff_alt, - alt_frame="RELATIVE", speed=3.0 + lat = state["home"]["lat"], + lon = state["home"]["lon"], + alt = state["home"]["alt_msl"], + alt_frame="RELATIVE", + speed=3.0,action="TAKEOFF", + hover_time=5.0,yaw=NAN, + acceptance_radius=0.5, + is_last=False ) if not ok: self.logger.warning("TAKEOFF 指令 ACK 失败: %s,尝试通过 SETPOINT 爬升...", ack) @@ -532,7 +540,7 @@ class UAVControlLoop: self.pid_z.reset_integral() with self.data_lock: self._brake_requested = True - self.logger.info("目标丢失,请求刹车") + # self.logger.info("目标丢失,请求刹车") with self.data_lock: self.detections = detections