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

Extending the external API to allow for interaction with flight planning #2144

Closed
RCrockford opened this issue Apr 26, 2019 · 3 comments
Closed
Labels

Comments

@RCrockford
Copy link
Contributor

I would like to be able to read (and potentially modify) flight planning manoeuvre nodes from another mod (specifically kOS). This allows for instance the ability to plan a manoeuvre and then have it automatically executed by a flight computer.

I am proposing extending the external API to give access to functions such as (not an exhaustive list):
principia__FlightPlanExists
principia__FlightPlanGetManoeuvre
principia__FlightPlanGetGuidance
principia__FlightPlanGetInitialTime

@RCrockford
Copy link
Contributor Author

RCrockford commented Jun 25, 2019

Having thought this through more, the actual set of functions would be (this is an exhaustive list):

  • FlightPlanNumberOfManoeuvres(vessel) - the number of of manoeuvres in the vessel flight plan, or zero if none / no flight plan.
  • FlightPlanGetManoeuvreInitialTime(vessel, index) - initial time for indexed manoeuvre on vessel (in seconds).
  • FlightPlanGetManoeuvreDuration(vessel, index) - duration for indexed manoeuvre on vessel (in seconds).
  • FlightPlanGetManoeuvreGuidance(vessel, index) - guidance unit vector for indexed manoeuvre on vessel (in game world space).
  • FlightPlanGetManoeuvreDeltaV(vessel, index) - Required delta-V for indexed manoeuvre on vessel .

Specifying an invalid vessel or manoeuvre index would throw an exception.

These are all read only, as allowing write access to the flight planning is a rather more complicated task.

One obvious issue is that manoeuvres are indexed, and may change if the user alters the flight plan. I don't currently have a good solution for notifying any external mods of this occurring.

Sorry, something went wrong.

@pleroy
Copy link
Member

pleroy commented Jul 31, 2019

(Sorry for the late answer, been busy.)

All these APIs seem to make sense, and look stable enough that we could implement them no matter what we do with the flight plan in the future.

I might take a stab at implementing them for the next version (del Ferro).

Sorry, something went wrong.

@eggrobin eggrobin added the API label May 10, 2020
@eggrobin
Copy link
Member

They make sense, but it is not clear whether they are needed after all; quoth @RCrockford on discord:

I kinda dropped the kOS integration for principia as you can do basically everything using the stock manoeuvre node integration.

Closing this for now.

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

No branches or pull requests

3 participants