fix(parameters): preserve EKF2_ENGINE_WRM on import (#28722)

The old boolean is serialized as BSON_INT32, but the migration reads
the double member and can disable an enabled setting. Rename the node
and use the normal parameter import path.

Validation: four focused host checks cover enabled/disabled values,
a mismatched BSON type, and an unrelated parameter.


Assisted-by: Codex

Signed-off-by: onelittlechildawa <onelittlechild@outlook.com>
This commit is contained in:
小小小朋友
2026-09-22 10:06:24 +08:00
committed by GitHub
parent 59b6adfd09
commit 3765a67639

View File

@@ -227,10 +227,9 @@ param_modify_on_import_ret param_modify_on_import(bson_node_t node)
// 2026-03-19: translate EKF2_ENGINE_WRM to EKF2_POS_LOCK
{
if (strcmp("EKF2_ENGINE_WRM", node->name) == 0) {
int32_t delay_ms = static_cast<int32_t>(node->d);
param_set(param_find("EKF2_POS_LOCK"), &delay_ms);
strcpy(node->name, "EKF2_POS_LOCK");
PX4_INFO("migrating %s -> %s", "EKF2_ENGINE_WRM", "EKF2_POS_LOCK");
return param_modify_on_import_ret::PARAM_SKIP_IMPORT;
return param_modify_on_import_ret::PARAM_MODIFIED;
}
}