Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed MatrixMath LPS25HB_I2C LSM9DS1 Matrix2 PIDcontroller LoopTicker SBUS_without_mainfile UsaPack solaESKF_wind Vector3 CalibrateMagneto FastPWM
Diff: global.cpp
- Revision:
- 61:c05353850017
- Parent:
- 58:a7947322db87
- Child:
- 62:ef10fd919f7b
--- a/global.cpp Wed Jun 02 06:14:47 2021 +0000
+++ b/global.cpp Thu Jun 03 11:28:13 2021 +0000
@@ -11,6 +11,7 @@
// sensor
MPU6050 accelgyro;
MAG3110 mag_sensor(PB_9,PB_8);
+CalibrateMagneto magCalibrator;
// io
DigitalIn userButton(USER_BUTTON);
@@ -51,13 +52,16 @@
float servoOut[1] = {1500.0f};
float val_thmg = 0.0f;
+float sigma_thmg = 0.0f;
float th_mg = 0.0f;
float accnormerr = 0.0f;
+float sigma_accnorm = 0.0f;
int calibrationFlag = 0;
int pos_tail = 0; // 0:left 1:center 2:right
int agoffset[6] = {0, 0, 0, 386, -450, 48};
-float magbias[4] = {0.0f, 0.0f, 0.0f, 50.0f};
+float magbiasMin[3] = {0.0f, 0.0f, 0.0f};
+float magbiasMax[3] = {0.0f, 0.0f, 0.0f};
Vector3 rpy_align(0.0f*M_PI/180.0f, 0.0f*M_PI/180.0f, 0.0f);