mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 06:50:35 +08:00
ekf2: auto-generate state vector size constant
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user