ColyberCompany / ColyberFlightController

Code of flight controller of ColyberCopter
GNU General Public License v3.0
0 stars 1 forks source link

Rebuild Sensor calibration process #45

Open JanWielgus opened 3 years ago

JanWielgus commented 3 years ago

By now calibration is performed using startBackgroundCalibration() method. In HMC5883L (compass) and MPU6050 (gyro and acc) adapters it checks in execute() if calibration should be performed. This does nothing but takes time most of the time. Better will be to indeed create a temporal task in Tasker that will calibrate the sensor and terminate itself. If there will be a way to add executable to run after the calibration, current solution with seconds left to calibration end will be also useless.

Task that was used to start calibrating and show the results is in Task.h file from line 38. This does not look good. Below it in code there is some suggestions.

Maybe solving this issue properly require even creating a separate Calibrations folder (I don't know). But it should enable new sensors to be added in intuitive and simple way.

JanWielgus commented 3 years ago

Maybe create an interface (something like ICalibratable) for sensors that can be calibrated.