-
Notifications
You must be signed in to change notification settings - Fork 195
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
imuBosch_BNO055: IMU port on iCub streams NaN when dcm2rpy receives invalid data, but no error message is printed #1994
Comments
yarp device name is: imuBosch_BNO055 |
To be explicit, since the output data buffer is not being filled when we read from the IMU register through i2c, the output data buffer all remains zero. This error should be handled properly. |
This seems to be a problem in the sensor, for some reason. Given that this is apparently something that can happen, perhaps it could make sense to read the sensor once during the |
I agree. 👍 I don't know if it is related but I noticed on |
I checked a bit the Linux kernel source code, and apparently an improved check on the correctness of our call to Another thing that we could look in improving is the initialization part in
SWITCHING_TIME parameter? If it is possible to check if the configuration has been correctly set, a better strategy may be to avoid the long wait, and just continuously check if the set was successful (with a timeout) and proceed to the next command when the configuration was correctly set.
|
👍
Honestly when I wrote the |
Dealing with wrong hw read is always painful because there is no perfect solution.
We may, but I think it does not solve the issue. If I understood the point here, the problem is that we feed the computation with a quaternion full of zeros. Even if we change the check, we still fall in a situation with an invalid read.
The solution of run a first smoke test when the device starts is a valid approach if the problem arise only at startup, but if an invalid read happens after some time, how do we deal with it?
That is mandatory from device's datasheet. |
My two cents:
How to handle the failures in the open or during runtime is up to the devices attached to the imuBosch_BNO055, I think that the duty of the imuBosch_BNO055 device is just to make sure that the error is correctly propagated. |
Fine by me, I can do these change. |
I would just not set anything in the |
@barbalberto note that the |
Just to be 100% sure I get what you mean: to not set anything means do not change the current vector, which means keeping the previous values. Example: consider the previous read was successful, the vector is filled with data. In the following run the read fails and I just return an error. The vector will still hold old values, is this what you mean? Or do you mean free the vector's memory and set the vector size to zero? I think this is ricky because user code calling the read may not be smart enough to handle vector which change size at run time. |
Good point. I would probably just return false without touching the input vector at all, I am afraid that trying to implement some kind of "smart" handling of the input vector for users that ignore the return value of the read is going to be an ill posed problem otherwise. |
Same problem occurred on the purple ( cc: @Yeshasvitvs @lrapetti |
If first read fails, closes the device This commit follows requests from issue robotology#1994
If first read fails, closes the device This commit follows requests from issue robotology#1994
IMU bosh: read error propagated up to YARP call - issue #1994
Fixed by @barbalberto in #2034 |
Describe the bug
On
iCubGenova04
, the IMU measurements estimated from the BOSCH IMU in the robot head and published on the port/icub/inertial
are either zero or NaN.After a preliminary analysis, we suspect that the yarprobotinterface somehow fails to communicate with the head IMU, receives a vector of zeros instead of the correct IMU values, and then these values impair the computations inside the dcm2rpy method.
The main problem is that
dcm2rpy
just prints a warning message saying that, being in a singular configuration, multiple solutions were found, and therefore one of them is taken. But this is not actually true, as the problem is that the original data describing the IMU orientation are not a valid rotation matrix or quaternion. Without an explicit error, the IMU port silently fails and streams NaN.To Reproduce
It seems the problem occurs when turning the
icub-head
PC on and then starting theyarprobotinterface
. It does not occur when one starts theyarprobotinterface
without restarting alsoicub-head
.Screenshots
Data streamed from the IMU
![Screenshot from 2019-04-03 16-00-59](https://user-images.githubusercontent.com/12396934/55499592-a8ba6c80-5646-11e9-8c4e-691b3daf5ad4.png)
Warning message in the logger
![Screenshot from 2019-04-03 15-17-31](https://user-images.githubusercontent.com/12396934/55499593-a8ba6c80-5646-11e9-8d2f-e0b88cd24a8a.png)
Logger when the failure occurred
imu_not_working.txt
no messages are printed besides the warning.
Configuration (please complete the following information):
The text was updated successfully, but these errors were encountered: