MechJeb2

MechJeb2

4M Downloads

Suggestions to Improve the Spaceplane Guidance

Mogeley opened this issue · 6 comments

commented

I'd like to help with improving the spaceplane autopilot. I wrote an aircraft autopilot for Orbiter so I have some experience with this. If I have time to code any changes where should I put those changes?

Here's my observations of what could be improved.

  1. Control surfaces have an infinite rate of change. These should be clamped down so the control surfaces have a maximum rate in which they can be moved. Snapping control surfaces too quickly around can cause instability in flight.
  2. Flight control should be based on the aircraft's Flight Path. Pitch, bank angle, and yaw is a tool to get to the target heading & slope with their own restrictions like max AOA and max bank.
  3. The autopilot needs to also be able to control the throttle, especially for landing. When landing real planes the aircraft pitch and throttle trade positions. Airspeed is managed by pitch and the flight slope by the throttle.
  4. Max roll should be at least 60 degrees. A 60 degree turn is 2G's (on earth)

Once these are set creating a flight path to a location and landing is quite easy. My autopilot for Orbiter will do fully automatic flights to other spaceports.

commented

Great ! Someone who know how to do it :)

  1. Should be easy to do. I'll look into it
  2. There is no real notion of flight path in MJ for now

The (space)plane AP live inside MechJebModuleSpaceplaneAutopilot.cs (pilot) and MechJebModuleSpaceplaneGuidance.cs (UI).
You can find info on how to set throttle in MechJebModuleAscentAutopilot.cs and various info on the ship are available in VesselState.cs
Someone had worked on a spaceplane patch before. It was far better at aligning with the runway but did not land well with my tests.
sarbian#1
https://github.com/MafiaMoe/MechJeb2/blob/Raf04_Sarbian/MechJeb2/MechJebModuleSpaceplaneAutopilot.cs

Ask if you need any more info.

commented

try (re)targeting Mono / .NET 3.5 check you are linking to all the required
assemblies

On 10 December 2013 05:28, Mogeley [email protected] wrote:

I'm a bit new to visual Studio and I'm trying got get a runnable version
of the DLL that I compiled myself. The code compiled with no issues but I
get a run time exception in the KSP output log. Any idea what this error
could indicate?

Exception when loading C:\Program Files
(x86)\Steam\steamapps\common\Kerbal Space
Program\GameData\MechJeb2\Plugins\MechJeb2.dll:
System.Reflection.ReflectionTypeLoadException: The classes in the module
cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at AssemblyLoader.LoadAssembly (System.Reflection.Assembly assembly,
System.String filePath, System.String url) [0x00000] in :0


Reply to this email directly or view it on GitHubhttps://github.com//issues/249#issuecomment-30200737
.

Disclaimer:
By sending an email to ANY of my addresses you are agreeing that:

  1. I am by definition, "the intended recipient"
  2. All information in the email is mine to do with as I see fit and
    make such financial profit, political mileage, or good joke as it
    lends itself to. In particular, I may quote it where I please.
  3. I may take the contents as representing the views of your company.
  4. This overrides any disclaimer or statement of confidentiality
    that may be included on your message.
commented

I'm a bit new to visual Studio and I'm trying got get a runnable version of the DLL that I compiled myself. The code compiled with no issues but I get a run time exception in the KSP output log. Any idea what this error could indicate?

Exception when loading C:\Program Files (x86)\Steam\steamapps\common\Kerbal Space Program\GameData\MechJeb2\Plugins\MechJeb2.dll: System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.
at (wrapper managed-to-native) System.Reflection.Assembly:GetTypes (bool)
at System.Reflection.Assembly.GetTypes () [0x00000] in :0
at AssemblyLoader.LoadAssembly (System.Reflection.Assembly assembly, System.String filePath, System.String url) [0x00000] in :0

Nevermind... I found the issue... The issue was the compiler was set to use .NET 4.0 and it should be 3.5 for Unity.

commented

thanks that worked.

I've been working on updates to the flight autopilot. I'll keep working on it and let you know if I have any questions.

commented

Glad to see you are working on it :)

commented

Closing this as an old MechJeb issue. Many MechJeb issues have had little interest in years, have been fixed for years, do not include adequate replication steps, refer to old problems which are no longer applicable, or are difficult to determine what the problem is. This issue is being closed for one of those reasons. We apologize for any inconvenience, but keeping the TODO list tidy helps the developers.

If this bug/issue is still a problem, please open a new issue. For bugs please try to include a Minimal, Complete, Verifiable Example that explains all the steps required to replicate the issue. A link to the KSP.log file should be ideally included, but is often not sufficient information. Screenshots or short videos are often the best way to show a bug.