Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/CPUInfo/EKF_Maths.h
Views: 1798
#pragma once12/*3data structure for measuring speed of EKF mag fusion code4*/5#include <AP_Math/AP_Math.h>6#include <AP_Math/ftype.h>7#include <stdint.h>89class EKF_Maths {10public:11EKF_Maths() {}1213typedef ftype Vector2[2];14typedef ftype Vector3[3];15typedef ftype Vector4[4];16typedef ftype Vector5[5];17typedef ftype Vector6[6];18typedef ftype Vector7[7];19typedef ftype Vector8[8];20typedef ftype Vector9[9];21typedef ftype Vector10[10];22typedef ftype Vector11[11];23typedef ftype Vector13[13];24typedef ftype Vector14[14];25typedef ftype Vector15[15];26typedef ftype Vector22[22];27typedef ftype Vector23[23];28typedef ftype Vector24[24];29typedef ftype Vector25[25];30typedef ftype Vector28[28];31typedef ftype Matrix3[3][3];32typedef ftype Matrix24[24][24];33typedef ftype Matrix34_50[34][50];34typedef uint32_t Vector_u32_50[50];3536struct state_elements {37Vector3f angErr; // 0..238Vector3f velocity; // 3..539Vector3f position; // 6..840Vector3f gyro_bias; // 9..1141Vector3f gyro_scale; // 12..1442float accel_zbias; // 1543Vector3f earth_magfield; // 16..1844Vector3f body_magfield; // 19..2145Vector2f wind_vel; // 22..2346Quaternion quat; // 24..2747};4849union {50Vector28 statesArray;51struct state_elements stateStruct;52};5354struct {55ftype q0;56ftype q1;57ftype q2;58ftype q3;59ftype magN;60ftype magE;61ftype magD;62ftype magXbias;63ftype magYbias;64ftype magZbias;65Matrix3f DCM;66Vector3f MagPred;67ftype R_MAG;68Vector9 SH_MAG;69} mag_state;7071Vector3f innovMag;72Vector3f varInnovMag;7374Matrix24 P;75Vector28 Kfusion;7677void init(void);78float test(void);79};80818283