Files
krpc-auto-landing/测试文件/采集当前坐标.py
2026-01-30 18:50:52 +08:00

15 lines
330 B
Python

import krpc
conn = krpc.connect(name='Hover Guidance V5')
if not conn.space_center:
print("No active vessel found.")
exit()
vessel = conn.space_center.active_vessel
flight = vessel.flight(vessel.surface_reference_frame)
lat = flight.latitude
lon = flight.longitude
print(f"当前位置:纬度 {lat},经度 {lon}")