IMU sensor vs T265 gyroscope: fair experiment.

Love Robots to Death
4 min readMar 8, 2023

--

Hello, folks. Welcome to my other story about making a robot, again.

So I have a problem: I need the PID controller, but for that I need to receive error values or some “ground truth” values of the robot’s movement.

Usually the wheel encoders are used for this task, but I do not have them. Instead I have IMU sensor ASM330LHHX, I have talked about how I developed the driver for it here, and IMU in Realsense T265.

Image 1. Realsense T265, source: https://www.intelrealsense.com/tracking-camera-t265/

The documentation promise us the precision tracking for V-SLAM. As we can see for this source, the IMU sensor in T265 is Bosch BMI055.

I have an idea to take the values for PID controller from IMU data, let’s check is it possible.

Installing realsense libs in Raspberry.

Firstly, you need install librealsense driver. This driver recieve raw data from camera and then can translate it to user or other module. The one driver for all the models, that’s usefull.

It also offer you some good tools for checking device’s status and testing data transmission. But to be sure that everything is good you need to use rs-enumerate-devices — this tool show you how many cameras you have switched to your robot.

To use it in ros environment you should install ros-librealsense. Here is source code. Also it works with different camera models, there are special launch files for every model.

Comparing IMU.

So to be able comparing IMU data I created 6 charts — 3 charts for accelerometer and 3 for gyroscope data. Unfortunately for some reason I cannot recieve the correct data of acceletometer from camera, but still we can see how the accelerometer from ASM330LHHX is changing. The green line is IMU data from camera, the blue one — from ASM330LHHX sensor. Here is the data when the robot is not moving.

Image 2: data without moving

Here we can see that the data from ASM330LHHX has gaps and also a little bit noise. But the data from camera is more noisy.

Let’s check what would be changed if we are trying to move forward and backward.

Image 3: moving forward and backward.

We can see that moving backward is slower. Also my robot had a problem with one wheel, it was not fixed properly — that is the explanation of changing in gyroscope data. But still it seems like the camera’s IMU has more false positive data.

Let’s check, what would be during the turning. I applied two commands which turns the robot approximately around it’s axis. For that I just need to move wheels in different directions.

Image 4: turning left
Image 5: turning right

We can see that ASM330LHHX and camera’s IMU have the different axis orientations. As for the data itself — we can see that it differs a little in maximum values, but not much. The form if the lines are approximately the same.

As for accelerometer data which we can recieve now only from ASM330LHHX — it looks like true data, but has a lot of fluctuactions so accelerometer data would be not easy to use in PID controller task.

Conclusion.

Although the camera IMU are claimed as more precise, the reality is it is more noisy and also I should tell you about that accelerometer and gyroscope data have different frequency for some reason, and for that they are published in different topic. That is also not convenient for usage.

Accelerometer data is not very useful for PID controller, it requires denoising and may be getting rid of bias, because we can see some bias. But gyroscope values are quite precise.

As for accuracy — I cannot see the total difference in accuracy for ASM330LHHX and camera’s IMU. Their gyroscopes return very simular values with minimum difference.

--

--

Love Robots to Death

Hi. My name is Olesya Krindach and I am software engineer and data scientist with background in deep learning both CV and voice.