pixartist

[WIP][Plugin][0.3.3] Flight Computer - Fully automated flight, programmable via VPL

Recommended Posts

KSP Flight Computer

Node docs (outdated - will be updated soon)

Download Alpha 0.3.3

Changes

- Added Get Yaw, Pitch, Roll nodes

- Fixed Altitude over ground

- Fixed dragged node connections not being deleted when their origin node is deleted

Example: How to get to Orbit (Outdated, but there is a launch subroutine included which will bring you into orbit with the latest release)

Album: http://imgur.com/a/n4fOT

- The vehicle is a simple rocket: http://i.imgur.com/CRGVCoX.jpg

- This is the main program, it uses subroutines to keep it simple and clean: http://i.imgur.com/XBnTHPg.jpg

- This is the prelaunch subroutine. It initializes the vessel and launches it: http://i.imgur.com/qJ9BBdN.jpg

- This is the automatic staging, self-explanatory: http://i.imgur.com/dFph6TS.jpg

- This is the gravity turn, it rotates the vessel from up to east during the execution. It stopes executing when the given apoapsis is reached. TurnEnd is the altitude where it will have rotated by 90° to the side: http://i.imgur.com/5DvOwSF.jpg

- This is the circulation burn, it burns until apoapsis + periapsis = 2x altitude, ensuring that the vessel is exactly between apoapsis and periapsis. The heading is locked to the east: http://i.imgur.com/jmlT21G.jpg

That's it!

Here is the flight:

Older versions:

Alpha 0.3.2

- Reorganized GUI into a better structure, using multiple standardized windows

- Added Action buttons which can be used to trigger code via a button

press (Node is under Events)

- You can now pan within the program editor via drag and drop

Alpha 0.3.1

- Changed duplicate node key from shift to ctrl

- GUI overhaul

- Window states are saved

- Windows are draggable

- Windows are resizable

- Added Watch Value node (Any value type can be connected to this)

- Watched values are displayed in the small default window

- Added toggle RCS node

- Added Body Radius node

- Added Body Mass node

- Added Gravitational Constant node

- Added Time Node

- Fixed Fuel Empty Node

- Most Event nodes now can be toggled via boolean input

- Included example subroutines

- Got a new line drawing algorithm

- Update: Hotfix for multiple Watch Value node enables in 0.3.1

Alpha 0.2.7

- Reduced Gui button size

- Changed all values to double

- Overhauled the location nodes. World location is a temporary world

space coordinate rotated into navball space, geo locations are

geographic constant coordinates. Conversion nodes added

- Added Select number node

- Added Sign node

- This update will probably break all your programs, sorry :/

Alpha 0.2.5

- Program loading hotfix

Alpha 0.2.4

- Fixed FuelEmpty and Subroutine Entry & Exit

Alpha 0.2.3

- Changed ALL heading values to Vector3 and relative to the navball

- You can now copy a node by dragging it while holding SHIFT!!

- Subroutines can now be edited in place

Alpha 0.2.2

- Added gravity vector node

- Added Dot product nodes

- Added Vector3 to heading node

- Fixed Magnitude node

- Fixed Normalize node

- Added Exception handling to subroutines

Alpha 0.2.1

- Changed heading nodes to use absolute direction vectors

- Added transformation node from absolute to navball heading

Alpha 0.2

- Added Subroutines allowing fully customizable, sharable custom nodes

- Major UI Overhaul

- Major code refactoring

- Added log window

- Small window is draggable

- Subroutines are stored in GameData\FlightComputer\Subroutines

Alpha 0.1.9

- Added markers indication if a node is being executed

- Added ActionGroup node (aftokinito)

- Added StageCount node (aftokinito)

Alpha 0.1.8

- Added compression, reducing storage space 10 fold+

Alpha 0.1.7

- Fixed FuelEmpty node

- Added heading towards target node

Alpha 0.1.6

- Added exception handling to assembly finder

- Added Delta / second node

- Added DT (Delta Time) node

- Added SAS Controller strength node

Alpha 0.1.5

- Added gravity node

- Added mass node

- Added max thrust node

- Changed delta to delta/s

- Added vector operators

Alpha 0.1.4

- Added categories for vector nodes

- Fixed greater node

- Added lesser node

- Added Magnitude nodes (V2/V3)

- Added Normalize nodes (V2/V3)

- Addec Vector2 variable type

Alpha 0.1.3

-Changed connection cancelling button from middle mouse to rmb

-Added custom action group actions

Alpha 0.1.2

-Added pitch,yaw and roll setting nodes

-Removed "Set Value" node

-Changed coloring of Flight Stats and Vector3

Alpha 0.1.1

- Changed paths to work on linux systems

0.1 first release

- First release

How to use

The component is in the science section and uses the barometer (?) model currently. It's called "Flight Computer".

