From ec4c06ea8c2f189f9108a05d3e098fea2e107d17 Mon Sep 17 00:00:00 2001 From: Armor <2654988228@qq.com> Date: Thu, 15 Jan 2026 21:57:21 +0800 Subject: [PATCH] update --- src/KSP_tools/krpc_explore.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/KSP_tools/krpc_explore.py b/src/KSP_tools/krpc_explore.py index 465c63e..0d88b00 100644 --- a/src/KSP_tools/krpc_explore.py +++ b/src/KSP_tools/krpc_explore.py @@ -159,9 +159,6 @@ def auto_land_predictive( status = {'result': 'failed', 'logs': []} - # WAIT 阶段按折减推力估算刹车距离(提前点火,补偿点火/推力建立延迟) - - # 低空/接地参数(用于“最后几米慢下来”) touchdown_vspeed_tol = 0.6 # m/s:认为“软着陆”的竖直速度容差 low_altitude_pid_switch = 10.0 # m:低于该高度切换到竖直速度控制 @@ -244,13 +241,12 @@ def auto_land_predictive( print(msg) # 点火条件:进入刹车距离 or 推力未知(inf)但高度很低 - should_ignite = (remaining_alt <= braking_dist) or (braking_dist == float('inf') and remaining_alt < 200.0) + should_ignite = (remaining_alt <= braking_dist + v_speed) or (braking_dist == float('inf') and remaining_alt < 200.0) if should_ignite: break # 确保仍在滑行 - vessel.control.throttle = 0.0 - time.sleep(0.01) + time.sleep(0.05) # 燃烧闭环:根据 remaining_alt 反推需要的减速度 -> 油门 while True: @@ -324,12 +320,13 @@ def auto_land_predictive( f'srf_speed={srf_speed:.2f} vs={v_speed:.2f} ' f'v_down={v_down:.2f} vf_down={vf_down:.2f} ' f'a_req_up={a_req_up:.2f} throttle={throttle:.2f} ' - f'landed={int(is_landed)}' + f'landed={int(is_landed)} ' + f'current_thrust={vessel.thrust:.1f}kN' ) status['logs'].append(msg) print(msg) - time.sleep(0.01) + time.sleep(0.05) finally: try: @@ -348,6 +345,8 @@ def auto_land_predictive( return status if __name__ == "__main__": - xxx = auto_land_predictive(bottom_clearance_margin=20) + xxx = auto_land_predictive( + bottom_clearance_margin=30, + ) print(xxx) print('done') \ No newline at end of file