Jump to content

[PART, 1.0.2] Anatid Robotics / MuMech - MechJeb - Autopilot - Historical thread


r4m0n

Recommended Posts

zak, I think your Tf is too big for the vessel. A Tf=.3 on a 20t or bigger seems to work fine. But on smaller ships, it slows down too much and doesn't want to reach zero.

edit: MJ used to default to .15 but that was too small for larger stuff (just for reference)

Link to comment
Share on other sites

Hello, I'm a new user to Mechjeb, just started using it and immediately bumped into very annoying behavior - not sure if there is an option to fix it that I didn't find, or it's a bug, or it "works as intended" and will not be touched.

Let's say we have a rocket with big TWR difference when full and empty (1.2 and 10, for example), an engine with minThrust=1000 and maxThrust=2000, autopilot ascent guidance is in progress and "limit to 40 m/s2" is also on. (and Deadly Reentry plugin, which can kill crew or destroy vehicle parts at very high acceleration, but that's the point)

If flying manually (without mechjeb), there's no problem: at around 40 m/s2 I slowly turn down the throttle so the vehicle stays under 5g, until the engine hits 1000 kN and cannot be throttled any lower. After that g-force keeps rising for some time until the stage expires. That's normal and expected.

With mechjeb, the throttle goes down normally at first, but near the bottom of throttle gauge, MJ starts to turn the engine on and off very rapidly. This violent shaking, especially with high thrust engines, sometimes can rip the rocket apart, make it uncontrollable, not to mention that real rockets don't work that way. Checking "smooth throttle" doesn't prevent this.

So, just switch "limit to..." off? But then Mechjeb won't throttle back at all, not even to 50%. Manually throttle? I wish I could, Mechjeb won't allow me while it has control. Right now the only option seems to right-click the engine and use the "thrust limiter" slider so throttle always stays higher than 50% (in the above example). But that only works if I have one engine, what if I have 5 of them? Another option is to quickly change numbers in "limit to..." as the acceleration rises, but then it's actually more hassle than just to fly without Mechjeb at all.

Did I miss some option which turns this off? Or if it's a bug, can I ask very kindly to fix it? It seems that one option would be telling Mechjeb not to limit engines below their minThrust, and the other option is to add a "manual throttle control" interface button which will allow for, well, manual throttle control.

Link to comment
Share on other sites

Did I miss some option which turns this off? Or if it's a bug, can I ask very kindly to fix it? It seems that one option would be telling Mechjeb not to limit engines below their minThrust, and the other option is to add a "manual throttle control" interface button which will allow for, well, manual throttle control.

You are playing with real fuels right? The stock game for which MJ2 is made does not account for engines which are not fully throttelable. Put another way you're using mods which MJ2 was not designed to be used with. At this point in time the behaviour you describe is what comes out, whether or not MJ2 is changed in the future to account for such mods is unknown.

Link to comment
Share on other sites

I'm trying to compile the dev branch so I can offer some code suggestions, and I'm seeing compile errors that I don't quite understand.

Lines 413 through 421:

ModuleControlSurface cs = (pm as ModuleControlSurface);
…
Vector3 ctrlTroquePos = vessel.GetTransform().InverseTransformDirection(Vector3.Cross(partPosition, cs.getLiftVector(airSpeedRot * airSpeed)));
Vector3 ctrlTroqueNeg = vessel.GetTransform().InverseTransformDirection(Vector3.Cross(partPosition, cs.getLiftVector(Quaternion.Inverse(airSpeedRot) * airSpeed)));

The error message from Xamarin Studio is

