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:
- 84:028bd650e8bc
- Parent:
- 83:0a644de28415
- Child:
- 85:0b14a2a600fc
diff -r 0a644de28415 -r 028bd650e8bc global.cpp
--- a/global.cpp Mon Dec 06 11:16:56 2021 +0000
+++ b/global.cpp Mon Dec 06 12:58:20 2021 +0000
@@ -24,7 +24,7 @@
FastPWM servo(PE_9);
PID pitchPID(5.0, 0,0, PID_dt); // rad
PID pitchratePID(0.5, 0.0, 0.0, PID_dt); // rad/s
-ScErrStateEKF ekf; // EKF class
+solaESKF eskf;
int itowVEL_log = 0;
int loop_count = 0;
@@ -54,6 +54,8 @@
MedianFilter magMedian(3);
float palt;
float palt0;
+bool headingUpdateFlag = false;
+float dynaccnorm2;
int out1, out2;
float scaledServoOut[1] = {0.0f};
@@ -89,4 +91,10 @@
float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
+}
+
+void setDiag(Matrix& mat, float val){
+ for (int i = 1; i < mat.getCols()+1; i++){
+ mat(i,i) = val;
+ }
}
\ No newline at end of file