IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.62k stars 4.83k forks source link

Question: Do the Accelerometer/Gyroscope values need to be divided by their corresponding sensitivity values? #12630

Closed milan-r-shah closed 8 months ago

milan-r-shah commented 9 months ago
Required Info
Camera Model D400
Firmware Version 5.12.14.50
Operating System & Version Linux (Ubuntu 18)
Kernel Version (Linux Only) 5.4.0
Platform Computer
SDK Version 2.44.0
Language C++
Segment {Robot/Smartphone/VR/AR/others}

Issue Description:

When we get linear acceleration values from the accelerometer and the angular velocity values from the gyroscope, do they need to be divided by their corresponding sensitivity values to get the actual physical linear accelerations and angular velocities? or that step is already done by the librealsense API before outputting those values so I don't have to worry about that?

For example, as per the datasheet and https://github.com/IntelRealSense/librealsense/issues/12492#issuecomment-1843001319, Sensor Range Sensitivity
Accelerometer ±4 g 512 LSB/g
Gyroscope ±1000 °/sec 32.8 LSB/°/sec

So, when I get the rs2::motion_frames through the API, do I need to divide the motion_data by 512 (for RS2_STREAM_ACCEL) or 32.8 (for RS2_STREAM_GYRO) to get the actual physical value? or the librealsense API has already abstracted that step?

Note:

  1. The main confusion is for the Gyroscopt because everything in the datasheet is in deg/sec but from my understanding/observation and https://github.com/IntelRealSense/librealsense/issues/3107#issuecomment-456702580:

    The gyro readings provided by Librealsense are rad/sec

  2. In the case of the accelerometer, everything in the datasheet is in g i.e. m/s^2 and the accel readings provided by the API are also in m/s^2. So, what should I do for the accelerometer?

MartyG-RealSense commented 9 months ago

Hi @milan-r-shah You do not need to perform division on the IMU values.

The table below from Intel's Getting IMU Data guide confirms that the unit of Accel is m/s2 and the unit of Gyro is rad/sec.

https://www.intelrealsense.com/how-to-getting-imu-data-from-d435i-and-t265/

image

MartyG-RealSense commented 9 months ago

Hi @milan-r-shah Do you require further assistance with this case, please? Thanks!

milan-r-shah commented 9 months ago

@MartyG-RealSense thank you for your response. So, whatever output I get from either the accelerometer or gyroscope, represents the actual physical quantity, correct? The librealsense API abstracts all the internal calculations that are required to convert the output of BMI055 (i.e. raw data) into the actual physical measurements, right? I am still a bit confused because in the above screenshot, for the D435i, it says "... Scale Correction not provided"!

MartyG-RealSense commented 9 months ago

Yes, the outputs represent the actual values.

The notes in the table related to that bias and scale reference indicate that whilst correction is not built in to 400 Series cameras equipped with an IMU, the correction can be performed with the SDK. https://github.com/IntelRealSense/librealsense/issues/3166 shows that it is likely referring to the SDK's Python IMU calibration tool.

MartyG-RealSense commented 9 months ago

Hi @milan-r-shah Do you require further assistance with this case, please? Thanks!

MartyG-RealSense commented 8 months ago

Case closed due to no further comments received.