aster94 / SensorFusion

A simple implementation of some complex Sensor Fusion algorithms
GNU General Public License v3.0
199 stars 41 forks source link

How to calibrate the IMU? #2

Open shujaatak opened 5 years ago

shujaatak commented 5 years ago

Can you mention how to calibrate the IMU please?

aster94 commented 5 years ago

Hi @shujaatak the IMU calibration is something that relies on the library you are using for the IMU not to the filter to get the data

This is an example of the calibration you could use for the MPU9250 with the library i use https://github.com/bolderflight/MPU9250/blob/master/README.md#calibration-functions

lcipolina commented 4 years ago

Hi, can you explain a little bit further how do you obtain the graphics for the filtered data. Are you using Processing? if so, which is the sketch?

Also, what is the output of the "Euler Data"? For example, is the YAW measured in angles?

aster94 commented 4 years ago

The function get() returns angles, meanwhile the functions getRadiant() returns radiants

Which graphics do you mean?

lcipolina commented 4 years ago

Hi, thanks for the reply. Several questions here if you don't mind...

1) So I guess one has to run a magnetometer calibration function before running your script? As you suggested above. We should add this function at the beginning of the script:

int calibrateMag()

2) For "graphics" I meant the video you posted. Did you just copy and pasted the code in the software "Processing" to see the object in 3D? or how do I reproduce your video?

Thank you so much!

PD> By the way, I am using your library with Wire, so I've changed these lines: const int mpuAddress = 0x68; //usually 0x68 or 0x69 MPU9250 IMU(Wire, mpuAddress); //#define SS_PIN PB12 //MPU9250 IMU(mySPI, SS_PIN);

aster94 commented 4 years ago
  1. the calibration should be run only once, and as i said before " is something that relies on the library you are using for the IMU"

  2. yes you can just copy and paste it into processing

lcipolina commented 4 years ago

ok, I just wanted to confirm that your script doesnt come with a calibration routine. I am new to Processing if you don't mind, I am getting an error when Processing tries to find these libraries, as it doesn't know where to look for.

How do I include them? thanks!

include "MPU9250.h"

include "Streaming.h"

include "SensorFusion.h"

aster94 commented 4 years ago

you are trying to run the same code for the MCU to a computer, run the code in the extra folder, how it is explained in the readme