Realsense D435i: rs-motion drift on y orientation
Hi All,
I am trying to get the orientation of the camera in degrees and hence checked on the rs-motion example. When I run the rs-motion module, at first there is very unstable data and after a while the data settles down but the y orientation does not change on movement. If I restart the rs-motion module the y orientation then works properly.
However, I see that there is a drift in the y - orientation when stationary of about +/-1 degree at every 12~13 seconds. I tested this with two different cameras and on two different system configurations: Raspberry Pi 4 and Laptop with intel processor. The drift is always either + 1 degree every 12~13 secs or -1 degree.
Is there a way to compensate for this error and get a stable orientation when stationary? Any other suggestions for this would be appreciated too.
Thank you in advance.
-
Hi M Faizan The discussions in the links below should be helpful in understadig the behavior of the IMU in the rs-motion example program.
https://github.com/IntelRealSense/librealsense/issues/4391
https://github.com/IntelRealSense/librealsense/issues/7103
The IMU component inside the camera does not have internal calibration, so a Python-based software calibration tool exists for this purpose.
https://dev.intelrealsense.com/docs/imu-calibration-tool-for-intel-realsense-depth-camera
If the IMU is not calibrated then it may produce non-zero values on the Y acceleration axis even when the camera is stationary. Calibration helps the Y value to get close to the ideal target of 9.80 (9.81 is the real-life gravity value on Earth).
After a calibration has been written to the camera's internal storage, an option in the Motion Module of the RealSense Viewer appears that provides the function of applying motion correction to the IMU data.
-
Hi MartyG,
Thank you for the prompt reply.
I tried the calibration and I get the y accel close to 9.80 (arround 9.7). I guess this is the most I can do. However the drift is still present on the y orientation as shown below:

As you can see above the camera is stationary but the y orientation is reducing slowly about 1 degree every 20 secs. The print you see above is from the rs-motion code specifically from the below part of the code:

Do you have any idea on how I can stop this drift from happening?
Please let me know if you need any more information on this. Thanks for the help.
-
The rs-motion documentation explains that gyro drift may occur if the alpha value is too high. Using a lower alpha value shifts the balance of the calculations to favor the accelerometer instead of the gyro, though the trade-off is that the data becomes more sensitive to disturbances.

-
When calibrating the IMU with the Python calibration tool, the outcome of the calibration can be negatively affected if the camera is overly tilted when orientated in the vertical position (USB cable pointing downwards or upwards). '
It is difficult to achieve ideal values in these orientations though due to the problems with holding the camera completely vertically straight when it is held in the hand as the original PDF documentation for the tool recommended. In the updated online version of the guide, it is suggested to instead use the RealSense box as a camera holder to achieve precise 90 degree orientation.
https://github.com/IntelRealSense/librealsense/tree/master/tools/rs-imu-calibration
-
Hi MartyG,
I do get the accel values in the different orientations very close to 9.81 (~9.79). Doesn't this mean that the calibration was good? I know it will be probably very difficult to reach the ideal value of 9.81 especially in the 90 degree vertical orientation even with the camera box technique. Would you still recommend trying it?
I still have this error and I am not sure how to fix it. Any suggestions would be appreciated. Thank you for the suggestions so far.
-
9.79 is a very good result for the Y-accel calibration, so there is no problem there. You just need to get as close as possible to 9.80, not achieve it precisely.
It is not expected that an exact 90 degree tilt orientation will be achieved, though the closer to a straight vertical 90 degrees the better. The discussion in the link below talks about this subject. I recommend reading the discussion from the point that I have linked to it down to the end of the discussion.
https://github.com/IntelRealSense/librealsense/issues/5177#issuecomment-550210453
Within that discussion, a RealSense user provides details on the custom-created method that they used to improve their calibration result.
https://github.com/IntelRealSense/librealsense/issues/5177#issuecomment-570980916
The camera-box method is certainly worth trying first if you want to try to improve your vertical orientation results.
Please sign in to leave a comment.
Comments
7 comments