On a current project I'm using recorded X-Plane data to fit a model so that I can predict new states from previous state actions pairs. In this problem I am required to integrate the angular and linear velocities to recover angular and linear positions.
One thing I've noticed is that there appear to be some contradictions between the pitch rate of change and the actual pitch datarefs that I'm currently using for the recordings. In the picture below the blue lines are the actual pitch rate (sim/flightmodel/position/Q) and the actual pitch (sim/flightmodel/position/theta). The orange line is the integrated pitch rate which should be similar to the actual pitch. As you can see around 183 the on the X axis the pitch rate is now positive however the pitch is still decreasing. So I think I'm missing something here.
I have a couple of theories. I'm thinking that there might be a frame of reference mismatch such that the Q and the theta might be calculated in different reference frames (relative to flight vs relative to something else) which would require some sort of frame conversion before integration or maybe just using different datarefs. The second is that maybe there is some momentum values I'm missing from my integrations steps which seems less likely.
I was wondering if anyone had any experience with this and could provide some more insight.