Features:

  • Fully programmable vessel behavior via Visual Programming
  • Easy addition of custom nodes (Base classes are in a seperate assembly)
  • Variables
  • Internal abstraction of rotation values into Navball Heading vectors + roll in order to simplify rotation management

Planned features:

  • Actiongroup event binding DONE
  • Subroutines DONE
  • Saving of separate programs / subroutines DONE
  • Possibly communication with mechjeb
  • Get heading relative to other bodies DONE
  • Multiple program tabs
  • Make Aircraft work 100% DONE
  • Add indicator for nodes that are being executed DONE
  • More default nodes

Demo Video:

Basic workflow example:

Tell me what kind of nodes you would like to see, what kind of behaviors you would like to implement

Source code on GitHub, License: GNU GPL version 3

FAQ

- How do I delete a node?

Press the little x button

- How to I remove connections?

Right click on a connector

- How do I cancel making a connection?

Right click

- How do I get a value from a node without changing the current value?

You don't need to execute a node in order to get the ouput values. ONLY execute nodes when you want to execute the active part of the node. You can get all outputs from any node without executing it (Variable nodes for example, should only be executed to change the value of the variable. If you want to get the value, simple connect the output, not the execution)

What happens if I make a circular connection?

In most cases involved nodes will crash and be removed. Certainly connections like this are not valid code. I will update this with more examples of crashing programs.

Contributors:

https://github.com/aftokinito

Edited by pixartist

Share this post


Link to post
Share on other sites

I'm still in a mild state of shock. My eyes are spinning in my head like a slot machine, because I'm far too dumb to program anything like that, but seeing the execution was amazing! Can't wait to see what others come up with! :D

Share this post


Link to post
Share on other sites

This is truly remarkable. It seems to fill the gap between MechJeb and kOS. It's hard to tell you what kind of nodes I'd like to see, though--I've got only the slightest idea how the whole thing works from the video.

Share this post


Link to post
Share on other sites
This is truly remarkable. It seems to fill the gap between MechJeb and kOS. It's hard to tell you what kind of nodes I'd like to see, though--I've got only the slightest idea how the whole thing works from the video.

I will make it available soon.

Share this post


Link to post
Share on other sites

Wow. Seriously impressive, I'll look forward to seeing what I can do with it. Do you have nodes/inputs/controls suitable for rover driving?

Share this post


Link to post
Share on other sites
Wow. Seriously impressive, I'll look forward to seeing what I can do with it. Do you have nodes/inputs/controls suitable for rover driving?

Not yet! But it's on my bucket list now.

Share this post


Link to post
Share on other sites

It doesn't work on Linux, as it giving a no part in VAB/SPH bug.

All parts are gone when the mod is present. Tried it on a clean install with only Flight Computer.

Maybe it's a case sensitive type in the source?

Share this post


Link to post
Share on other sites
It doesn't work on Linux, as it giving a no part in VAB/SPH bug.

All parts are gone when the mod is present. Tried it on a clean install with only Flight Computer.

Maybe it's a case sensitive type in the source?

I'm using XML.Linq to load the node information. Is the Path you are using GameData/FlightComputer/... ?

Share this post


Link to post
Share on other sites

Yes, that's right. I didn't make any changes to the folder names.

It could also be a \ issue, could you compile a version with \ instead of / in the path definitions?

Edited by Albert VDS

Share this post


Link to post
Share on other sites

Good work. Can't wait to follow the progress. Just what I've been looking for. For behaviors I would like to see more nodes that retrieve external/environment variables. Like FAR's Max Q, Atmospheric density. Vessel Gforces etc..

Share this post


Link to post
Share on other sites
Yes, that's right. I didn't make any changes to the folder names.

It could also be a \ issue, could you compile a version with \ instead of / in the path definitions?

Currently I'm using Environment.CurrentDirectory + "\\GameData\\FlightComputer\\Nodes\\". I will compile a different version now

Share this post


Link to post
Share on other sites
Good work. Can't wait to follow the progress. Just what I've been looking for. For behaviors I would like to see more nodes that retrieve external/environment variables. Like FAR's Max Q, Atmospheric density. Vessel Gforces etc..

What do you mean by "FAR's Max Q" ?

Share this post


Link to post
Share on other sites

Wow...... Simply Wow.....

Great idea and glad to see it being done this way...

Must play with this now....

Cheers and good luck.

Edit: Just installed and ran first program...

THIS IS GOING TO ROCK......

As far as suggestions, my first would be the ability to save the program.... I have seen that this is on the 'to do' list, and I think it will be first on my list of requests...

The ability to integrate into MechJeb would be great. I seem to remember that hooks have been put in so that KOS could access it, if I am remembering correctly.

At some point, the ability to output a text file with user selected items and user selected formatting would be another item I would like to see...

The ability to get to any item (data value, toggle, ??? ) as can be found with the RMB on parts would be awesome.

Don't get me started... I have been hoping something like this would come out and here it is.....

Again, great work...

Edited by drtedastro

Share this post


Link to post
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.