vmayoral / bb_mpu9150

BeagleBone ROS package that publishes the Invensense MPU-9150 data into a Topic.
Other
23 stars 26 forks source link

mpu_init() failed #4

Open mahmoudkamelibrahim opened 7 years ago

mahmoudkamelibrahim commented 7 years ago

Hello , I have a problem with using the package , I'm using beaglebone black with ubuntu 16.04.3 LTS xenial and mpu9250 at pins 19,20 at bbb . I used (i2cdetect -r 2) to ensure that the imu is in the right channel and that was right ( The address 0x68 appeared when i attached the imu module to the board). before error and compile

When i run the node , This error appears :

Iniitializing IMU .open(i2c_bus) : no such file or directory . mpu_init() failed

I guessed that the default i2c channel isn't the channel i used and when i modified the file ( bb_mpu9150/src/linux-mpu9150/local_defaults.h) and put

DEFAULT_I2C_BUS =2

instead of 1 and compiled again ( I compile directly using catkin_make) and rerun the ros node , The error became:

Iniitializing IMU .Unsupported software product rev 6 . mpu_init() failed

Any help with these errors ? Does this package need any extra packages to work? Thank you

mahmoudkamelibrahim commented 7 years ago

I tried it with another sensor (mpu9150) and it worked . Thank you.

I want to try to edit the package to be compatible with mpu9250 .

EDIT: I found that there are already definitions for mpu9250 in this package and They can be enabled in compiler options ..

In bb_mpu9150/CMakeLists.txt

add_definitions(-DEMPL_TARGET_LINUX -DMPU9150 -DAK8975_SECONDARY)

it should be ((-DMPU9250 -DAK8963_SECONDARY)) ,according to the file: bb_mpu9150/src/linux-mpu9150/eMPL/inv_mpu.c .

/* Time for some messy macro work. =]

  • define MPU9150

  • is equivalent to..
  • define MPU6050

  • define AK8975_SECONDARY

  • define MPU9250

  • is equivalent to..
  • define MPU6500

  • define AK8963_SECONDARY

    */

but that didn't work with me .. there is still initialization error.

imakr commented 6 years ago

Hello @ma7moudk where you successful in porting this project for MPU9250?

mahmoudkamelibrahim commented 6 years ago

Yes , It worked for mpu9250. I had to change product revision info. to work. File: bb_mpu9150/src/linux-mpu9150/eMPL/inv_mpu.c Lines: 715:723

imakr commented 6 years ago

Thanks for the update @ma7moudk . i haven't integrated this into the kernel yet. as of now I'm using as a standalone application. One thing which i would like to know is, Do you face any quaternion values drift issue(Yaw drift which i see after converting quaternions to Roll,Pitch & Yaw) when using this DMP? when i leave the MPU9250 on a stable position, after 20-30 mins i see the Quaternion values slowly getting drifted away which isn't expected. Have you faced this issue? If so can you help me on how to fix it. I tried few options and couldn't fix it. I'm still working on figuring this out.

mahmoudkamelibrahim commented 6 years ago

No , I didn't face this issue , My yaw value don't drift in time.

I have another issue : I tried to calibrate much more than once , The best result I got wasn't so great :+1:

When I move the imu 90 degree four times , I get 70 , 100 , 80 , 110 yaw differences. I had to map these wrong values to the right values assuming that the error is linear. But whatever orientation I got in a specific heading , I always have this orientation when I come back to this heading.

I believe there is something I can improve that with . I haven't succeeded yet.

Hope you can solve your issue , I use the YAW_MIX_FACTOR with value 4.