IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.59k stars 1.76k forks source link

D435i Wrong IMU readings #1334

Closed simonyilunw closed 4 years ago

simonyilunw commented 4 years ago

RealSense ROS: v2.2.16 Built with LibRealSense: v2.36.0 Firmware: 05.11.06.250

I just bought a new D435i and I set it up with the official imu-calibration python script. The calibration output looks ok which has 9.80 as the magnitude of accel After calibration, it shows different magnitude of accel for different pose when holding still.

as you can see, it has 9.97 and 9.57 as the magnitude of acceleration when camera is facing up and down I don't think it's normal but how can I fix it?

1 2

MartyG-RealSense commented 4 years ago

hi @nflsalex Values for position 5 and 6 near to the range that you experienced have been encountered before. In the link below, a member of the RealSense team suggests that it may be because the camera was not completely level in steps 2 and 4 of the calibration process (the ones where the camera is held side-on by holding its USB connector or holding the end of the camera).

https://github.com/IntelRealSense/librealsense/issues/5177#issuecomment-550210453

It is difficult to achieve ideal values in the calibration process without some kind of device (such as a spirit level or laser level) to check how level the camera is in a particular orientation. I recommend just doing the best that you can. The Y-accel value of 9.80 that you achieved is certainly an excellent calibration result.

simonyilunw commented 4 years ago

I see. I will try a few more times to see if I can get it right. Just want to make sure I am not doing anything wrong .

Another unrelated question, is the IMU output from this ros package already in camera coordinate? so that I don't need to consider the extrinsic between camera and IMU?

MartyG-RealSense commented 4 years ago

I will refer your question above to @doronhi the RealSense ROS wrapper developer to ensure that you get a correct answer.

simonyilunw commented 4 years ago

@doronhi could you help with question mentioned before?

doronhi commented 4 years ago

The gyro and accel are published with their own frame_ids: camera_gyro_optical_frame, camera_accel_optical_frame. That can be seen with rostopic echo /camera/gyro/sample for example. Using rosrun tf tf_echo camera_accel_optical_frame camera_depth_optical_frame you can see the following transformation between the two:

- Translation: [-0.006, 0.005, 0.012]
- Rotation: in Quaternion [0.000, 0.000, 0.000, 1.000]
            in RPY (radian) [0.000, -0.000, 0.000]
            in RPY (degree) [0.000, -0.000, 0.000]

So, in short and if I understood you correctly, you should consider extrinsics between the camera and the IMU.