MechJeb2/VesselState.cs(420,128): error CS1061: Type `ModuleControlSurface' does not contain a definition for `getLiftVector' and no extension method `getLiftVector' of type `ModuleControlSurface' could be found. Are you missing an assembly reference?

I have the Assembly-CSharp.dll, Assembly-CSharp-firstpass.dll, and UnityEngine.dll libraries from KSP 0.23 as references, and these are the only two build errors. If I stub out the lines, I can successfully build. I see in Assembly-CSharp library that the ModuleControlSurface class doesn't define getLiftVector at all, while the ControlSurface class does. Any ideas what's going on?

-Brian

Link to comment
Share on other sites

I'd like some help on compiling too.

I downloaded MechJeb2-master.zip and try to compile using the default Windows compiler v4.0 with this:

csc /r:UnityEngine.dll /r:Assembly-CSharp.dll /t:library /out:MechJeb2.dll alglib\*.cs Properties\*.cs *.cs

It compiles without any errors/warnings, but file size is 865k instead of almost 2M of release, and the game doesn't load it:

[ERR 11:30:53.222] AssemblyLoader: Exception loading 'MechJeb2': System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

http://pastebin.com/3aTwpaNH

I'm not a programmer (the code isn't hard to read, I think I know how to fix a couple of things), and compiling stuff is totally alien to me. Would be thankful for any help.

Link to comment
Share on other sites

I'd like some help on compiling too.

I downloaded MechJeb2-master.zip and try to compile using the default Windows compiler v4.0 with this:

csc /r:UnityEngine.dll /r:Assembly-CSharp.dll /t:library /out:MechJeb2.dll alglib\*.cs Properties\*.cs *.cs

It compiles without any errors/warnings, but file size is 865k instead of almost 2M of release, and the game doesn't load it:

[ERR 11:30:53.222] AssemblyLoader: Exception loading 'MechJeb2': System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.

http://pastebin.com/3aTwpaNH

I'm not a programmer (the code isn't hard to read, I think I know how to fix a couple of things), and compiling stuff is totally alien to me. Would be thankful for any help.

Use Visual Studios to compile with. Chances are you already have it; I think that's where csc.exe actually comes from.... target 3.5 framework should work.

Link to comment
Share on other sites

Hi, I reported an weird bug not long ago, on some probes mechjeb does not rotate probe then executing maneuverer nodes, accent, landing and docking work well.

Updated mechjeb to latest version and bug is still present. It only happens on probes not ships with an command module, even if ship is unmanned the pod prevents this.

Its not an problem all the time but comes and go, think its related to undocking probes like unmanned kethane miners from space stations. If I have this bug restarting KSP does not solve it.

If I rotates the ship towards the node mechjeb do timewarp and burn however it will not correct direction, ship behaves as if you do an manual burn with SAS turned off.

Weirder press R to enable rcs tend to solve this issue even if I have no RCS left but this don't help all the time.

Think I have had this issue all trough 0.23

I uses Kethane, extra planetary launchpads, KAS, engineer, hyperedit and a few part mods, all who are updated.

Link to comment
Share on other sites

The error message from Xamarin Studio is

MechJeb2/VesselState.cs(420,128): error CS1061: Type `ModuleControlSurface' does not contain a definition for `getLiftVector' and no extension method `getLiftVector' of type `ModuleControlSurface' could be found. Are you missing an assembly reference?

-Brian

Your project is missing the PartModuleExtensions.cs file.

Zyglrox : you need to compile for a .NET 3.5 target. The lower size is most likely that the resource are not included

And I don't know the command line for either of those.

Why don't you get VS 2013 or the Monodevellop shipped with Unity ? Both are free.

magnemoe : I'll need a example ship and/or a save to test that.

Link to comment
Share on other sites

Use Visual Studios to compile with. Chances are you already have it; I think that's where csc.exe actually comes from.... target 3.5 framework should work.
Zyglrox : you need to compile for a .NET 3.5 target. The lower size is most likely that the resource are not included

And I don't know the command line for either of those.

Why don't you get VS 2013 or the Monodevellop shipped with Unity ? Both are free.

Thank you! I had to install both Mono and VS (for "resgen"), and everything works fine now.

Link to comment
Share on other sites

In the Tracking Station, it lists the time as 11y, 11d, 17h, etc. If I turn on the Universal Time clock in MechJeb, it lists it as 10y, 10d, 17h, etc. The time of day is correct but the year and day are both one less than the Tracking Station shows. What gives? Which is correct? I’m guessing the tracking station starts at 1 and MechJeb starts at 0. Maybe the two should be in sync?

Link to comment
Share on other sites

Your project is missing the PartModuleExtensions.cs file.

Ahha! I missed that a new file was added. Thanks!

I've been able to build and test a couple of new maneuver planning modes. One to adjust the SMA directly, another to adjust the LAN.

I'm also refactoring a third mode to place the vessel at a specific altitude over a specific longitude at a apside node. I've got all the math worked out, I'm just trying to figure out the best way to present the maneuver.

-Brian

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...