Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Child transforms move on load flight state with RSS #1421

Closed
NathanKell opened this issue Jun 1, 2017 · 17 comments
Closed

Child transforms move on load flight state with RSS #1421

NathanKell opened this issue Jun 1, 2017 · 17 comments
Assignees
Labels
Milestone

Comments

@NathanKell
Copy link

This (a) may be a duplicate of the Proc SRB Bell issue, if that's been reported, and (b) may be an issue, albeit smaller, with stock size systems (why would I touch stock, so I don't know).

On load to flight state (say, spawning a rocket, either from the VAB or via KCT), small child transforms of parts are offset. The test case here, as repeatedly demonstrated in the stream I just completed, is the ModuleJettison'd decoupler structure on the SXT Stayputnik core (in RP-0, the 20in X-Ray satellite). That transform is offset about 0.4m to the side (X axis) of where it should be. It is reproducible every launch.

@eggrobin
Copy link
Member

eggrobin commented Jun 1, 2017

I have no idea what is going on here; it might be related to #1404 and similar bugs, because unless we manage the vessel we shouldn't be doing things to its parts; it might be #1404, or it might be yet another condition under which the vessel should be unmanageable. I guess I might need to make an RSS install.
Do any stock parts have child transforms? If that's not the case there might also be something broken in the way we handle children (though there still has to be a separate manageability issue, because we should really not be touching the vessel until it leaves the @ferram4 sector).

@eggrobin eggrobin added the bug label Jun 1, 2017
@eggrobin eggrobin self-assigned this Jun 1, 2017
@NathanKell
Copy link
Author

NathanKell commented Jun 1, 2017 via email

@eggrobin
Copy link
Member

eggrobin commented Jun 1, 2017

Well, we rotate the planets and tilt the universe... :-)
So setting rotationPeriod, initialRotation, and BodyFrame.
We have code that moves individual vessels, but that is done only to manageable vessels.
If your vessel was briefly manageable you should see it in your logs: make a vessel with a unique name (so you can identify it in the logs), send it to the pad, see the bug you reported, exit the game, look at the INFO log and see whether the name of that vessel is mentioned; if it is, there is a manageability issue.

@eggrobin
Copy link
Member

eggrobin commented Jun 1, 2017

Specifically, a vessel is mentioned when it is found unmanageable after having been managed, and the reason for the newfound unmanageability is given, so that log makes mismanagement of manageability quite obvious.

@NathanKell
Copy link
Author

Ok, gonna try making a weird-named vessel, launching, and posting log.

@NathanKell
Copy link
Author

Ok. I turned on journalling and increased stderr to max so INFO goes there too, then clicked VAB, built craft, launched, alt-F4'd. I don't see any mention of the craft in the log.

https://hastebin.com/sewofuyibo.css

@eggrobin
Copy link
Member

eggrobin commented Jun 2, 2017

Hmm; it's not a manageability issue then. Curiouser and curiouser!
FYI, journalling is a separate thing from logging, it does not log to stderr or the INFO/WARNING/ERROR/FATAL files, but writes to the JOURNAL files instead (you should have a fairly large file there in your glog\Principia directory). It is used for automatically replaying the C++ side of things.

@eggrobin
Copy link
Member

eggrobin commented Jun 3, 2017

Interestingly, launching, crashing, then reverting to launch fixes the transforms (both on the satellite and on the SRB bell).

@eggrobin
Copy link
Member

eggrobin commented Jun 3, 2017

Update: A lot of stuff happens between OnStart and OnStartFinished, so this might be a clue (perhaps we should wait for a bit when things start)?
Log stripped to include only Principia lifecycle and Procedural SRB OnStart/OnStartFinished:

[LOG 17:18:36.273] Procedural SRB >>>>>>>>>>>> OnStart
[LOG 17:18:36.396] ReportVesselsAndParts
[LOG 17:18:36.440] Principia WaitForFixedUpdate

[LOG 17:18:36.441] DisableVesselPrecalculate
[LOG 17:18:36.442] SetBodyFramesAndPrecalculateVessels
[LOG 17:18:36.444] UpdateVesselOrbits
[LOG 17:18:36.444] Principia FixedUpdate
[LOG 17:18:36.460] ReportVesselsAndParts
[LOG 17:18:36.463] Principia WaitForFixedUpdate

[LOG 17:18:40.208] DisableVesselPrecalculate
[LOG 17:18:40.209] SetBodyFramesAndPrecalculateVessels
[LOG 17:18:40.211] UpdateVesselOrbits
[LOG 17:18:40.217] Principia FixedUpdate
[LOG 17:18:40.238] ReportVesselsAndParts
[LOG 17:18:40.240] Principia WaitForFixedUpdate

[LOG 17:18:40.281] Procedural SRB >>>>>>>>>>>> OnStartFinished

@eggrobin
Copy link
Member

eggrobin commented Jun 3, 2017

More incomprehensible update: now tracking the FlightGlobals readiness, looking at both launch from VAB and revert to launch.
Launch:

[LOG 00:17:11.737] Principia FlightGlobals: False
[LOG 00:17:11.738] Principia UpdateVesselOrbits
[LOG 00:17:11.739] Principia Principia FixedUpdate
[LOG 00:17:11.739] Principia ReportVesselsAndParts
[LOG 00:17:11.740] Principia Principia WaitForFixedUpdate
[LOG 00:17:22.203] Principia DisableVesselPrecalculate
[LOG 00:17:22.204] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:17:22.204] Principia FlightGlobals: False
[LOG 00:17:22.208] Principia UpdateVesselOrbits
[LOG 00:17:22.305] Principia Principia FixedUpdate
[LOG 00:17:22.606] Procedural SRB >>>>>>>>>>>> OnStart
[LOG 00:17:22.693] Principia ReportVesselsAndParts
[LOG 00:17:22.724] Principia Principia WaitForFixedUpdate
[LOG 00:17:22.725] Principia DisableVesselPrecalculate
[LOG 00:17:22.726] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:17:22.726] Principia FlightGlobals: True
[LOG 00:17:22.727] Principia UpdateVesselOrbits
[LOG 00:17:22.728] Principia Principia FixedUpdate
[LOG 00:17:22.763] Principia ReportVesselsAndParts
[LOG 00:17:22.768] Principia Principia WaitForFixedUpdate
[LOG 00:17:26.381] Principia DisableVesselPrecalculate
[LOG 00:17:26.382] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:17:26.382] Principia FlightGlobals: True
[LOG 00:17:26.385] Principia UpdateVesselOrbits
[LOG 00:17:26.387] Principia Principia FixedUpdate
[LOG 00:17:26.388] Principia ReportVesselsAndParts
[LOG 00:17:26.391] Principia Principia WaitForFixedUpdate
[LOG 00:17:26.426] Procedural SRB >>>>>>>>>>>> OnStartFinished
[LOG 00:17:26.458] Principia DisableVesselPrecalculate
[LOG 00:17:26.459] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:17:26.459] Principia FlightGlobals: True
[LOG 00:17:26.461] Principia UpdateVesselOrbits
[LOG 00:17:26.463] Principia Principia FixedUpdate
[LOG 00:17:26.465] Principia ReportVesselsAndParts
[LOG 00:17:26.469] Principia Principia WaitForFixedUpdate
[LOG 00:17:26.469] Principia DisableVesselPrecalculate
[LOG 00:17:26.470] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:17:26.471] Principia FlightGlobals: True

Revert:

[LOG 00:18:17.917] Principia Principia FixedUpdate
[LOG 00:18:17.918] Principia ReportVesselsAndParts
[LOG 00:18:17.919] Principia Principia WaitForFixedUpdate
[LOG 00:18:17.919] Principia DisableVesselPrecalculate
[LOG 00:18:17.920] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:18:17.920] Principia FlightGlobals: True
[LOG 00:18:17.921] Principia UpdateVesselOrbits
[LOG 00:18:17.922] Principia Principia FixedUpdate
[LOG 00:18:17.923] Principia ReportVesselsAndParts
[LOG 00:18:17.923] Principia Principia WaitForFixedUpdate
[LOG 00:18:29.083] Procedural SRB >>>>>>>>>>>> OnStart
[LOG 00:18:30.094] Principia DisableVesselPrecalculate
[LOG 00:18:30.094] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:18:30.095] Principia FlightGlobals: False
[LOG 00:18:30.099] Principia UpdateVesselOrbits
[LOG 00:18:30.206] Principia Principia FixedUpdate
[LOG 00:18:30.443] Principia ReportVesselsAndParts
[LOG 00:18:30.446] Principia Principia WaitForFixedUpdate
[LOG 00:18:30.591] Procedural SRB >>>>>>>>>>>> OnStartFinished
[LOG 00:18:30.658] Principia DisableVesselPrecalculate
[LOG 00:18:30.659] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:18:30.659] Principia FlightGlobals: True
[LOG 00:18:30.661] Principia UpdateVesselOrbits
[LOG 00:18:30.663] Principia Principia FixedUpdate
[LOG 00:18:30.664] Principia ReportVesselsAndParts
[LOG 00:18:30.668] Principia Principia WaitForFixedUpdate
[LOG 00:18:30.668] Principia DisableVesselPrecalculate
[LOG 00:18:30.669] Principia SetBodyFramesAndPrecalculateVessels
[LOG 00:18:30.670] Principia FlightGlobals: True

I have no idea.

@eggrobin
Copy link
Member

eggrobin commented Jun 4, 2017

More logging:

[LOG 02:40:08.721] Principia ActiveVessel state:
[LOG 02:40:08.721] Principia ActiveVessel situation:
[LOG 02:40:08.722] Principia ActiveVessel enabled:
[LOG 02:40:08.722] Principia ActiveVessel orbitDriver mode:
[LOG 02:40:08.723] Principia ActiveVessel orbitDriver last mode:
[LOG 02:40:08.724] Principia UpdateVesselOrbits
[LOG 02:40:08.725] Principia Principia FixedUpdate
[LOG 02:40:08.725] Principia ReportVesselsAndParts
[LOG 02:40:08.726] Principia Principia WaitForFixedUpdate
[LOG 02:40:19.808] Principia DisableVesselPrecalculate
[LOG 02:40:19.809] Principia ActiveVessel precalc enabled: True
[LOG 02:40:19.809] Principia SetBodyFramesAndPrecalculateVessels
[LOG 02:40:19.810] Principia FlightGlobals readiness: False
[LOG 02:40:19.811] Principia ActiveVessel state: ACTIVE
[LOG 02:40:19.811] Principia ActiveVessel situation: PRELAUNCH
[LOG 02:40:19.812] Principia ActiveVessel enabled: True
[LOG 02:40:19.812] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 02:40:19.813] Principia ActiveVessel orbitDriver last mode: TRACK_Phys
[LOG 02:40:19.818] Principia UpdateVesselOrbits
[LOG 02:40:19.965] Principia Principia FixedUpdate
[LOG 02:40:20.376] Procedural SRB >>>>>>>>>>>> OnStart
[LOG 02:40:20.493] Principia ReportVesselsAndParts
[LOG 02:40:20.539] Principia Principia WaitForFixedUpdate
[LOG 02:40:24.548] Principia DisableVesselPrecalculate
[LOG 02:40:24.549] Principia ActiveVessel precalc enabled: True
[LOG 02:40:24.549] Principia SetBodyFramesAndPrecalculateVessels
[LOG 02:40:24.550] Principia FlightGlobals readiness: True
[LOG 02:40:24.550] Principia ActiveVessel state: ACTIVE
[LOG 02:40:24.551] Principia ActiveVessel situation: PRELAUNCH
[LOG 02:40:24.551] Principia ActiveVessel enabled: True
[LOG 02:40:24.552] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 02:40:24.552] Principia ActiveVessel orbitDriver last mode: TRACK_Phys
[LOG 02:40:24.555] Principia UpdateVesselOrbits
[LOG 02:40:24.561] Principia Principia FixedUpdate
[LOG 02:40:24.605] Principia ReportVesselsAndParts
[LOG 02:40:24.610] Principia Principia WaitForFixedUpdate
[LOG 02:40:24.751] Procedural SRB >>>>>>>>>>>> OnStartFinished
[LOG 02:40:24.899] Principia DisableVesselPrecalculate
[LOG 02:40:24.900] Principia ActiveVessel precalc enabled: True
[LOG 02:40:24.901] Principia SetBodyFramesAndPrecalculateVessels
[LOG 02:40:24.902] Principia FlightGlobals readiness: True
[LOG 02:40:24.903] Principia ActiveVessel state: ACTIVE
[LOG 02:40:24.903] Principia ActiveVessel situation: PRELAUNCH
[LOG 02:40:24.904] Principia ActiveVessel enabled: True
[LOG 02:40:24.904] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 02:40:24.905] Principia ActiveVessel orbitDriver last mode: IDLE
[LOG 02:40:24.909] Principia UpdateVesselOrbits
[LOG 02:40:24.911] Principia Principia FixedUpdate
[LOG 02:40:24.938] Principia ReportVesselsAndParts
[LOG 02:40:24.992] Principia Principia WaitForFixedUpdate
[LOG 02:40:24.993] Principia DisableVesselPrecalculate
[LOG 02:40:24.994] Principia ActiveVessel precalc enabled: True
[LOG 02:40:24.995] Principia SetBodyFramesAndPrecalculateVessels
[LOG 02:40:24.996] Principia FlightGlobals readiness: True
[LOG 02:40:24.996] Principia ActiveVessel state: ACTIVE
[LOG 02:40:24.997] Principia ActiveVessel situation: PRELAUNCH
[LOG 02:40:24.998] Principia ActiveVessel enabled: True

TODO(egg): what if we disable ourselves if mode is IDLE and last mode is TRACK_Phys? (and probably some of the other things so that we don't false positive)

@NathanKell
Copy link
Author

I do similar stuff in precalc for physics easing (rather, that's the signal to begin physics easing).
Oh, hang on. What do you do with physics easing?

@eggrobin
Copy link
Member

eggrobin commented Jun 4, 2017

I do nothing with easing, why?

@NathanKell
Copy link
Author

NathanKell commented Jun 4, 2017 via email

@eggrobin
Copy link
Member

eggrobin commented Jun 4, 2017

The bug is reproducible with physics easing disabled.

@eggrobin
Copy link
Member

eggrobin commented Jun 4, 2017

Skipping Principia's AdvanceTime and SetBodyFrames when the active vessel is in PRELAUNCH with last mode TRACK_Phys and mode IDLE seems to do the job (we skip two frames).
Logs:

[LOG 15:17:58.876] Principia DisableVesselPrecalculate
[LOG 15:17:58.876] Principia ActiveVessel precalc enabled:
[LOG 15:17:58.877] Principia SetBodyFramesAndPrecalculateVessels
[LOG 15:17:58.877] Principia FlightGlobals readiness: False
[LOG 15:17:58.878] Principia ActiveVessel state:
[LOG 15:17:58.878] Principia ActiveVessel situation:
[LOG 15:17:58.879] Principia ActiveVessel enabled:
[LOG 15:17:58.879] Principia ActiveVessel orbitDriver mode:
[LOG 15:17:58.880] Principia ActiveVessel orbitDriver last mode:
[LOG 15:17:58.881] Principia UpdateVesselOrbits
[LOG 15:17:58.881] Principia Principia FixedUpdate
[LOG 15:17:58.882] Principia ReportVesselsAndParts
[LOG 15:17:58.883] Principia Principia WaitForFixedUpdate
[LOG 15:18:09.977] Principia DisableVesselPrecalculate
[LOG 15:18:09.977] Principia ActiveVessel precalc enabled: True
[LOG 15:18:09.978] Principia SetBodyFramesAndPrecalculateVessels
[LOG 15:18:09.979] Principia FlightGlobals readiness: False
[LOG 15:18:09.979] Principia ActiveVessel state: ACTIVE
[LOG 15:18:09.980] Principia ActiveVessel situation: PRELAUNCH
[LOG 15:18:09.980] Principia ActiveVessel enabled: True
[LOG 15:18:09.981] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 15:18:09.982] Principia ActiveVessel orbitDriver last mode: TRACK_Phys
[LOG 15:18:09.983] Principia >>>SKIPPING<<< AdvanceTime and SetBodyFrames
[LOG 15:18:09.985] Principia UpdateVesselOrbits
[LOG 15:18:10.147] Principia Principia FixedUpdate
[LOG 15:18:10.598] Procedural SRB >>>>>>>>>>>> OnStart
[LOG 15:18:10.719] Principia ReportVesselsAndParts
[LOG 15:18:10.763] Principia Principia WaitForFixedUpdate
[LOG 15:18:10.764] Principia DisableVesselPrecalculate
[LOG 15:18:10.764] Principia ActiveVessel precalc enabled: True
[LOG 15:18:10.766] Principia SetBodyFramesAndPrecalculateVessels
[LOG 15:18:10.766] Principia FlightGlobals readiness: True
[LOG 15:18:10.767] Principia ActiveVessel state: ACTIVE
[LOG 15:18:10.767] Principia ActiveVessel situation: PRELAUNCH
[LOG 15:18:10.768] Principia ActiveVessel enabled: True
[LOG 15:18:10.768] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 15:18:10.769] Principia ActiveVessel orbitDriver last mode: TRACK_Phys
[LOG 15:18:10.769] Principia >>>SKIPPING<<< AdvanceTime and SetBodyFrames
[LOG 15:18:10.771] Principia UpdateVesselOrbits
[LOG 15:18:10.772] Principia Principia FixedUpdate
[LOG 15:18:10.788] Principia ReportVesselsAndParts
[LOG 15:18:10.789] Principia Principia WaitForFixedUpdate
[LOG 15:18:14.647] Principia DisableVesselPrecalculate
[LOG 15:18:14.647] Principia ActiveVessel precalc enabled: True
[LOG 15:18:14.648] Principia SetBodyFramesAndPrecalculateVessels
[LOG 15:18:14.648] Principia FlightGlobals readiness: True
[LOG 15:18:14.649] Principia ActiveVessel state: ACTIVE
[LOG 15:18:14.649] Principia ActiveVessel situation: PRELAUNCH
[LOG 15:18:14.650] Principia ActiveVessel enabled: True
[LOG 15:18:14.650] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 15:18:14.651] Principia ActiveVessel orbitDriver last mode: IDLE
[LOG 15:18:14.653] Principia UpdateVesselOrbits
[LOG 15:18:14.659] Principia Principia FixedUpdate
[LOG 15:18:14.680] Principia ReportVesselsAndParts
[LOG 15:18:14.714] Principia Principia WaitForFixedUpdate
[LOG 15:18:14.758] Procedural SRB >>>>>>>>>>>> OnStartFinished
[LOG 15:18:14.942] Principia DisableVesselPrecalculate
[LOG 15:18:14.942] Principia ActiveVessel precalc enabled: True
[LOG 15:18:14.943] Principia SetBodyFramesAndPrecalculateVessels
[LOG 15:18:14.944] Principia FlightGlobals readiness: True
[LOG 15:18:14.944] Principia ActiveVessel state: ACTIVE
[LOG 15:18:14.945] Principia ActiveVessel situation: PRELAUNCH
[LOG 15:18:14.945] Principia ActiveVessel enabled: True
[LOG 15:18:14.945] Principia ActiveVessel orbitDriver mode: IDLE
[LOG 15:18:14.946] Principia ActiveVessel orbitDriver last mode: IDLE
[LOG 15:18:14.947] Principia UpdateVesselOrbits
[LOG 15:18:14.949] Principia Principia FixedUpdate
[LOG 15:18:14.972] Principia ReportVesselsAndParts
[LOG 15:18:15.016] Principia Principia WaitForFixedUpdate

@NathanKell
Copy link
Author

Awesome work guys! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants