Jump to content

AutoManeuver Mod Development


Recommended Posts

I'm writing an Auto-Maneuver mod.  Not an autopilot, there are a number of those around.  AutoManeuver will simply execute a series of pre-planned steps.  No looping, no branching, no language to learn.  And the UI will be simple

Accessible  in Flight only, Flight Mapview is considered Flight

The maneuvers consist of a sequence of steps. 
Each step can have a starting condition, an action, a timer (length of action), and an ending condition

Below is a list of what I've come up with so far which will be needed to be implemented:

Maneuver Starting and ending conditions

  • Vertical speed greater/less than specified speed
  • Horizontal speed greater/less than specified speed
  • Vessel reaches the specified orbital element
  • AP/PE reaches specified value
  • PE passes AP (AP when maneuver starts)
  • AP drops below PE (PE when maneuver starts)
  • Resource (specified) level drops below/increases above specified level
  • Vessel loses or gains Commnet connectivity
  • Vessel reaches the specified height (ie:  rising or falling)
  • After the specified amount of time has elapsed
  • Touchdown

 

The  possible Actions which can be done (incomplete):

  • Set SAS to mode:  Surface, Orbit, target    
  • Point prograde/retrograde/Normal/Antinormal/Radial-In/Radial-Out
  • Point horizontal relative to surface, engine pointing retro/pro grade the horizontal velocity
  • Calculate angle to point (??? based on ???)
  • Calculate burn time (??? based on ???)
  • Calculate Suicide Burn altitude, based on specified thrust percentage
  • Start engine (all available, or specified)
  • Stop engine (all available, or specified)
  • Turn on RCS
  • Turn off RCS
  • Set throttle to %
  • Set throttle to get specified TWR
  • Deploy parachutes (all or specified)
  • Execute next maneuver node
  • Jettison Fairings
  • Deploy/retract landing legs
  • Trigger action (from action groups)
  • Wait specified amount of time
  • Stage
  • Call Kerbulator to perform calculation

Looking for ideas for any other conditions and actions.  Also, the action to Calculate angle is a tough one, but will probably be handled by including the mod Kerbulator 

For landing, I'm thinking of incorporating the functionality of the Horizontal Landing Aid to be able to reduce/stop horizontal movement using RCS.

Comments, suggestions are welcome

 

LGG

    

Edited by linuxgurugamer
Link to comment
Share on other sites

3 minutes ago, GuessingEveryDay said:

Will this include auto-circularize? Like it can take the Apophasis and plot a maneuver that will set eccentricity to 0?

Well, this is what I'm looking for, input.  Good idea.  But it's not going to "plot" a maneuver, this will execute the maneuver.  I'll add the circularize mode to the list

Not needed as a separate maneuver.  Just use the option to burn until the PE equals/exceeds the AP, I'll add the PE vs AP to the list of conditions

Edited by linuxgurugamer
Link to comment
Share on other sites

Would you be interested in using maneuver nodes? These features you already listed would do most of the work to automate a maneuver without having to do fancier autopiloting:

  1. Start condition = "Vessel reaches the specified orbital element", if you consider the maneuver node (perhaps with the 50% burn time margin) to be an orbital element.
  2. Action = "Set throttle to [100]%".
  3. End condition = "After the specified amount of time has elapsed" could be read from the maneuver node.
  4. Action = "Set throttle to [0]%".
Link to comment
Share on other sites

@linuxgurugamer This is a really interesting idea. Do you think pitch/yaw/roll and RCS translation inputs would fit with this idea or would that be stepping into autopilot territory? Also, if you're taking suggestions for UI then I think some kind of flowchart-esque editor would be cool.

I could see myself having fun with a mod like this :D

Link to comment
Share on other sites

2 hours ago, RealKerbal3x said:

Do you think pitch/yaw/roll and RCS translation inputs would fit with this idea or would that be stepping into autopilot territory?

Not sure.  If it can be done as an If/then type of condition, then maybe, but to have constant adjustments is not where I'm looking to aim this.

2 hours ago, RealKerbal3x said:

kind of flowchart-esque editor would be cool.

