Jump to content

Astrodynamics Support System for kOS


woodywood245

Recommended Posts

Coming soon!

From Kerbal Integrated Circuit Kompany comes the Astrodynamics Support System. The Astrodynamics Support System provides new functions for kOS, including allowing developers to create and remove maneuver nodes programatically. Included are several new kOS parts, including a radial version.

So far, I've written the code that lets kOS scripts create and remove maneuver nodes, and calculate delta-v vectors based on prograde/normal/radial values of delta-v. This would be the equivalent of adding them manually in the map or in MechJeb.

I'm going to add Saturn V Instrument Unit-style ring parts in all the appropriate sizes and at least one radial part, each including at least one kOS computer (sometimes I use two), and possibly an accelerometer, gravimeter, barometer, and thermometer. If I include the sensors, my Sensor Reporter will be included in this project.

If there is anything else that you think you might want that cannot be done directly with kOS, please let me know, and I'll be happy to look into it.

Official first release features:

- Compatibility with kOS 0.7

- Create and remove maneuver nodes.

- Target celestial bodies (planets, moons, the Sun).

- Get phase angles on celestial targets.

- Four parts (1.25m, 2.5m, 3.75m, and 5m), each containing one of each sensor and a kOS computer.

Edited by woodywood245
Added official features list
Link to comment
Share on other sites

I will definitely try to add code that will allow you to target bodies. That shouldn't be too difficult.

Interplanetary transfers is a different story. I'm not quite sure about the math for doing that, so that may have to be in a future release, but I will definitely keep it in mind.

Link to comment
Share on other sites

There's a certain point at which if too many features are added to KOS it becomes just mechjeb. Right now there is a VERY important difference between mechjeb and KOS, and that is that KOS makes you write your own autopilot rather than giving you a working one out of the box that someone else wrote for you.

I like getting information on the positions of planets so I can calculate intelligently when to perform transfer burns. I'm not so sure I like just being handed the transfer burn predeclared on a silver platter though. Giving us more access to the game's data than KOS gives is good, but making decisions for us sort of takes away the point of using KOS over using mechjeb.

Link to comment
Share on other sites

Personally I would like to use kOS in a way like autom8. Right now I've written all my own scripts for launch, landing and such. Now I just need a transfer capability so I can do a fully automated launch to land on Duna Curiosity rover mission.

Link to comment
Share on other sites

I definitely don't want to go too far towards the MechJeb path, and I'm looking more towards being able to expose game data and do certain things that kOS simply cannot do that can be done manually (like creating maneuver nodes). However, if you know enough of the math, or you borrow someone else's scripts, it will be possible to automate your entire system like Autom8, the only problem is you actually have to write your own scripts. But for right now, that's not really the goal of this plugin. It's more to provide additional tools for writing scripts.

Maybe I'll write a more extensive plugin that does a similar job as Autom8, but that isn't the goal of this one. However, I will keep it in mind. I too liked Autom8.

As far as the Mission Control idea, what kind of interface and workflow are you thinking of?

Link to comment
Share on other sites

I was trying to show that the current map-view interface _is_ very much like what Mission Control would have. As a counter to the "it's doing too much!" thing.

Every time I ask MJ to create a maneuver node I imagine I'm telling the plotting team to calculate my intercept on the Cray, and when I hit execute...etc.

I'd much rather do that through kOS. Even closer to real life.

Link to comment
Share on other sites

I definitely don't want to go too far towards the MechJeb path, and I'm looking more towards being able to expose game data and do certain things that kOS simply cannot do that can be done manually (like creating maneuver nodes).

Making them is cool. I was worried about the idea of making them "automatically". Giving me the ability to write KOS code that lets ME set maneuver nodes *I* calculated is great. I was worried because I thought the goal was to find a way to let the mod calculate it INSTEAD of me.

What makes KOS so great is it lets me make my autopilot instead of somebody else's autopilot.

Mechjeb would appeal to me a lot more if I was the one who wrote it. Since I'm not, it feels like I'm abdicating part of the game to someone else to play it for me.

Edited by Steven Mading
Link to comment
Share on other sites

It would require the user to enter a start time and a 3D vector representing delta-v. The vector can be calculated using another function I'm putting in here that takes prograde, normal, and radial values (or their opposites, as negatives), and it will return the appropriate vector. I'm not sure yet if the kOS V(x,y,z) structure is equivilent to a Vector3d object, so I will be working on that.

But essentially, it would be the same as going into map mode and creating a node, then pushing and pulling the delta-v markers around on the gizmo, or using the Edit Node (I think that's what it's called) option in MechJeb. You have to set all the parameters to make it work, which means you have to calculate all the parameters yourself in your script.

Link to comment
Share on other sites

In order to execute maneuver node, we need to be able to get its' attitude vector (or, better yet, ability to "lock" onto it), and either a command for engines to execute X m/s burn (like it is in RL spacecraft like Soyuz), or expose more information about spacecraft propulsion system to script (at very minimum, current/max thrust and Isp), so that we would be able to write a script for that.

Link to comment
Share on other sites

kOS already lets you get the direction, magnitude, and eta of a maneuver node. If we can create nodes in kOS, then it allows planning and execution to be decoupled.

Edit: Sorry to be a wet blanket, but there's a different forum for mods in development without a release yet.

Link to comment
Share on other sites

