bassgojoe
Members-
Posts
18 -
Joined
-
Last visited
Content Type
Profiles
Forums
Developer Articles
KSP2 Release Notes
Everything posted by bassgojoe
-
I threw the compiled AGC.dll file in git since it's small, to save you the trouble of monodevelop: https://github.com/joevenzon/kerbal-agc/tree/master/AGC/AGC/bin/Debug Let me know how your missions go!
-
Transcendental functions have been added: https://github.com/joevenzon/kerbal-agc/commit/33d464409d28d6d7e1c61049a3cededcbb5033fa and I updated the README.md with their names.
-
For the variable to exist in the parent scope you need to define it there and then set it inside your function: (begin (define AGC.Status 0) ((lambda () (set! AGC.Status (list 1 88)) )) )
-
Fixed in https://github.com/joevenzon/kerbal-agc/commit/8e4ef3e4c367c7585b8586f4c87b472bb0b645e3
-
The fact that (define (func) ...) doesn't work is probably a bug. But you can work around it: (define (f x y ...) exp) is actually just converted into (define f (lambda (x y ...) exp)) So if you want to define a function without any variables you should be able to use the lambda syntax directly: (define func (lambda () exp))
-
It looks like the 0.23 package is compatible with 0.24. I also put the source up on github: https://github.com/joevenzon/kerbal-agc
-
Here's the comma separated list of built-in functions: if, quote, set!, define, initialize, lambda, begin, +, -, *, /, not, and, or, >, <, >=, <=, =, equal?, eq?, length, cons, car, cdr, append, list, list?, null?, symbol?, defined?, modulo, abs, floor, ceiling, min, max, apply, id, sqrt, let There are also some helper functions defined in stdlib.txt.
-
Dunno anything about racket except that it's a lisp dialect, as is scheme. Scheme tends to be focused on minimalism. Yeah, I'll push out another small release when 0.24 comes out.
-
Info about compiling the source into the kerbal dll plugin can be found here: http://wiki.kerbalspaceprogram.com/wiki/Plugins I used monodevelop. Scheme in general doesn't do explicit loops, preferring recursion instead. But I also provide a lot of built-in functions to do things that you might do with a loop in an imperative language; if you're processing a list for example there are functions which run a function on each element and accumulate the result (see map or foldl).
-
OK, URL updated! http://kerbal.curseforge.com/ksp-mods/222031-automated-guidance-computer
-
Man, I thought kerbalspaceprogram.com was supposed to stay up. Oh well. I re-uploaded the mod to Curse, I'll bump the thread once it gets approved and goes live. Let me know what you think of the mod.
-
The source isn't up on github yet, it's still on my TODO list. I'll put it up soon. Right now the source is distributed in the zipfile. If it's a common convention to return nil on no "cond" predicates matching, I'll go ahead and add that. Thanks for the info, I'm not a very experienced lisp programmer, so I'm relying on people like you to tell me this stuff.
-
Updated to version 0.3! Now with orbit and target parameters, plus a PID controller example. Also, include weissel's bugfix. Still TODO: * allow controlling the AGC with action groups * put the source on github
-
Ah hah, thanks for the typo fix! The project is still go, in fact I'll release a new version shortly. I'll also get it up on github so people can contribute if they'd like.
-
Thanks for the encouragement! LISP still has lots of parentheses. But it's a simple, elegant language that (maybe most importantly) is easy for me to write a robust parser and interpreter for. I think it's also pretty easy to understand for someone who doesn't have a ton of programming experience. I do recommend a text editor with syntax highlighting so you can understand the crazy nested parentheses, though.... If anyone wants to donate a better 3d model, or give me permission to use one from another mod, that'd be rad!
-
@kaldt: I also had the problem of career mode science disappearing after reconnecting with 1.5.0. It's claimed to be fixed in latest code, so I'm going to try out the latest (as of 1/4/14).
-
I just noticed the installations instructions are slightly wrong: you want to extract the zip into your KSP\GameData folder under an AGC subfolder that you will need to create. Sorry about that, I'll correct it for the next release. Also, here's a list of known issues: * I need to expose more variables & functions for orbit * I need to expose variables for your current target (so you can try writing a sweet docking autopilot) * At the moment, the model is an RCS thruster block
-
Automated Guidance Computer version 0.2: initial release version 0.3 updated 2/6/14: orbit parameters, target parameters Introduction This is my first plugin for KSP. I wanted to make a plugin that would allow me to automate some functions on my vessel. I didn't find out about the excellent kOS plugin until after getting pretty far with my plugin, so I just decided to carry on anyway. Yes, AGC is a reference to the Apollo Guidance Computer. The Automated Guidance Computer (AGC) is a part that you can attach to your vessel. The AGC lets you run flight control programs that you code in everyone's favorite programming language, LISP . For example, you could write a program to automatically lower the landing gear when you get below a set altitude, or a program to damp manual control inputs as speed increases, or even a program that implements a three-axis PID controller to follow a specific ascent path. How to use Place the AGC (Automated Guidance Computer) on your ship. In career mode, you need to unlock the Flight Control research node. Put your programs in the Plugins/PluginData/AGC folder with a txt extension. Look at autoabort.txt for an example. The stdlib.txt (stdlib is short for Standard Library) code gets executed when the computer boots up and allows you to implement common library functions to share functionality between your programs. To run a program, put the AGC on a ship in KSP, right click on the AGC and Toggle UI. Put autoabort in for the program name, then click Toggle Computer. The computer will start executing the autoabort program, which activates the Abort action group when the vertical speed is significantly negative and the altitude is still low. Take a look at the autoabort.txt file and examine the source code. Note that it uses the library function makeDebounceOneshot to set up an interlock that will fire when the condition is consecutively true for a given number of seconds. I also provided a speedlimit.txt example, which will reduce the maximum throttle allowed to try and keep the speed from exceeding the limit set in the input field. If you run this program on a spaceplane, for example, and set the limit to 150, the throttle will automatically reduce to try and keep your speed from going too much over 150 m/s. Multiple programs can be run on the same AGC part at the same time. These programs share the same environment, except for the AGC.Input and AGC.Status variables. Press the Debug button to dump out the computer's current state (LISP environment) to Plugins/PluginData/AGC/debug.txt. LISP Dialect Notes The quotation notation ' is not supported, but you can use the built-in quote function to do the same thing, though not as succinctly. Lisp dot notation for dotted lists is not supported. The "cond" function is not supported because if no predicates match, the result is undefined. The empty list () is equivalent to (quote ()). If you pass car a non-list argument, it will simply return it. So, (car 5) evaluates to 5. If you pass cdr a non-list argument, it will return the empty list (). Your program gets evaluated each computer tick. To carry state between ticks, define variables. To make this easier, the "initialize" built-in function is the same as "define", except it does nothing if the symbol is already defined. In Lisp, function arguments are evaluated prior to applying them to the function, except for some special cases like "if" and "lambda". If you are new to Lisp, I recommend The Structure and Interpretation of Computer Programs, a free ebook published by MIT: http://mitpress.mit.edu/sicp/ Download Plugin source code is included in the zip and is licensed under GPL v3. Source code is also available on github: kerbal-agc source Download from Curse