I am looking at IMU from the logs (in the body frame) and trying to convert them to values in the inertial/earth/static frame. When I do this with thrust it works as expected (according to image) but if I do this with acceleration it gives me the wrong signs in the inertial frame (i.e. contrary to image). A couple of questions:
Are the body frame and inertial frame correct (could they be) as I have drawn them below?
The frames make more sense (i.e. are pointing the same when looking North) if you rotate the body frame 180 degrees around its Z-axis. Could it be that my drone is configured poorly in a way that the drone is constantly flying backwards instead of forwards when sending throttle and pitching “forward”? On that same note, in https://plot.ardupilot.org/, are the green and red rotors indicative of direction or is it just there for no reason?
How come that my thrust conversion goes well but my acceleration conversion (via the same R matrix) does not?
I hope this is clear. If it helps, let me know and I’ll upload the log file I am using to check this. I am using a Foxtech Hover 1 drone with an orange cube ap.
Where do you find this pitch setting? Is it under config and then joystick? Then I can check. I don’t suspect that should be the problem as pitch already behaves as expected (when flying away from you: pitch back = pitch up = positive which is seen in the image for positive \theta). So the roll conventions are fine (but the linear directions are not).
On the other hand: I guess if I were to change the pitch RC channel as well as the roll RC channel, that I could use the back of my drone as the front (which would align the body and inertial coordinate systems), right? The reason we did not do this is so far is because the drone’s front two rotors are now red (and the back two rotors are green), which I believe is how it is supposed to be as well, correct?
It is just too big too upload directly, so here it is in a google drive link. Again, what I am confused about is that the ax and ay seem to have a sign convention leading to an odd inertial coordinate system (south west down) when I use the rotation matrix as below: