baidu / boteye

210 stars 72 forks source link

IMU频率可调吗? #14

Open hgpvision opened 6 years ago

hgpvision commented 6 years ago

IMU的频率显示为97-98Hz,并没有100Hz,正常吗?还有一个问题,IMU的频率可调吗?驱动程序里面似乎也没有看到用来调整到的IMU频率的函数?

mingyux commented 6 years ago

@hgpvision The IMU is polled at ~100 Hz at this moment. See https://github.com/baidu/boteye_driver/blob/1ac52f56ff54d3b83e3606b395f62757b1b40d5c/src/XP_sensor_driver.cc#L288.

On the firmware side, the Cypress polls IMU through I2C at 500 Hz (fixed) and timestamps it. The host then polls the latest cached IMU measurement.

hgpvision commented 6 years ago

Thanks!It seems that I can obtain ~200Hz if I set the sleep time to ~4900 mircosecond. Is it right?

TAO270 commented 6 years ago

@hgpvision yes,you are right. When I changed this value to 4950, the imu frequency was set to 200hz.

QLJX commented 6 years ago

@mingyux Can camera output frequency be adjusted?I want to set it to 20hz.

mingyux commented 6 years ago

Change the sleep time here. https://github.com/baidu/boteye_driver/blob/master/src/XP_sensor_driver.cc#L320

QLJX commented 6 years ago

@mingyux From above, this place changes the frequency of imu. I want to change the frequency of camera to 20Hz. Which data should I change?

mingyux commented 6 years ago

Unfortunately, there's no easy way to adjust the frame rate at this moment. You need to go into the firmware, modify it, and then flash the firmware into the device again. https://github.com/baidu/boteye_sensor/blob/bf037c74297f2867a58f9712d9924e883944f4e3/firmware/sensor_v034_raw.c#L177

We're working on exposing an interface to adjust image rates & IMU rates.
However, the frame rate usually needs to be in sync with the AC if used indoor to avoid the flickering effect. For instance, the frame rate can be 20 Hz / 30 Hz / 60 Hz at 60 Hz AC, and the frame rate can be 25 Hz / 50 Hz at 50 Hz, but not 20 Hz.

QLJX commented 6 years ago

@mingyux Can this imagingFPS(25) change the frequency of image. https://github.com/baidu/boteye_driver/blob/a46d223c39d61f88ece393965735faa7659eada6/src/XP_sensor_driver.cc#L70

mingyux commented 6 years ago

No. We're still working on providing driver API to adjust image framerate & IMU rate. For now, the only way is to change the firmware and re-flash.