base_agent/uas/route/waypoint.py

41 lines
1.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
航路点定义(兼容 ARINC 424 字段)
"""
from dataclasses import dataclass
from typing import Optional
@dataclass
class Waypoint:
"""航路点(兼容 ARINC 424 核心字段)"""
# ── 基本信息 ──
identifier: str = "" # 航路点标识符(如 "ZBAA", "WP001"
latitude: float = 0.0 # 纬度(度)
longitude: float = 0.0 # 经度(度)
altitude: float = 0.0 # 高度MSL
name: str = "" # 全称
# ── 速度约束 ──
speed: float = 0.0 # 过点速度m/s
speed_limit: Optional[float] = None # 速度限制m/s
# ── 高度约束 ──
alt_constraint: Optional[str] = None # "AT", "AT_OR_ABOVE", "AT_OR_BELOW"
alt_value: Optional[float] = None # 约束高度(米)
alt_descriptor: str = ""
# ── 转弯参数 ──
turn_radius: float = 0.0 # 过点转弯半径0=自动计算)
fly_over: bool = False # True=飞越点False=飞越前转弯Fly-by
# ── ARINC 424 字段 ──
path_terminator: str = "TF" # 路径终止符TF/CF/DF/IF/RF/AF等
course_angle: Optional[float] = None # 指定进场航道(度)
waypoint_type: str = "FIX" # FIX/AIRPORT/VOR/NDB/RUNWAY
def __str__(self) -> str:
return (f"WP[{self.identifier}] "
f"({self.latitude:.4f}°, {self.longitude:.4f}°, {self.altitude:.0f}m) "
f"Spd={self.speed:.1f}m/s PT={self.path_terminator}")