Janty, thank you very much for the video, what a great explanation. Are you using Xsens IMU? May I ask you a couple of questions about data interpretation?
Hi, I use the same filter to process the data. I want get the trajectory from these data. But the result of trajectory is not good. Can you help me about that?
Hello, the example data given, in what units were the acceleration and angular velocity given? the Accelerations seem to be in meters per second squared, but the X-axis seems to have the bulk of the gravity values. Perhaps this is because the IMU was strapped with the x-axis aligned to gravity axis (vertical)?
Hi Emma. I just want to make sure I understand your question; do you mean where it says "thetaX{s}(a) = hpf*thetaX{s}(a)*dt + thetaX_acc{s}(a);" that the "hpf*thetaX{s}(a)*dt" term should be "hpf*gyr_x{s}(a)*dt" (and likewise for the Y and Z terms)? If this is what you're asking, I think the way I have it is fine. In order to "integrate" the gyroscope data, we have to multiply each gyroscope datapoint by "dt" (the time between two consecutive datapoints). Doing this multiplication (i.e "gyr{s}(a)*dt" in the code) gives us the change in angle between one datapoint and the subsequent datapoint. Therefore, to get the current orientation, we need to add this product to the angle as determined previously, which would be the "theta{s}(a-1)" term in the code. The "a-1" index refers to the previous angle. For the a == 1 part of the loop, the "a-1" term would result in an index of zero, which would make the script fail. So, for the first loop, since there's no previous angle to add to, I skip the gyroscope data. It's been a long time since I've written or used this code, so tbh, I'm not sure why I didn't just start the loop at a = 2 and let theta{s}(1) = 0. It seems like that'd work too. Was any of this helpful? lol This stuff is kinda hard to explain via text.
Hello, I’ll do my best to explain. Considering the diagram shown at 13:34 in the video, we are trying to define theta_z as the angle from the x-axis to the projection of the vector “a” in the XY plane. I solve for theta_z using the law of sines. Note that we can define theta_z in terms of arcsin or arctan; both give equivalent values for theta_z, but the arctan equation is slightly simpler in my opinion. Also note, that we determine theta_x (angle in the YZ plane) and theta_y (angle in the XZ plane) using a similar process. I hope this helps!
I find there are a lot of ways to calculate gyro data through acc data. You can check this article "Angle Estimation of Simultaneous Orthogonal Rotations from 3D Gyroscope Measurements" which provides another method. I do not know whether I am right or wrong.
My understanding of that article is that they developed a more computationally efficient way to determine angular orientation from gyroscope measurements under the condition that the "angular velocities or their proportions are approximately constant". The algorithm they describe would probably be more useful in calculating angular orientation in real-time. The calculation I describe in the video would not be suitable for real-time analysis (due to computation time), and would be more applicable in post-hoc data analysis. If you are concerned with real-time applications, there seems to be many proposed algorithms for determining angular orientation in real-time besides the one in the article you recommended. I suggest exploring the literature further, and choosing an algorithm that is most appropriate for your application.