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

13 lines
404 B
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.
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)
v_surf = vessel.velocity(vessel.orbital_reference_frame)
print(f"地表相对速度:上升 {v_surf[0]:.2f} m/s北向 {v_surf[1]:.2f} m/s东向 {v_surf[2]:.2f} m/s")