boris-barboris / atmosphereautopilot Goto Github PK
View Code? Open in Web Editor NEWPlugin for Kerbal Space Program
License: GNU General Public License v3.0
Plugin for Kerbal Space Program
License: GNU General Public License v3.0
When enabling the master switch at high altitude with AoA-hold mode selected, the AoA target is often set to angles that aren't near the current AoA (sometimes 100+ degrees) or even in the direction that the vessel is rotating toward.
When flying at extreme conditions, the control authority for pitching up and pitching down is becoming very different.
When I fly my stock-aero Eve SSTO with stock propeller engines at 10km+ at eve, since pitch-stability tend to roll your craft to AoA=0 but at 16km you need very high AoA - and you need pitch-stability or fuel tank's angular lift will ruin everything, AA will pitch down a lot (10m/s delta-vertical-vel) when you input a down control , but pitch up a little (1m/s delta-vertical-vel) when you input a up control (standard FBW). This is the most severe when you are climbing with barely acceleratable power (counting the thrust of props, only -200L/D, plus L=G means that Acc=G/200, and prop already set to max since I bind prop torque with main throttle) and near-stalling (10deg AoA) at 16.9km of Eve. Increasing the final altitude and velocity is very important for making Eve SSTO to orbit.
Btw, I still want to thank you for making this amazing mod, with the help of AA I can easily climb to 16km without consuming EC (solar bay, with SAS I can only climb to 14.5km before consuming EC), and climb to 140m/s@16900m, with SAS I got best 138m/s@16250m, same craft. (This craft is capable for Eve Orbit@90km with 1 Kerbal+Seat, 20 airlocks, and 150m/s nuclear dv, 1500m/s ion dv that is already enough for making it home.
I've been trying to find a way to set a max bank angle but can't seem to find anything in the documentation. Is this something that is possible with Atmosphere Autopilot?
Is possible to make the GUI resizable? (like mechjeb)
The way assetBundles are working changed somewhere around unity 2017, and now the "old way" became deprecated. This patch changes things on the loading front.
Also, building the assetBundle is now a real pain, since importing something dependent on UnityEngine.UI in the unity editor is broken in 2019.2.2 which KSP uses. You need to manually put the UnityEngine.UI.dll into the "plugins" folder, open the project, then import the AA.UI.dll, then import the prefab, then remove the UnityEngine.UI.dll, because importing it breaks other stuff, then pray to some unity gods or something... So I decided to just add the already exported bundle as a binary. Hopefully it will last another several years.
diff.txt
I didn't do it as a pull request because I'm lazy :)
[EXC 11:53:01.074] NullReferenceException: Object reference not set to an instance of an object
VesselAutopilot.SetAutopilotTarget (System.Boolean initialize) (at <9d71e4043e394d78a6cf9193ad011698>:0)
VesselAutopilot.SetAutopilot (System.Boolean initialize) (at <9d71e4043e394d78a6cf9193ad011698>:0)
VesselAutopilot.Update () (at <9d71e4043e394d78a6cf9193ad011698>:0)
Vessel.Update () (at <9d71e4043e394d78a6cf9193ad011698>:0)
Here's the entire log.
Default indicator is colored red, but in actual play the indicator's visibility is not so good. Some improvements are requested. Potential improvements may be:
.cfg
filesDescription:
Create an AoA cruise mode, when you input a W/S control, it just changes desired AoA.
(Still take my Eve SSTO as an example: it is tuned between -0.7deg and 0.2deg at 300-1700m/s.)
AoA is limited to less than the set value when in precision mode with the pitch rate limit enabled.
user_controlled seems to never get reset to false when user input returns to 0. Might be intentional and only used for the sideslip moderation, but it should be renamed if so.
This is to avoid module manager rebuilding the patches on each game loading instead of using the much faster cache. Read this for more information: m4v/RCSBuildAid#32
I see an error in the log:
KSP-AVC -> Version file contains errors: https://raw.githubusercontent.com/Boris-Barboris/AtmosphereAutopilot/master/AtmosphereAutopilot/AtmosphereAutopilot.version
Deployed surfaces are not movable by the autopilot or manual controls. That might have been intended, but it should be optional or per-surface controllable, and can be done by disabling pitch/yaw/roll for that control surface anyway. Without the mod, the deploy angle is an offset to the user-input angle, not an override.
Additionally, change speed is dependent on deploy angle, see the line below from SyncModuleControlSurface.cs. It's likely that the intention was to only use the sign of deployAngle.
deflection = deflection + deployAngle * Common.Clampf(target - normdeflection, spd_factor);
this is for 0.001deg-level inclination control of SSTO to prepare for precise equitorial orbit around Kerbin (as KSC is not precisely on the equator, 2' south for runway). If it's in somewhere I didn't find in config, you may tell me and I'll appreciate it.
description: craft settings-roll ang vel controller, every time I have to manually set it to 0 before takeoff. reverting to launch, exit and restart KSP, etc. will cause this value to return to 3deg, making me have to set it to 0 every time before takeoff (shrugging.png here)
Hi! Since the Update to 1.0.5, there is a compatibility issue between USI-LS[https://github.com/BobPalmer/USI-LS/releases] and AtmosphereAutopilot. There is a logspam of:
MissingMethodException: Method not found: 'ResourceConverter.ProcessRecipe'.
If either USI-LS is or AtmosphereAutopilot is removed, the logspam goes away.
This happens both in the editor as well as in a flight scene, if a crewed part exists.
http://forum.kerbalspaceprogram.com/threads/116790-1-0-USI-Life-Support-0-1-0-2015-04-27
https://github.com/BobPalmer/USI-LS/releases
First, an introduction: I have more than 25 years experience in software development, but it's been about 18 years since I've done anything remotely related to Windows development (including C# and Mono). It's entirely possible that there's something I'm not doing that's immediately obvious to someone else.
Since I'm running on Mac OS X, I have installed Xamarin Studio 6.1.1 build 15, Mono 4.6.1, and GTK+ 2.24.23.
I forked the source code repository and cloned it locally. I opened the solution file, set the active configuration to Debug, cleaned, and built the solution (the level above the AtmosphereAutopilot
, AtmosphereAutopilot.GUI
, and TestingConsole
projects). Four errors in TestingConsole
, but the other two projects appear to have built okay [1]. I copied the files in bin/Debug
to GameData/AtmosphereAutopilot
, overwriting what was already there.
When I launch KSP with the code built locally, I get this in KSP.log
:
[ERR 19:46:11.924] AssemblyLoader: Exception loading 'AtmosphereAutopilot': 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 <filename unknown>:0
at AssemblyLoader.LoadAssemblies () [0x00000] in <filename unknown>:0
Additional information about this exception:
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.FlightModel' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.DirectorController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.AngularAccAdaptiveController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.AngularVelAdaptiveController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.PitchYawAngularVelocityController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.PitchAngularVelocityController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.RollAngularVelocityController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.YawAngularVelocityController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.MouseDirector' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.CruiseController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.ProgradeThrustController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.AoAController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.SideslipController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.PitchAoAController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.StandardFlyByWire' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.TopModuleManager' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.TopModuleManager+CraftSettingsWindow' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'PartMass' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'EngineMoment' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.AngularAccAdaptiveController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.PitchYawAngularAccController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.PitchYawAngularAccController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'AtmosphereAutopilot.AngularAccAdaptiveController' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'CenterIndicator' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'CruiseMode' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'HeightMode' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
System.TypeLoadException: Could not load type 'SettingsProfile' from assembly 'AtmosphereAutopilot, Version=1.5.7.0, Culture=neutral, PublicKeyToken=null'.
To make sure this isn't a debug-versus-release thing, I changed the configuration to Release, cleaned, built again [2], and copied the resulting files to GameData/AtmosphereAutopilot
. Same results.
Since we appear to be running completely different systems to develop, I'm not going to ask you to diagnose my system. (If you already know why it's not working for me, I wouldn't turn down that answer, however. ๐ ) What would help is if you could describe or document how you build the code. Hopefully that will show me if I'm missing some essential step or steps.
I'm happy to document/edit the build instructions in a new section in README.md
once this is working.
[1] The first time I built AtmosphereAutopilot
, I got an error because the .csproj
file has a hardcoded reference to the COPY
command, which Mac OS X doesn't have. Until I figure out how to copy README.md
in a cross-platform-safe fashion, I've commented it out of the .csproj
file. I don't think this should cause my built code to fail.
[2] The first time I built with the Release configuration, I got an error because the output paths in the .csproj
file are hardcoded to refer to an installation under Steam, which isn't valid for me (I have the full app from Squad). I edited the .csproj
file so the output paths are bin/Release
instead. Since my results were the same as when I built with the Debug configuration, I don't think this is the cause of my local code failing either.
Ie from fly-by-wire to cruise mode , speed and altitude should be retained from previous mode when switching
Hi!
For some strange reason, the AA-Button is not present, if the RCSBuildAid plugin is installed
http://forum.kerbalspaceprogram.com/threads/35996-1-0-2-RCS-Build-Aid-v0-7-2
https://github.com/m4v/RCSBuildAid
Removing RCSBuildAid makes the AA-Button appear again.
I could produce this in a clean install, so interaction with a 3rd mod can be excluded.
Update: The offending file is apparently RCSBuildAid/Plugins/RCSBuildAidToolbar.dll
This is the source coude of the file: https://github.com/m4v/RCSBuildAid/blob/master/RCSBuildAidToolbar/Toolbar.cs
Hello, could we make the Use_breaks field in the thrust controller serializable? I can't save the settings, and every load of the game, I have to manually unset it. Tried adding use_breaks=False to global settings and vessel design, no dice.
I'm not a C# dev, but I think the culprit is that it isn't serializable:
On a related note, could we also fix 2 minor issues: When use_breaks is on (default), I can't manually use the breaks, and when the module is actively breaking, and I press the "master switch" [P], the breaks keep on.
Cheers.
I have found a bug - after installing this autopilot mod i cant load my crafts in SPH(load button in craft selecting menu just not workin) not all but almost all including stock crafts also. all went back to normal when i uninstalled this mod.ย ksp ver 1.10.1
please fix
I know AA uses SyncModuleControlSurface module instead of stock ModuleControlSurface.
But there is a problem like this :
when a plane's ModuleControlSurfacevalue like authoritylimitor or deployAngle is modified in pure stock ksp,
and when I load this plane in AA ksp, that settings value is gone and setting in action group is also gone.
MODULE
{
name = ModuleControlSurface
isEnabled = True
mirrorDeploy = False
usesMirrorDeploy = True
ignorePitch = False
ignoreYaw = True
ignoreRoll = False
deploy = False
deployInvert = False
partDeployInvert = False
deployAngle = 0 // <- here
authorityLimiter = 150 // <- here
stagingEnabled = True
EVENTS
{
}
ACTIONS
{
ActionToggle
{
actionGroup = Brakes // <- here
wasActiveBeforePartWasAdjusted = False
}
ActionExtend
{
actionGroup = None
wasActiveBeforePartWasAdjusted = False
}
ActionRetract
{
actionGroup = None
wasActiveBeforePartWasAdjusted = False
}
}
AXISGROUPS
{
deployAngle
{
axisGroup = None
axisIncremental = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
axisInverted = None
overrideIncremental0 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental1 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental2 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental3 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
}
authorityLimiter
{
axisGroup = None
axisIncremental = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
axisInverted = None
overrideIncremental0 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental1 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental2 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental3 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
}
}
UPGRADESAPPLIED
{
}
}
}
MODULE
{
name = SyncModuleControlSurface
isEnabled = True
mirrorDeploy = False
usesMirrorDeploy = True
ignorePitch = False
ignoreYaw = False
ignoreRoll = False
deploy = False
deployInvert = False
partDeployInvert = False
deployAngle = 15 // <- here
authorityLimiter = 100 // <- here
stagingEnabled = True
EVENTS
{
}
ACTIONS
{
ActionToggle
{
actionGroup = None // <- here
wasActiveBeforePartWasAdjusted = False
}
ActionExtend
{
actionGroup = None
wasActiveBeforePartWasAdjusted = False
}
ActionRetract
{
actionGroup = None
wasActiveBeforePartWasAdjusted = False
}
}
AXISGROUPS
{
deployAngle
{
axisGroup = None
axisIncremental = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
axisInverted = None
overrideIncremental0 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental1 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental2 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental3 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
}
authorityLimiter
{
axisGroup = None
axisIncremental = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
axisInverted = None
overrideIncremental0 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental1 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental2 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
overrideIncremental3 = Pitch, Yaw, Roll, TranslateX, TranslateY, TranslateZ, WheelSteer, WheelThrottle, Custom01, Custom02, Custom03, Custom04
}
}
UPGRADESAPPLIED
{
}
}
}
It makes a small problem that transfering .craft file from AA modified KSP -> to stock KSP.
Yes. it removes settings of wings. it is a main problem now.
I added .craft file in here.
Hi Boris, I'm looking to create an autopilot prop using https://github.com/MOARdV/AvionicsSystems/.
What I'd like to do is create a bridge where MAS can send commands to AA and display settings from AA on props. I've tried looking at your code, and I can't really make heads or tails of the different projects. Basically, I'm looking to duplicate the GUI inputs through MAS props inside the IVA:
Where would I find these functions in the AA code?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.