Skip to content

godardma/magnetic_calibration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magnetic calibration

C++ package for magnetic calibration

Autors :

🧑‍🏫 Thomas LE MEZO [email protected] (ENSTA Bretagne, Lab-STICC)

🧑‍🏫 Maël GODARD [email protected] (ENSTA Bretagne, Lab-STICC)

Git Structure :

Technologies :

  • C++
  • Eigen
  • Vtk 9.0
  • CMake

Building the package for the first time

  • Clone the repository :
# for ssh clone
git clone [email protected]:godardma/magnetic_calibration.git
# for https clone
git clone https://github.com/godardma/magnetic_calibration.git
  • Open a terminal in the created folder
  • Setup the build folder :
mkdir build && cd build && cmake ..

Launching :

From a terminal in the build folder :

make && ./mag_calibration

Using the package

An exemple main file can be found here

The main steps are :

  • Create an instance of the object MagneticCalibration

  • Fill the field "magnetometer_data_regularized_" :

    • Use the function "generate_data" to use the the default dataset, no need to regularize it
    • Fill the field "magnetometer_data_" by hand and regularize the dataset
    • Fill the field "magnetometer_data_" from a file using the function "create_data_from_file" and regularize the dataset

    The regularization is done by calling the function "regularize_data", arguments are the limit of point in a box and its limit size

  • Perform the ellipsoid fit with the "compute_ellipsoid" function to get its center and the transformation matrix (noted TR) between the ellipsoid and a sphere

Other useful functions provided are :

  • correct_data: Applies the correction to "magnetometer_data_" and stores the result in "magnetometer_data_corrected_"
  • check_correction: Performs an ellipsoid fit on "magnetometer_data_corrected_" to check if it matches a sphere as it should
  • view_data: to visualize the data, arguments are point size and the range of the displayed axis
    • In black the raw data, stored magnetometer_data_
    • In red the regularized data, stored magnetometer_data_regularized
    • In green the corrected data, stored magnetometer_data_corrected, and the corresponding sphere

Notes for users

The package seems to struggle to perform a proper calibration when big values are passed as inputs. We highly suggest to keep the values in the range [-1000,1000] by scaling your inputs if necessary to get a proper result.

License :

This package is under GNU General Public License

Credits :

The credits belong to Thomas LE MEZO (ENSTA Bretagne, Lab-STICC) and Maël GODARD (ENSTA Bretagne Lab-STICC)

About

C++ package to perform a magnetic calibration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published