All a maneuver node is is a direction, a location or time at which to do it, and a delta-V magnitude. The other information you see in the user interface is derived from that (like how many seconds it thinks you'll burn - that's not stored in the node, It's calculated based on your current active engines, current mass, and estimate of how fast that mass will change as you burn given your ISP.)

I figure all you need to do to add maneuver node setting to KOS is make a routine that lets you pass in a vector and a number of seconds into the future at which to do it. The vector gives you both a direction and a magnitude, and in this case the magnitude is the delta-V you want from the maneuver. The seconds would let you specify where the burn happens (it happens at where I'll be in N number of seconds from now).

I'm in the middle of looking at the github code on KOS to see if I can add some of the functionality that I currently have as side scripts that I really think is basic and missing, like letting the script writer seamlessly translate vectors into directions and visa versa. You shouldn't be having to resort to running the matrix algebra in KOS script (like I am now) to perform transformation rotations just because the language is missing the ability to do things like cast a direction into a unit vector.

Link to comment
Share on other sites

A preliminary release for the maneuver node portion of the system will hopefully be released today after some more testing and debugging. It will allow you to create maneuver nodes only.

Maneuver nodes will be created by using the function node:create(), which takes four parameters: mission time of execution (in seconds), and prograde, normal, and radial delta-v values.

I want to get the initial release out there right away because it is part-independent, and I know this is something that a lot of people probably want. I still have some things to work out regarding tracking maneuver nodes and being able to remove them at the appropriate times. If all goes well, a full first release, with parts, should occur in less than a week.

If it takes longer, I apologize. I'm a college student so obviously school comes first, but this project is important to me also.

Edit: I just had a sudden inspiration regarding tracking nodes for removal. Instead of having node:create() return an index, I'm going to have it return a hash value as its tracking value. In the event that a node is executed, the node will be removed from internal tracking, and later nodes will change index but not tracking value. If this idea works out (which it ought to, I've done something like this before), node removal will be available in the initial release.

Edited by woodywood245
Link to comment
Share on other sites

I would love to see this on ksp but i wonder if it's possible to ever implement the actual AGC (Apollo Guidance Computer) into the game usin kOS.

It would be possible, but also a bit of a pain to use (how many people around here know how to read octal?)

It's been something I've thought about for a long time though. Even if I wanted to work on it, I wouldn't be able to until the government shutdown is over. The NASA site is down for right now, so I can't get access to any of the official AGC docs.

Link to comment
Share on other sites

Well, it seems, from changes to the docs, that adding and removing maneuver nodes is coming in kOS natively, possibly soon. So the question is, does anyone still want me to develop this? The initial release was due tonight, after I finish the last bit of testing. If you'd still like me to release this, then I will. If I don't hear anything, I will assume "yes" and I will release it anyway.

By the way, my initial release will come with the Sensor Reporter and 1.25m, 2.5m, 3.75m, and 5m parts, each with one kOS computer, all of the sensors, a little bit of power.

Link to comment
Share on other sites

It would be possible, but also a bit of a pain to use (how many people around here know how to read octal?)

It's been something I've thought about for a long time though. Even if I wanted to work on it, I wouldn't be able to until the government shutdown is over. The NASA site is down for right now, so I can't get access to any of the official AGC docs.

This webpage should provide enough info:http://www.ibiblio.org/apollo/

Link to comment
Share on other sites

kOS 0.8 is out, which does everything this mod would have done, and more. So this mod is officially being abandoned until further notice, unless anyone else can think of things that it should do.

On the upside, I've released an update of my Sensor Reporter, which should fix a couple bugs for those of you with kOS 0.7 and earlier, and works best with kOS 0.8.

Link to comment
Share on other sites

kOS 0.8 is out, which does everything this mod would have done, and more. So this mod is officially being abandoned until further notice, unless anyone else can think of things that it should do.

On the upside, I've released an update of my Sensor Reporter, which should fix a couple bugs for those of you with kOS 0.7 and earlier, and works best with kOS 0.8.

Just a warning. 0.8 is unusable at the moment. The parsing of curly braces doesn't work right anymore if they span more than one line, making any code of significant size not work.

Link to comment
Share on other sites

I would really like to see an external window that you could use on a second monitor. Or even a web page display like the telemetry mod. it doesn't have to be type-able, but that would a plus. You have the termanle on the second monitor and you press "~" now your keyboard is set to the termanle. You type your commands then press "~" aging and your keyboard is back to KSP control's. The "~" key could be what ever you like it to be.

Link to comment
Share on other sites

I've been thinking about something similar for a while. I was going to write a program that did something very similar to this and have the data transfer back and forth via a script and the logging system. That was going to be my next project, but I wasn't sure if anyone would want it besides me.

Link to comment
Share on other sites

I would really like to see an external window that you could use on a second monitor. Or even a web page display like the telemetry mod. it doesn't have to be type-able, but that would a plus. You have the terminal on the second monitor and you press "~" now your keyboard is set to the termanle. You type your commands then press "~" aging and your keyboard is back to KSP control's. The "~" key could be what ever you like it to be.

Someone is/has been working on a way to add telnet support to kOS. You could use pUTTY and telnet in from somewhere in your network to control kOS. You could also telnet into multiple kOS units as each one that is initialized gets different port number in sequence. Not sure how far along they've gotten though or where this thread/plugin can be downloaded though so you'll have to do a search if you want to try it out.

Link to comment
Share on other sites

Someone is/has been working on a way to add telnet support to kOS. You could use pUTTY and telnet in from somewhere in your network to control kOS. You could also telnet into multiple kOS units as each one that is initialized gets different port number in sequence. Not sure how far along they've gotten though or where this thread/plugin can be downloaded though so you'll have to do a search if you want to try it out.

At last check (a week ago), that mod is a work in progress, and isn't always caught up with the rest of kOS. It has a few problems on the pUTTY side that made me abandon it within an hour of playing with it.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...