2026.6.17小更新修改json内容错误

This commit is contained in:
2026-06-17 10:47:33 +08:00
parent cdb9815ec8
commit 46e35f169d
2 changed files with 10 additions and 7 deletions
+1
View File
@@ -169,6 +169,7 @@ class RouterProxy:
msg = { msg = {
"type": "SETPOINT", "type": "SETPOINT",
"id": msg_id, "id": msg_id,
"seq":self._seq,
"timestamp_us": int(time.time() * 1_000_000), "timestamp_us": int(time.time() * 1_000_000),
"setpoint": {"control_mode": control_mode, **kwargs} "setpoint": {"control_mode": control_mode, **kwargs}
} }
+9 -7
View File
@@ -71,7 +71,7 @@ class MissionOrchestrator:
4. 提供标准视频源接口(可替换) 4. 提供标准视频源接口(可替换)
""" """
def __init__(self, config_path="./config.json"): def __init__(self,waypoints,config_path="./config.json"):
self.logger = logging.getLogger("Orchestrator") self.logger = logging.getLogger("Orchestrator")
self.logger.info("正在加载配置: %s", config_path) self.logger.info("正在加载配置: %s", config_path)
@@ -84,11 +84,7 @@ class MissionOrchestrator:
self.detector = YOLO26UAVInfer(cfg["model"]) self.detector = YOLO26UAVInfer(cfg["model"])
# ---- 航线定义(NED 坐标系,Z 向上为负) ---- # ---- 航线定义(NED 坐标系,Z 向上为负) ----
self.waypoints = [ self.waypoints = 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},
]
# ================================================================ # ================================================================
# 🚁 MissionManager(状态机 + 航点巡航) # 🚁 MissionManager(状态机 + 航点巡航)
@@ -417,7 +413,13 @@ def main():
# 允许命令行指定配置文件路径 # 允许命令行指定配置文件路径
config_file = sys.argv[1] if len(sys.argv) > 1 else "./config.json" 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.start()
orchestrator.run() orchestrator.run()