May be cool, but not going to happen.  As I said, no looping, and I should also add "no branching".  If I do this, it's just going to be a sequence of steps to be performed.  UI will be fairly basic

Link to comment
Share on other sites

5 minutes ago, linuxgurugamer said:

Not sure.  If it can be done as an If/then type of condition, then maybe, but to have constant adjustments is not where I'm looking to aim this.

I was just thinking of something like 'if x, then pitch up for y seconds' or similar.

Edited by RealKerbal3x
Link to comment
Share on other sites

51 minutes ago, RealKerbal3x said:

I was just thinking of something like 'if x, then pitch up for y seconds' or similar.

No branching.  An "if" is a branch

The principle here is KISS

I just came across a mod called Kerbulator, which is a calculator for KSP.  Looks quite interesting, I might be able to incorporate it into this mod, or at least work with it if it's installed

Link to comment
Share on other sites

Id love this. Not a full fledged mechJeb, but still able to automate long burns.

Id also love if it had a preset way to simply execute a manuver node, no extra frills. (so a single 'execute manuver' button). I can use MJ for it, but I dont like having a 'do everything for me' autopilot on top of it.

Link to comment
Share on other sites

7 minutes ago, toric5 said:

Id love this. Not a full fledged mechJeb, but still able to automate long burns.

Id also love if it had a preset way to simply execute a manuver node, no extra frills. (so a single 'execute manuver' button). I can use MJ for it, but I dont like having a 'do everything for me' autopilot on top of it.

I'm actually thinking about doing that.  Adding a "Execute next maneuver node"  action

Link to comment
Share on other sites

16 hours ago, linuxgurugamer said:

The  possible Actions which can be done (incomplete):

I had a couple in mind, Jettison Fairings, Extend landing legs, but those can just be done with action groups.    Action groups should be included in this list. 

Link to comment
Share on other sites

Really good idea. In the past I build some "autonomous Landing Programs" with SmartParts, actiongroups and Diazos mods (ModActions, Landing Height, Horizontal Landing Aid, VerticalVelocity...).
Like this (example):
- at speed x (measured with SmartParts) open Parachute (execute actiongroup x)
- at height x (SmartParts) separate heatshild, activate engine (actiongroups) and slow down to -5m/s (ModActions/VerticalVelocity).

The most complex mission was a Curiosity-like landing at Duna (which was successfull). The only problem was: not enough actiongroups in stock. But there was actiongroup Extended.

Edited by Cheesecake
Link to comment
Share on other sites

3 hours ago, Gargamel said:

I had a couple in mind, Jettison Fairings, Extend landing legs, but those can just be done with action groups.    Action groups should be included in this list. 

The fairings & landing legs are good, I'll add them.  I'll also add Action Groups to the list.  Personally, I would not use the action groups, would rather this be mostly self-contained, but I can see their usefulness

Link to comment
Share on other sites

This sounds promising. Not sure about individual items but an “execute next action” only version of mechjeb (ie without the calculating for you part) to relieve the monotony of common actions would be most welcome.

Link to comment
Share on other sites

1 minute ago, linuxgurugamer said:

Personally, I would not use the action groups, would rather this be mostly self-contained, but I can see their usefulness

I think a lot of the mod could be handle with action groups.   Start engine, Stop Engine, Fairings, etc.  While action groups can be limited in the stock game, mix this with AGX, and you'll have a lot more options.   I'm not saying you should get rid of the other commands, as most of those aren't doable by action groups, you're just going to encounter a chorus of "Why no action groups!?" if you had published without them.   

Oh, selecting a pre-established target would be nice too.   My interplanetary mother ships are usually huge hulking beasts with forward facing solar panels that get easily blocked if it's not pointing at the sun.   I usually targeted moho and pointed towards target.   A nice little macro to do these steps would be nice, possibly triggered by "resource dropping below".

On a similar idea, having these macros trigger under certain conditions is nice, also allowing them to be slaved to an action group might be useful, although that might be outside the scope of what you intend here. 

Link to comment
Share on other sites

4 minutes ago, Gargamel said:

