Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

angular velocity on /imu topic broken #83

Closed
ihadzic opened this issue Apr 13, 2018 · 7 comments
Closed

angular velocity on /imu topic broken #83

ihadzic opened this issue Apr 13, 2018 · 7 comments

Comments

@ihadzic
Copy link

ihadzic commented Apr 13, 2018

I have recently upgraded the OpenCR firmware on my TB (I am now in the 1.1.2, before I was in 1.0.7). It looks like the units on /imu topic have been switched to radians (from raw ADC readings), but the numbers appear broken. I make the robot spin by exactly 1rad/s (verified correct by external means) and the imu/ topic reports 0.12 on z-axis angular velocity.

I believe the problem is that the calculations assume that the gyroscope range is +/-250 degrees (cf. the value of GYRO_FACTOR constant in turtlebot3_sensor.h), but the FS_SEL bits are still set to +/- 2000 range (see the register write to GYRO_CONFIG register in MPU9250.cpp)

@chcbaram
Copy link
Contributor

chcbaram commented Apr 17, 2018

@ihadzic

You are right. Gyro is configured as +/-2000dps and Accel is configured as +/-2g
It will be fixed next update.

@robotpilot robotpilot added this to the 1.0.0 milestone Apr 17, 2018
@robotpilot
Copy link
Member

@ihadzic, @chcbaram
This bug fix will be included in the next TurtleBot3 version upgrade.
I sincerely appreciate your feedback and will continue to provide better software in the future. :)
Thank you so much.

@robotpilot
Copy link
Member

@OpusK, Does this software update include a workaround for this issue?

@ihadzic
Copy link
Author

ihadzic commented May 22, 2018

I have just updated to 1.1.13 and it looks like the gyroscope is still reporting incorrect reading. Looking at the source code, a comment has been added next to GYRO_FACTOR definition (and the math in the comment is correct), but the value has not been changed (it's still the old 0.000133)

#define GYRO_FACTOR                       0.000133  // pi / (131 * 180)      adc * 1/16.4 = deg/s => 1/16.4 deg/s -> 0.001064225157909 rad/s

@OpusK
Copy link
Contributor

OpusK commented May 23, 2018

@robotpilot, @ihadzic,

This issue has not been resolved in the 1.1.13 release.
I think it will be fixed in the next release.

@routiful
Copy link

routiful commented May 23, 2018

@routiful
Copy link

Hi again @ihadzic

We update new firmware (version 1.2.0) :) Thank you to your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants