MechJeb2

MechJeb2

4M Downloads

MechJeb can't autopilot "non active" vessels.

jrodrigv opened this issue ยท 5 comments

commented

So as the title says,

Currently, if you try to engage autopilot for Ascent Guidance and then you switch to a different vessel. Mechjeb will not be able to continue the autopilot successfully, it will fail to stage the vessel, etc.

The same happens when executing deorbit burns.

I have seen on the logs that some NREs are thrown when trying these scenarios, as soon as a switch to a different vessel

LOG 19:02:02.768] [PlanetariumCamera]: Focus: BDA - TestPlaneAI - v3
[LOG 19:02:02.772] Camera Mode: AUTO
[LOG 19:02:02.777] [BDArmory] : Vessel switched to vessel with targeting camera. Refreshing camera state.
[ERR 19:02:11.863] MechJeb module MechJebModuleAscentAutopilot threw an exception in Drive: System.NullReferenceException: Object reference not set to an instance of an object
at MuMech.DefaultAscentPath.get_autoTurnEndAltitude () [0x00000] in :0
at MuMech.DefaultAscentPath.FlightPathAngle (Double altitude, Double velocity) [0x00000] in :0
at MuMech.MechJebModuleAscentAutopilot.DriveGravityTurn (.FlightCtrlState s) [0x00000] in :0
at MuMech.MechJebModuleAscentAutopilot.Drive (.FlightCtrlState s) [0x00000] in :0
at MuMech.MechJebCore.Drive (.FlightCtrlState s) [0x00000] in :0

commented

this may be closed by #904

commented

@lamont-granquist May I use some of your dev pre-releases to test this fixes?

Thanks

commented

https://github.com/lamont-granquist/MechJeb2/releases/tag/peg-testing15 but its for KSP 1.2.2, otherwise just wait until sarbian whacks merge on #904

commented

anyway all the ascent autopilot stuff are now proper mechjeb modules (the AscentAutopilot was not before) and all the references to FlightGlobals were scrubbed in favor of using the vessel from the ComputerModule base class, which should have cleaned up the architectural problems that created this issue. dunno if there's still other bugs lurking around but the framework is a lot healthier.

commented

hoping i fixed this a long time ago, anyway need a current bug report if its still buggy...