Oh, selecting a pre-established target would be nice too.   My interplanetary mother ships are usually huge hulking beasts with forward facing solar panels that get easily blocked if it's not pointing at the sun.   I usually targeted moho and pointed towards target.   A nice little macro to do these steps would be nice, possibly triggered by "resource dropping below".

Starting to get into the realm of a full autopilot.  This is possible, but having macros like that is starting to get it more complicated AND more of a system impact

5 minutes ago, Gargamel said:

On a similar idea, having these macros trigger under certain conditions is nice, also allowing them to be slaved to an action group might be useful, although that might be outside the scope of what you intend here. 

Same with this.  The idea behind the mod is that you get your vessel where you want to go, and then tell it to run a series of maneuvers (actions).  Having something running which is watching for a condition both needs more CPU and takes this out of the realm of a simple (ha) maneuver mod

A bit more explanation:  There is a mod called Kerbulator, a full cli-based calculator which is (unfortunately) broken in the latest version.  The previous version works, I'm working my way through the various commits trying to find where it's broken.  Assuming I can, I'm intending to either incorporate it as part of this mod, or to use it external.  This mod will provide a full method for doing calculations, and I'll probably provide some standard calcs as part of it.  The mod does not appear to have any sort of an API at this time

This will hopefully solve the issue of doing calculations, and will make the whole thing go much faster

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

The fairings & landing legs are good, I'll add them.  I'll also add Action Groups to the list.  Personally, I would not use the action groups, would rather this be mostly self-contained, but I can see their usefulness

If youre going that far into it, what about decouplers? ie staging?
Granted, that could part of the action group(s) thing, also...vOv

Edited by Stone Blue
Link to comment
Share on other sites

Made some good progress last night.  I now have the functionality to do a simple Execute Next Maneuver Node

This will be included in the mod.  I need to add some options, such as

  • How far in advance of the node to start the burn (as a percentage of the full burn)
  • How far off of  pointing at the maneuver node would be allowed  to be able to start the node
  • Whether to do a full power burn or have a short throttle down period at the end
  • Minimum throttle setting for the throttle down period

Also need to add code to stop any warping  in progress.

Let me know if you can thing of any other options useful for this functionality 

Link to comment
Share on other sites

Just now, Stone Blue said:

@linuxgurugamer just wondering if there is any overlap in the functions of this mod, and HebaruSan's new Planning Node?
 

 

I don't think so.  This mod is essentially a simple autopilot, with a variety of functionality.   The Planning Node mod is essentially an improved method of making a maneuver node, but it doesn't (AFAIK) do anything automatically

 

Link to comment
Share on other sites

On 3/10/2021 at 10:44 AM, linuxgurugamer said:

Made some good progress last night.  I now have the functionality to do a simple Execute Next Maneuver Node

This will be included in the mod.  I need to add some options, such as

  • How far in advance of the node to start the burn (as a percentage of the full burn)
  • How far off of  pointing at the maneuver node would be allowed  to be able to start the node
  • Whether to do a full power burn or have a short throttle down period at the end
  • Minimum throttle setting for the throttle down period

Also need to add code to stop any warping  in progress.

Let me know if you can thing of any other options useful for this functionality 

One thing I would find super useful personally - execute next maneuver node whether or not the craft is currently focused in the flight scene. And then execute the one after that, and then the one after that... So you could essentially queue up commands in a given vessel to happen at appropriate times, like on actual space missions (by creating and then queueing/assigning maneuver nodes as the 'commands'). That way, you could leave your mission to run without needing to switch to each vessel that needs to execute a maneuver at specific times, and then switching back to the flight scene you want to focus on, and then switching again...

Of course, you can use KAC to set alarms for maneuver nodes now, but you still have to perform each maneuver on each craft every time something needs to happen, instead of abstracting some of the maneuvers and 'letting mission control take care of it', in a sense.

It sounds like this is probably outside the scope of what you're interesting in doing, but thought I'd throw the idea out there as a potentially interesting one that would permit more strategic mission planning as opposed to micromanaging maneuvers.

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...