-
Notifications
You must be signed in to change notification settings - Fork 104
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
IMU filter may produce continuous warnings #728
IMU filter may produce continuous warnings #728
Comments
This warning message might be critical so I think it's important that got printed. |
Yes, sure. From the log it is not straightforward to understand what is going on and it is most likely ignored. It is possible there is some hardware issue, but I could not understand why that is printed. |
A side note: probably this warning was printed also before, but since in the past it was an executable nobody noticed it. |
What you say @Nicogene can be true, but my hunch is that it intimately depends on the type of the IMU. We know that with the Bosch unit within the RFE we've been suffering from problems related to timing. |
With non-increasing time values, the computation of the derivative of the magnetic info cannot be performed (in correspondence of the time instant when the misbehavior happens) and this goes to the detriment of the integration process that estimates the gyro offsets. It would be beneficial to dump directly the data provided by the IMU YARP port to inspect the profile time stamps. @Nicogene do you know what is the name of such a port? |
I don't know if it helpful, but on iCub3 (the robot where I had this issue), these are the corresponding lines https://github.com/robotology/robots-configuration/blob/3c71e095a7c1c6b5463518dcbe96746430e588b6/iCubGenova09/icub_wbd.xml#L86-L87 |
The name of the port is |
Thanks @Nicogene ! @S-Dafarra would you be willing to launch the following the next time you'll be by iCub 3? $ yarpdatadumper --rxTime --txTime --connect /icub/head/inertials/measures:o |
@Nicogene I wonder if the data shown in #595 (comment) are relevant here. The second plot displays cases where dt = 0, which actually would bring up the warning message. Is the same IMU device mounted on iCubGenova04? |
Sorry I missed this, I will try on Monday!
I think that on iCubGenova04 we still have the old one connected with |
Here the data. I just run it for about 30s |
Thanks heaps @S-Dafarra ! |
Apparently, the timestamps are ok – both the tx and the rx – meaning that we don't have any time delta <=0. @S-Dafarra did you get the error message popping up during the acquisition? |
I did not check. I also removed the imu filter from the robot |
That's certainly ok but it would help to get it working again just for the sake of the test. It'd be decisive to understand what's going on.
Some sort of quantum effect? 😉 |
Here some other data. This time I did see the message popping out, even if it was not continuous |
Thus, it doesn't seem that we have non-increasing timestamps. The plot above just highlights that there's been one packet lost. @S-Dafarra just disable the imuFilter device while we'll be delving deeper. Thanks again for the logs. |
I took the chance to craft a quick testing snippet in The same exact library component is used within the module The test itself generates a stream to which we can optionally attach an increasing timestamp. Also, we can yield a glitch each second, meaning that the timestamp is for just one step non-increasing. Here's how to launch the test suite (you can run it in Gitpod): $ test-728 --add-stamp [on|off] --add-glitch [on|off]
$ velocityObserver
$ yarp connect /test /velObs/pos:i Results are that we spot the warning message only when we generate the glitch! Given that we didn't observe from the logs anything weird, it might be that the bug lurks in the handling of the timestamps when they get received from the device driver, prior to being passed on to the library component. cc @Nicogene |
@Nicogene can we discuss this a bit together when you'll be available? |
Yes sure! |
After a quick debriefing w/ @Nicogene we agreed that the only test we can do is to check if the timestamp
is ok or not. To do this, we're required to make a local hack to the @S-Dafarra, we can plan for this in the next sprint unless you're willing to insert the following snippet in the code and give it yet another whirl: stampBias.update(ts);
static double t_{0.);
if (stampBias.getTime() <= t_) {
yDebug() << "Got it!"; // or maybe we can send it out to a YARP port
}
t_ = stampBias.getTime();
double t0=Time::now(); |
That's where I first noticed it. |
Thank you @S-Dafarra , it was only to say that I can run the test w/ the modified imuFilter code on it w/o using the greeny 👍 |
@pattacini I ran the modified code for |
So, this demonstrates that we do receive from the YARP I/F non-increasing timestamps: That's kind of puzzling as this problem didn't come up from the logs we analyzed:
|
It seems the correct ones to me
If I remember correctly we already discussed about the timestamps set by The chain of the ts should be: icub-head:multipleanalogsensorserver -> icubsrv:mutlipleanalogsensorsclient(ref) -> icubsrv:multipleanalogsensorsserver The imuFilter should take the ts from MAS server of icub-head, what I suspect is that MASserver if it does not have new data give you the latest in cache, this is why we have data with the same timestamps The imuFilter has a period of 0 seconds see
That's why you get continuously warnings The strange thing that this
should set the correct period(10 ms by default) In any case, in |
Thanks @Nicogene 👍🏻
Nope, as you have correctly noticed, we use With this respect, the following line is conceptually wrong
as Probably, the best would be to change the XML files from Would you be willing to do the fix @Nicogene ? ⚠ The original imuFilter codebase was running in sync with the incoming data. |
I've changed my mind! I believe it's better to stick to ms as of now, in sight of a major overhaul when all the device driver will switch to the use of seconds at once. I'll do the job then @Nicogene! |
@Nicogene we underestimated the lack of being in sync w/ the incoming data during the major overhaul done in #592. Increasing the period to prevent warnings is ok as the device is not crucial; however, we're basically subsampling the signals this way, making imuFilter not useful at all. I think the imuFilter device should really restore the in-sync functionality. I'm opening a new issue for that (see #746). |
So we merge #745 and robotology/robots-configuration#255 or we await the proper fix?
About this we should attach to a callback of the masclient that I suspect does not exist, the alternative is to roll-back to the read of the port, but we have to parse the mas message. |
I would proceed anyway, as those warnings might be as dangerous as going at 20 ms. |
He has already a plan! 😀 |
Let's move the discussion to #746. |
While testing the robot, I noticed the following warning message being printed continuously
that I tracked to
icub-main/src/libraries/ctrlLib/src/adaptWinPolyEstimator.cpp
Line 130 in 7945541
By looking at which modules use that class, I found it used in the
ImuFilter
:icub-main/src/libraries/icubmod/imuFilter/ImuFilter.cpp
Line 85 in 7945541
I don't know if some check can be implemented on
stampBias.getTime()
to avoid this warning to be printed.@Nicogene @pattacini
The text was updated successfully, but these errors were encountered: