neuoy / KSPTrajectories

A Kerbal Space Program mod to display trajectory predictions, accounting for atmospheric drag, lift, etc.
GNU General Public License v3.0
144 stars 47 forks source link

Logspam and lag when calculating trajectory for an EVA Kerbal #181

Open fat-lobyte opened 3 years ago

fat-lobyte commented 3 years ago

Steps to reproduce:

  1. Launch Kerbals into the air with any method
  2. Perform an EVA
  3. Enable Trajectories

Observe the following logspam:

[LOG 14:52:50.130] CheckEncounter: both intercept UTs are infinite
[LOG 14:52:50.131] CheckEncounter: both intercept UTs are infinite
[LOG 14:52:50.132] dT is NaN! tA: NaN, E: NaN, M: NaN, T: NaN
  at System.Environment.get_StackTrace () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at Orbit.GetDTforTrueAnomaly (System.Double tA, System.Double wrapAfterSeconds) [0x00000] in <a1ca58b5ca7140639de29a81de5e3f32>:0 
  at PatchedConics._CalculatePatch (Orbit p, Orbit nextPatch, System.Double startEpoch, PatchedConics+SolverParameters pars, CelestialBody targetBody) [0x00000] in <a1ca58b5ca7140639de29a81de5e3f32>:0 
  at Trajectories.Trajectory.CreateOrbitFromState (Trajectories.Trajectory+VesselState state) [0x0003d] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:475 
  at Trajectories.Trajectory+<AddPatch>d__48.MoveNext () [0x0006b] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:586 
  at Trajectories.Trajectory+<ComputeTrajectoryIncrement>d__39.MoveNext () [0x001bc] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:432 
  at Trajectories.Trajectory.ComputeTrajectory () [0x000bc] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:368 
  at Trajectories.Trajectory.Update () [0x00057] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:162 
  at Trajectories.Trajectories.Update () [0x0003a] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectories.cs:102 
[LOG 14:52:50.133] dT is NaN! tA: NaN, E: NaN, M: NaN, T: NaN
  at System.Environment.get_StackTrace () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 
  at Orbit.GetDTforTrueAnomaly (System.Double tA, System.Double wrapAfterSeconds) [0x00000] in <a1ca58b5ca7140639de29a81de5e3f32>:0 
  at PatchedConics._CalculatePatch (Orbit p, Orbit nextPatch, System.Double startEpoch, PatchedConics+SolverParameters pars, CelestialBody targetBody) [0x00000] in <a1ca58b5ca7140639de29a81de5e3f32>:0 
  at Trajectories.Trajectory.CreateOrbitFromState (Trajectories.Trajectory+VesselState state) [0x0003d] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:475 
  at Trajectories.Trajectory+<AddPatch>d__48.MoveNext () [0x0006b] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:586 
  at Trajectories.Trajectory+<ComputeTrajectoryIncrement>d__39.MoveNext () [0x001bc] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:432 
  at Trajectories.Trajectory.ComputeTrajectory () [0x000bc] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:368 
  at Trajectories.Trajectory.Update () [0x00057] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectory.cs:162 
  at Trajectories.Trajectories.Update () [0x0003a] in C:\Users\alexander\Documents\GitHub\KSPTrajectories\src\Plugin\Trajectories.cs:102 
[EXC 14:52:50.148] NullReferenceException: Object reference not set to an instance of an object
    Trajectories.Trajectory.RealMaxAtmosphereAltitude (CelestialBody body) (at C:/Users/alexander/Documents/GitHub/KSPTrajectories/src/Plugin/Trajectory.cs:461)
    Trajectories.Trajectory+<AddPatch>d__48.MoveNext () (at C:/Users/alexander/Documents/GitHub/KSPTrajectories/src/Plugin/Trajectory.cs:629)
    Trajectories.Trajectory+<ComputeTrajectoryIncrement>d__39.MoveNext () (at C:/Users/alexander/Documents/GitHub/KSPTrajectories/src/Plugin/Trajectory.cs:432)
    Trajectories.Trajectory.ComputeTrajectory () (at C:/Users/alexander/Documents/GitHub/KSPTrajectories/src/Plugin/Trajectory.cs:395)
    Trajectories.Trajectory.Update () (at C:/Users/alexander/Documents/GitHub/KSPTrajectories/src/Plugin/Trajectory.cs:162)
    Trajectories.Trajectories.Update () (at C:/Users/alexander/Documents/GitHub/KSPTrajectories/src/Plugin/Trajectories.cs:102)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[LOG 14:52:50.182] CheckEncounter: both intercept UTs are infinite
[LOG 14:52:50.183] CheckEncounter: both intercept UTs are infinite

KSP Version: 1.12.0 Trajectories Version: 2.4.0, current master

The oldest version that I have tested was KSP 1.8.1 and Trajectories 2.3.0 which also exhibit this bug.

fat-lobyte commented 3 years ago

Note to self, potentially related: