Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could there be a way to read "Closest Approach"? #275

Open
Dunbaratu opened this issue Nov 23, 2013 · 4 comments
Open

Could there be a way to read "Closest Approach"? #275

Dunbaratu opened this issue Nov 23, 2013 · 4 comments

Comments

@Dunbaratu
Copy link
Contributor

file:http://imageshack.com/a/img51/5956/x5uk.jpg

(Not my image - taken from a google search)

I don't think there's currently any way to obtain that "closest approach" information in a kos script. This sort of makes encounters rather boolean. Either you're close enough to have KSP call it an 'encounter', or you're not. If you're not, the script can't tell the difference between an 'almost' encounter of say 1 million km, versus a "not even close" pass of 40 million km.

Being able to obtain that information would really help speed up algorithms to iteratively search for an encounter, as it would allow you to perform "geting warmer / getting colder" search techniques.

@adammada
Copy link

I wrote plugin which did that (now abandoned) - and KSP don't have simple internal function to do it. So it have to be code from other plugin, like Protractor (is on GPL3), but i see that currently soruce is missing.

http://forum.kerbalspaceprogram.com/threads/21544-22-Protractor-Rendezvous-Plugin-v-2-4-3

But i think that much better would be some function to get Planet position at certain time and your position at certain time. Those are simple functions in KSP, just need mapping.

That way you can build your own code to find closest approach, and also do other stuff.

@baloan
Copy link

baloan commented Nov 23, 2013

"Either you're close enough". I reckon KSP calls it an encounter when you enter the bodies SOI.
Btw, I am working on a method/script to calculate Hohmann tranfers - at least in 2D, and yes, it should be possible to calculate orbital angles as a function of time. I don't know yet how accurate it will be. I will want to choose a trajectory which comes closer than the SOI to make it work.
Full 3D will only be possible when there is access to the ships and bodies' ephemeris data in the script. I am wondering how this is handled in KSP as every time a ship comes closer to 100km of a body the frame of reference is changing.

@Dunbaratu
Copy link
Contributor Author

The problem with Hohmann transfers is that they presume you start from a circular orbit and are going to meet a body that is on a circular orbit. They don't work for the general case where your target body can be a planet in an eccentric ellipse.

@MaHuJa
Copy link

MaHuJa commented Dec 18, 2013

Another reason for this is when you're trying to approach a different vessel in orbit around the same body as you are. There won't even be an "encounter" in that case.

The simplest method would probably be that you select your target, and ask for closest approach, where it goes along all the conics (as it does when finding what you're encountering) and running some code (e.g. ripped from mechjeb) that tells you about your closest encounter, returning the result to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants