untoldwind / KontrolSystem2

Autopilot scripting system for KSP2
Other
54 stars 15 forks source link

Can we retrieve all currently predicted orbit patches? #110

Closed ColJay closed 6 months ago

ColJay commented 8 months ago

Looking to validate some return flight path predictions, so i'm trying to retrieve the orbit patch post SOI change. EG - parking orbit around the Mun - add manuever node for a hyperbolic exit of the Mun soi back into Kerbin. The game shows the expected orbit around Kerbin - i'm trying to get those details directly.

I think the original KOS allowed orbit:next_patch on any orbit object. I was wondering if there's anything similar? I've tried the manuecver, expected_orbit and orbit_patch - but these only deal with the current orbit pre and post manuever node.

Thanks!

untoldwind commented 8 months ago

The internal handling of maneuver nodes has changed quite a bit from KSP1. Additionally it looks like that there are some preparations for true n-body orbit types ... most likely for the future, but maybe one day it would be possible to park a telescope at the L2 Lagrange point of the Mun ... In lack of a better technical term this makes the API a bit wonky.

After some experiments I came up with the following changes:

You can try this out with this pre-release: https://github.com/untoldwind/KontrolSystem2/releases/tag/v0.5.1.3 (probably needs a bit more testing)

appenz commented 8 months ago

Awesome, and makes transfers between celestial bodies vastly easier.

untoldwind commented 8 months ago

This is now part of the 0.5.2 release. I also tweaked the vessel.maneuver.add and vessel.maneuver.add_burn_vector methods to support multiple maneuver nodes, i.e. the second node should now be on the orbit created by the first and so one (hopefully)

ColJay commented 8 months ago

Amazing work dude. Very impressed with the speed you can turn things around. Will crunch some numbers and give it a whirl - thanks again!!

github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 60 days with no activity.

github-actions[bot] commented 6 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.