-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Potential bug for EKF2 #9182
Comments
@priseborough could you please have a look? |
@Changliu52 Possible fix here : PX4/PX4-ECL#418. Could you please test? |
Thanks for the update @mhkabir @priseborough z local position fusion shown here The improvements are:
Still problems are: I have also tested with the LPE in 1.7.3, which flies the drone pretty smoothly without any problem. Let me know if you have any thoughs. Kind Regards, |
I will have a look at your last log. One possibility to consider is time stamping. The ekf2 runs on a delayed tine horizon and uses the time stamp of the observation to retrieve data so that everything gets fused at a consistent time. However this can be a problem with offboard data because the data buffers are only large enough to store data in a window that extends from current time back to the fusion time horizon which is typically 100 to 200 msec wide depending on the value of the largest time delay parameter. If time stamping is out by more than 50msec or input data is coming in at too fast a rate it can result in observations being overwritten in the buffer by new ones before they are used by the EKF. |
For such cases where we set @priseborough What do you think? |
The same result can be achieved by setting the time delay for an unused sensor to a larger value. Looking at the parameters saved with the log, the GPS delay parameter is currently the largest at 110 msec. If you want to try a larger buffer length, set EKF2_ASP_DELAY to 200 which will increase the length of all buffers. We can add a catch all parameter in the future. @Changliu52 What is the data rate of your SLAM data? Edit: It looks like it is around 5 Hz but with a lot of timing jitter. |
Buffer overflow due to data rate should not be an issue then, however the time stamping still needs be correct. |
Hi @mhkabir @priseborough I think buffer overwrite could well be the problem, because:
I will test again with lower streaming frequency (5Hz) and put the EKF2_ASP_DELAY to 200 to allow the buffer. Is 200ms the maximum value? Update: I remember before I tested 400ms in EFK2_EV_DELAY, as the maximum shown in the description in QGC, but ekf simply doesn't initialise. Kind Regards, |
The 5Hz estimate was based on counting the number of logged vehicle_vision_position pose data points over a 3 second interval in the log. I counted 14. It had nothing to do with the EKF. The EKF is getting the data out of the buffers much less frequently than that- see the innovations. From memory the EKF can compensate for time delays of the data relative to its time stamp time up to 250 msec. The EKF uses the IMU data time stamps as its internal time reference. If the time stamp of the external vision data accurately reflected the time of the EV measurement relative to the IMU data, then the EKF2_EV_DELAY parameter could be set to zero. Looking at the code here: https://github.com/PX4/Firmware/blob/master/src/modules/ekf2/ekf2_main.cpp#L914-L931 it appears that either the vision position or vision attitude message timestamps can be passed to the EKF via the external vision interface, so that is something else to check. |
Awesome! When I set EFK2_ASP_DELAY to 250ms, everything works like a charm! X local position fusion here: Also, I figured, the reason for the rough 5Hz update rate is that the SLAM might only be able to catch up with 5 FPS, due to my recent increase in video resolution. I assume if PX4 receive the same vision pose twice with the same timestamps, it will result in overlapping points in the log, right? Many thanks for the help! Kind Regards, |
Hi @mhkabir @dagar @priseborough,
Environment: 1.7.3 generic quadrotor x, with the non-standard EKF2 parameters as below:
EKF2_AID_MASK: vision position fusion + vision yaw fusion
EKF2_EV_DELAY: 0.0ms
EKF2_HGT_MODE: Vision
When flying, I was using an onboard SLAM to produce vision pose.
at about 5:01:407 (same time as the warning message: [lib_ecl] EKF ev hgt timeout - reset to baro), the drone shooted up and crashed into the ceiling.
log here: https://review.px4.io/plot_app?log=cd3735b0-db2a-4ada-b7a1-240b5ef63c37
Several points I don't understand here:
Do local_position.z and local_position.vz need to be reset at the same time?
Please help, and I believe the SLAM outputs quite decent measurement, maybe could your share some experiance to avoid the mysterious reset of the local_position.x/y?
Thanks in advance.
Kind Regards,
Chang
The text was updated successfully, but these errors were encountered: