How should I modify my real-time IMU data for usage in insfilterA​sync/insfi​lterMARG object(s)?

1 view (last 30 days)
I'm trying to use the example imu-gps fusion code from the MATLAB example (site adress is at the end of the passage) for my real-time ins-gps applicaiton. I sense that there is a discrepency in the imu sensor frames between my data and MATLAB's imu sensor. I can see that accleration in Z axis is 9.81 in the simulated data whereas in realtime data it is -9.81 (Both sensor body and local navigation frames are NED.) Although I have modified the acceleration, angular velocity and magnetic field vectors many times, I can't find the true modification for the filter to work. So how should i modify my accelerometer, gyroscope and magnetometer data in order to use in insFilterAsync/insfilterMARG specially in functions fuseaccel, fusegyro and fusemag?
Example code: https://www.mathworks.com/help/fusion/ug/pose-estimation-from-asynchronous-sensors.html
  2 Comments
zipeng li
zipeng li on 23 Nov 2022
I meet the same problem as you. My imu data is x-right, y-front, z-up. I transform them to x-front y-right z- down to send into insfilter of matlab (which maybe x-front, y-right, z-down in NED). However, I found that I also need to negative the measurement of accelerometer, and do not need to negative the measurement of gyroscope. I am very confused.
Ilkay Ataol
Ilkay Ataol on 28 Nov 2022
I had taken both of the acceleration and angular velocity measurements negative and adjusted the measurement noise parameters so i was wondering that the measurement noise parameters made the filter the work somehow. Since i wasn't sure, I wanted to ask :) I will try the filter without taken negative of gyroscope following your comment.

Sign in to comment.

Answers (1)

Brian Fanous
Brian Fanous on 22 Nov 2022
This example may help in understanding how to do this:
You may need to swap and/or invert axes, but, essentially, you want to map your recorded IMU data to the same convention as imuSensor outputs.
  1 Comment
Ilkay Ataol
Ilkay Ataol on 29 Nov 2022
This example has helped me a lot and i also agree with zipeng li on taking negative of accelaration and leaving angular velocity as it is. Hovewer, when I tried the alignment of the logged orientation and imufilter orientation, I had unexpected results so I didn't take the conjugate of the logged orientation for alignment purposes and the result was as I expected. So I was wondering why the orientation was conjugated for alignment in this example. Can you elaborate on this issue?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!