-
Notifications
You must be signed in to change notification settings - Fork 226
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
Code's equation not same with the paper #74
Comments
@milkcoffee365, it seems suspicious indeed because we know that Thus, I would expect a subtraction instead of an addition. Line 219 seems fine due to the transformations that happen in previous lines. |
@milkcoffee365 Was this ever sorted out? |
@milkcoffee365 , @paaraujo , @scott81321 First say my conclusion, line 221 should be: Below are some derivations: Assume R_c_n and p_c_n are the rotation and displacement of vehicle-frame relative to imu-frame, which are RESOLVED in the imu-frame at time instant n. To make derivation easy, let's reference to the world-frame When referenced to the world-frame, Then based on the extrinsic between vehicle and imu, the vehicle-frame's velocity v in the world frame would be: Then the vehicle-frame's velocity in the vehicle-frame would be: In the above equation derivation, we use the property of skew(Rw) = Rskew(w)*transpose(R) and w_n x p_c_n = skew(w_n) * p_c_n. skew(.) is used to transform a vector into a skew symmetric matrix. So in summary, in the equation (14), the authors missed the multiplication of matrix transpose(R_c_n) before (w_n x p_c_n) |
Fyi, the arxiv preprint is different from the published IEEE version where this is fixed. The measurement Jacobians are also different. |
@vkorotkine Are you saying their published IEEE paper has the correction mentioned by @robocar2018 ? If so, please show us clips of the where the IEEE paper differs from the arxiv version. I cannot access the IEEE paper, only the HAL and arxiv versions. I would be surprised that the code would not implement exactly what is presumably in the IEEE paper including later fixes (?) |
@vkorotkine , thanks for your reminder. @scott81321 , Vkorotkine is correct, the IEEE version fixed the error. Furthermore, the measurement matrix H in the IEEE version is also fixed. |
@vkorotkine You're right. I see the change in the paper in terms of bracketing. This is cause for concern because it means ai-imu-dr code, at least for that eq. 14, does not match the paper. Mind you, this fix does not solve my current test problem. That 2nd term is a small contribution, for my case anyway. Now, you mention changes in the Jacobians. I see a discrepancy for the 'B' term below eq. 37 pertaining to H_n in eq. 37. If I am not mistaken, in the code in utils_numpy_filter, Jacobian w.r.t. car frame
The 'B' in the paper looks rather different. There is an additional term. Anything else? |
@scott81321 , here is the result of my derivation for the H Basically, B in the IEEE paper's looks to be a typo and hopefully should be the same as my derivation. It looks like the code is not updated, since where b_w_n is the estimated gyro bias, and p_c_n is the lever arm between imu-frame and vehicle-frame, resolved in the imu-frame. w_imu_n is the gyro reading |
@robocar2018 OMG so even the IEEE paper has an error? Any other discrepancies you noticed? @vkorotkine mentioned Jacobians i.e. in the plural. |
@scott81321 , for the IEEE paper, at least we can see the common extrinsic matrix is extracted out for the H matrix, which is reflected inside the matrix A. While for the arxiv preprint, we could see the extrinsic matrix is missing in the matrix A. From the updated equation (14), |
@robocar2018 I gather b_w_n must be 'b_omega' in the code, right? 'C' is 'Omega' in the code 't_c_i' is 'p_n_c' as you call it. In the code, 'w' is u[:3] and you always find b_omega subtracted from it i.e. u[:3] - b_omega. u[:3] is w_IMU and w_n = w_IMU - b_w_n. If I did this right, the code should be: TCS Omega must be 'C' in paper
correct? |
@scott81321 , yes you are right. Also I added some comments in my previous reply.
|
@scott81321 , below is my updated measurement Jacobian matrix H in the code. Please let me know if you have any questions, thanks.
|
@robocar2018 Thank you for all this. I have implemented this code and found that it did not fix the issue I faced concerning eq. 6. These extra terms in 'w' which involve the gyroscope readings are very very small. In my case, I have a gyro_z lasting for a while with a vehicle experiencing changing velocities. The algo fails here even with these corrections to the code. The Rotation matrix Rimu of eq. 6 degrades and when the vehicle comes to a dead stop, there is no gyro 'juice' to kickstart RImu out of its bad state of the rotation matrix creates spurious accelerations. The code has a 'normalize_rot' routine to deal with numerical error on the Rimu but it is not enough. Any suggestions? |
@scott81321, I don't think this algorithm can work well when the vehicle stops, since we don't use those measurements that indicate the vehicle is in a static state (like ZUPT). When the vehicle stops, the gyro bias will cause Rotation matrix Rimu to drift, and which in turn will cause spurious accelerations as you discovered. |
Thanks for telling me. You're right. But here is an idea. If the vehicle is at a stop, what if one measured the mean gyro and mean accel for say a period of time, say a few seconds? During a full stop, I expect the noise to be Gaussian. The mean if accel_x,y and gyro_x,y,z should be zero (drift not withstanding) and accel_z should be registering gravity (using KITTI format with x as forward, y is left and z is up). On a flat surface pitch and roll are zero and I gather so would yaw during a full stop (?) I did some testing and although my notion is still dodgy, I found that I could detect near zero velocity for accel x,y below specific thresholds. A machine learning type approach would be better. |
@scott81321, Yes, Looks like it can work. But I guess yaw would still drift in a longer term when the vehicle stops for a long time. Anyway, adding ZUPT feature would definitely improve this dead reckoning performance which lacks in the current open source code. |
@robocar2018 Hello, in regards to your first question, if you mean committing code to ai-imu-dr, only Martin Brossard can commit and he has his own 'commitments' in industry. As for my own code, sorry but that is propriety though I can mention ideas. |
@scott81321 , no problem. FYI: I just tried compared the Jacobian matrix H based on my derivation and the one from the IEEE paper on two data slices and observed smaller average position errors on my derived H (which is based on Fig 7 of the code). |
@scott81321 THX. It makes sense. Please let us know if you find any other errors or discrepancies in the equations of the paper. In the meantime, my kludge of estimating if the velocity is below a threshold, say 0.15 m/s, based entirely on IMU accel data works surprisingly well. Thanks for the ZUPT heads up. Mind you, I still would like to resolve the degradation of the Rotation matrix before the algo reaches that critical point where the vehicle has stopped. When this happens, the angle between R*g and g seems to get worse. My yaw descends to about one but then remains level when it should gradually go to zero. I saw your recent issue. I am a bit puzzled. Surely the effect of the earth's radius is not felt over a range of a few meters? |
Hello @robocar2018 Since you have gone to this trouble to re-derive the equations of Brossard's paper, A few questions to you (or anyone else who can answer), if I may:
|
In utils_numpy_filter.py.
The body velocity computation seems wrong?
the formula in paper is
The text was updated successfully, but these errors were encountered: