Jump to content

[1.8.1 - 1.10.1] HopperGuidance


oyster_catcher

Recommended Posts

I'm please to announce the release of my first KSP mod HopperGuidance. I initially wrote this 2 years ago in Python using kRPC. I've now re-written it completely in C#, so its closely integrated with KSP and its 10x better because of it. Extract from README at https://github.com/oyster-catcher/HopperGuidance

HopperGuidance
==============

A KSP mod which enables the calculation of a fuel efficient trajectory in-flight to make a soft landing at a designated location respecting the capabilities of the craft. The craft will be steered automonously to follow this trajectory. You can choose many parameters of the trajectory to make it safe or more exciting.

Features
- Choose a landing latitude, longitude and altitude
- Shows the trajectory to landing and require thrust vectors
- Lets you tune the parameters to the craft

You can choose a particular latitude and longitude and altitude to land at, although currently this works best close to the landing site such as within 10km. It must take less than 5 minutes to land. It certainly can't handle descent from orbit and it treats the planet surface as flat and doesn't take into account atmospheric drag, though can correct for it while flying. It may waste quite a bit of fuel trying to keep to the pre-calculated trajectory too. You can give it a try though, its all good fun.

The algorithm used is aimed to be an implementation of the G-FOLD algorithm for fuel optimal diverts
reputably used by Lars Blackmore for landing the SpaceX Falcon-9 rocket. However my algorithm is a simplified version of it and I've added some of my own constraints. See later.

Please see the video https://www.youtube.com/watch?v=Ekywp-P6EBQ&t=301

References

-  "G-FOLD: A Real-Time Implementable Fuel Optimal Large Divert Guidance Algorithm for Planetary Pinpoint Landing" https://www.researchgate.net/publication/258676350_G-FOLD_A_Real-Time_Implementable_Fuel_Optimal_Large_Divert_Guidance_Algorithm_for_Planetary_Pinpoint_Landing.

- "Convex Programming Approach to Powered Descent Guidance for Mars Landing" https://arc.aiaa.org/doi/abs/10.2514/1.27553

- "Minimum-Landing-Error Powered-Descent Guidance for Mars Landing Using Convex Optimization" http://www.larsblackmore.com/BlackmoreEtAlJGCD10.pdf

Prerequistes
============

Works with KSP versions 1.8.1 to 1.10 and possibly beyond.
If you want to run the solver outside of KSP you need python and matplotlib to show the trajectories.

Installing
==========

Copy GameData on top of the existing GameData folder in your KSP installation.

 

Licensed under GPL v2.

Includes ALGLIB (ALGLIB.net) also licensed under GPL v2.

Much for info in the README included with the mod.

Adrian Skilling

[email protected]

Please try it out from  https://github.com/oyster-catcher/HopperGuidance. Please let me know if any problems. I'll be happy to try and fix them, Adrian. Fly safe!

Edited by oyster_catcher
Changed title to convention in KSP version and mod version
Link to comment
Share on other sites

  • 1 month later...

New release version 0.2.3.

This version is a major improvement. See the video I had a lot of fun making below. Now works much better in the base game and with Realism Overhaul. The a major change is the picking of intermediate targets above ground which means you can now define a full trajectory to fly under bridge, simulate an SN5 hop and land a falcon 9 booster (the later two in Realism Overhaul). Its computes better trajectories faster and more reliably and now works well on other planets with different gravity from Kerbin/Earth.

- Added ability to pick multiple intermediate targets
- Removed latitude, longitude and altitude target (set target via pick target only)
- Removed max landing thrust angle, it is set to 10% of max thrust angle
- Removed acceleration gain, it is set to 4x correction factor
- Removed idle angle, it is now always 90 degrees
- Removed max thrust, this is set to 90% of the vessels maximum
- Max thrust angle in the solution is 80% of max thrust angle (allowing 20% extra for corrections)
- Min descent angle only applies to the final trajectory before the final target and not to intermediate targets
- Ground intersect constraint always applies where the ground is the lowest of all the ground targets
- The solution velocity isn't modified by the PID, which results in better following of the trajectory
- Switch to using mesh rather than LineRenderer for track and thrust vectors as transformations work better
- Golden search over time now falls back to simpler search stepping through 10 intervals between Tmin and Tmax then continues golden search, as golden search fails when probe points are non-solutions. This results in much better and faster solutions
- Fixed disappearing track bug when active for a long time

