ekf2: auto-generate state vector size constant

This commit is contained in:
bresch
2023-09-19 11:38:04 +02:00
committed by Daniel Agar
parent 8a9a303354
commit dac337efc4
8 changed files with 20 additions and 18 deletions
@@ -110,6 +110,7 @@ def generate_px4_state(states):
f.write(f"\tstatic constexpr IdxDof {state_name}{{{start_index}, {tangent_dim}}};\n")
start_index += tangent_dim
f.write(f"\tstatic constexpr uint8_t size{{{start_index}}};\n")
f.write("};\n") # namespace State
f.write("}\n") # namespace estimator
f.write("#endif // !EKF_STATE_H\n")
@@ -17,6 +17,7 @@ namespace State {
static constexpr IdxDof mag_I{16, 3};
static constexpr IdxDof mag_B{19, 3};
static constexpr IdxDof wind_vel{22, 2};
static constexpr uint8_t size{24};
};
}
#endif // !EKF_STATE_H