From 46e35f169d5c821b364ac20b5d0bf6d8ccd3ee65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=96=B5?= Date: Wed, 17 Jun 2026 10:47:33 +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 --- drone_controller/router_proxy.py | 1 + run_mission.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drone_controller/router_proxy.py b/drone_controller/router_proxy.py index 3b81c34..2902370 100644 --- a/drone_controller/router_proxy.py +++ b/drone_controller/router_proxy.py @@ -169,6 +169,7 @@ class RouterProxy: msg = { "type": "SETPOINT", "id": msg_id, + "seq":self._seq, "timestamp_us": int(time.time() * 1_000_000), "setpoint": {"control_mode": control_mode, **kwargs} } diff --git a/run_mission.py b/run_mission.py index 42ba1fe..5f0e51e 100644 --- a/run_mission.py +++ b/run_mission.py @@ -71,7 +71,7 @@ class MissionOrchestrator: 4. 提供标准视频源接口(可替换) """ - def __init__(self, config_path="./config.json"): + def __init__(self,waypoints,config_path="./config.json"): self.logger = logging.getLogger("Orchestrator") self.logger.info("正在加载配置: %s", config_path) @@ -84,11 +84,7 @@ class MissionOrchestrator: self.detector = YOLO26UAVInfer(cfg["model"]) # ---- 航线定义(NED 坐标系,Z 向上为负) ---- - self.waypoints = [ - {'x': 1.0, 'y': 0.0, 'z': -1.5, 'yaw': 0}, - {'x': 1.0, 'y': 1.0, 'z': -1.5, 'yaw': 90}, - {'x': 0.0, 'y': 0.0, 'z': -1.2, 'yaw': 0}, - ] + self.waypoints = waypoints # ================================================================ # 🚁 MissionManager(状态机 + 航点巡航) @@ -417,7 +413,13 @@ def main(): # 允许命令行指定配置文件路径 config_file = sys.argv[1] if len(sys.argv) > 1 else "./config.json" - orchestrator = MissionOrchestrator(config_path=config_file) + waypoints = [ + {'x': 1.0, 'y': 0.0, 'z': -1.5, 'yaw': 0}, + {'x': 1.0, 'y': 1.0, 'z': -1.5, 'yaw': 90}, + {'x': 0.0, 'y': 0.0, 'z': -1.2, 'yaw': 0}, + ] + + orchestrator = MissionOrchestrator(config_path=config_file,waypoints=waypoints) orchestrator.start() orchestrator.run()