Download v0.2.3 from https://github.com/oyster-catcher/HopperGuidance

Licensed with GPL v2.

Edited by oyster_catcher
Added comment in licensing
Link to comment
Share on other sites

  • 4 weeks later...

Does not seem to work. Don't have H button (also Enable Guidance/Pick Target) as in a video. Do I need some part for that?

Also how do you actually install this mod? Tried placing whole HopperGuidance folder with _ folder in it. Then only _ folder into GameData. Button does not appeare either way.

Also I am not 100% sure if this related, but MechJeb started to work differently, that is it won't show up unless I have MechJeb part on my vessel.

So any ideas how to make this mod work?

Link to comment
Share on other sites

Before I dare to install it, I need to know if the additional PAW entries already got a collapsible submenu thingie with that little white arrow yet.

Then without it these entries make the PAW double the length and in a modded install the PAW will always be bigger than the screen height.

Link to comment
Share on other sites

  • 1 year later...
11 hours ago, Jcklemme said:

This is an amazing mod, I hope it gets support for 1.12 now that KSP is supposedly done updating.  I don't think there's any mods that do what this one does.

I’m going to adopt this mod, give me a few days

I need to see if it needs any work

 

Linuxgurugamer

 

Edit:  good news is that I have it working in 1.12

Edited by linuxgurugamer
Link to comment
Share on other sites

13 hours ago, Jcklemme said:

This is an amazing mod, I hope it gets support for 1.12 now that KSP is supposedly done updating.  I don't think there's any mods that do what this one does.

See previous message

On 9/28/2020 at 7:10 AM, Gordon Dry said:

Before I dare to install it, I need to know if the additional PAW entries already got a collapsible submenu thingie with that little white arrow yet.

Then without it these entries make the PAW double the length and in a modded install the PAW will always be bigger than the screen height.

Part of the work I'm planning on doing

Link to comment
Share on other sites

On 4/7/2022 at 9:23 PM, linuxgurugamer said:

I’m going to adopt this mod, give me a few days

I need to see if it needs any work

 

Linuxgurugamer

 

Edit:  good news is that I have it working in 1.12

Wow, you're amazing.

Is it still conflicting with Mechjeb?

Link to comment
Share on other sites

2 minutes ago, linuxgurugamer said:

What conflict?

In previous versions when this was installed Mechjeb would behave erratically.  It's been a long time since I've used this so it may have been fixed or it may have just been my install.  If you're not seeing anything that would conflict I'll assume it's no longer an issue.

Link to comment
Share on other sites

19 minutes ago, Jcklemme said:

In previous versions when this was installed Mechjeb would behave erratically.  It's been a long time since I've used this so it may have been fixed or it may have just been my install.  If you're not seeing anything that would conflict I'll assume it's no longer an issue.

Please describe what happened, I'll test for it

Link to comment
Share on other sites

 

5 minutes ago, linuxgurugamer said:

Please describe what happened, I'll test for it

Ascent and landing did not work correctly.  I'm not one for coding or able to read logs but it seemed to be that it didn't know where the craft was in terms of altitude from my best guess.  A lot of crashing into the ground on landing and strange, unpredictable behavior with Ascent Guidance.

Like I said, it could have easily just been my install as I usually play pretty mod heavy and did manual installs rather than using CKAN up until recently.  I didn't realize that CKAN actually works almost perfectly and had bad experiences previously with other mod loader programs for other games.

Link to comment
Share on other sites

20 minutes ago, Jcklemme said:

 

Ascent and landing did not work correctly.  I'm not one for coding or able to read logs but it seemed to be that it didn't know where the craft was in terms of altitude from my best guess.  A lot of crashing into the ground on landing and strange, unpredictable behavior with Ascent Guidance.

Like I said, it could have easily just been my install as I usually play pretty mod heavy and did manual installs rather than using CKAN up until recently.  I didn't realize that CKAN actually works almost perfectly and had bad experiences previously with other mod loader programs for other games.

I'll see what I can do.

As long as only one is activated, there shouldn't be any problem

Edited by linuxgurugamer
Link to comment
Share on other sites

On 4/7/2022 at 9:23 PM, linuxgurugamer said:

Edit:  good news is that I have it working in 1.12

Now, do you mean it works in it's current form or that you made fixes to get it to function as expected?

Link to comment
Share on other sites

  • 7 months later...
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...