-
Notifications
You must be signed in to change notification settings - Fork 340
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
Gyro data question #81
Comments
I should say in advance I probably don't understand what I'm saying, so be careful and think for yourself. I think the reason is the following: What is being computed here is offset to the flow based on gyro data. Assuming the camera is stationary, if we rotate it along X axis, the image from camera would move along Y axis, as if the camera moved along Y axis horizontally. This is exactly why X-s and Y-s get swapped like that. Similar effect for rotating along Y axis - it results in the camera image looking as if it moves along the X axis. The minus sign appears because... well... it's hard to explain without a drawing... Side note: rotation along Z axis would not move the image at all, and instead would rotate the image, so I think that one will be treated completely differently in the code. |
Also, according to szobov@7aa3516 |
The cited code in main.c might just be a hardware transform (maybe the sensor is physically rotated against the printed coordinate axis on the px4flow pcb). So that snippet makes sure that x_rate and y_rate correspond with the printed axis. If that is the case then the sign switch in the commit of szobov might not be correct. Because we need exactly the transform that mike239x explained to match the rates with the flow values. It might be confusing to see the same transformation twice. To verify that we would need to know the actual coordinate axis of the gyro sensor. It could be that during the design of the pcb the sensor was mounted such that the rate readings of the sensor could be directly used for compensation. |
Dear experts,
I have a question regarding the gyro data manipulation in the main.c line 407:
I do not understand why x and y data is assign in reverse. I thought that even if the gyro is in up down direction when using the board but y direction also points to the front, so why does y data is assigned to x_rate? please clarify me. Thanks!
The text was updated successfully, but these errors were encountered: