NASSP
NASSP copied to clipboard
CSM VC Viewpoint bug
Here is the issue: The CSM VC viewpoint moves when docked with the LM. I did some testing, and found that it happens in earth orbit, and a little bit in lunar orbit. Seems like it has something to do with angular accelerations… It only happens when docked with the LM, as soon as I undock the viewpoint jumps back to where it should be.
Absolute Animation Handling is turned on in D3D9 settings.
I'm looking a bit into this now. It seems the code that simulates vibrations during launch and maneuver might be responsible. The way it calculates the acceleration acting on the CSM is different from how our accelerometers do it. There seems to be an issue with the force vector returned by Orbiter for docked vehicles. That would explain why it only really happens with CSM+LM docked.
@ggalfi do you want to take a look at this? For testing I let it display the vector vAccel, in Earth orbit with CSM+LM docked.
Ok, I see now the problem. I think Orbitersim uses some constraint forces to compensate the slightly differing gravitational acceleration of the connected vessels. I think the easiest thing would be to calculate vAccel in the same way as it was done for the PIPAs. My only concern is that doing that doing exactly the same calculation twice (once for the IMU, once for the vibration) is not the nicest thing I could imagine, but anyway it should work.
That calculation is in a few more places actually. LV IMU, EMS, G meter in the CSM, T/W meter in the LM, AGS accelerometer.
What might be good is to implement a common class that each vessel can use that calculates the proper acceleration of the vehicle. And then each system that simulates an accelerometer can access that acceleration which only gets calculated once per vessle. But looking at all the accelerometer code we have, it's everywhere slightly different and not everywhere does it use it in the local vessel coordinates. IMU for example directly converts the acceleration from inertial (ecliptic) coordinates to stable member coordinates. So that is quite annoying to find a system that works for all of them...
Have we solved this?
Merging this PR: https://github.com/orbiternassp/NASSP/pull/811 should have solved the issue. I tested it even during Apollo 9's docked DPS burn, and as the acceleration comes from nearly in -X direction (from CSM viewpoint), the COAS remained centered.