mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-09-24 19:08:21 +08:00
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:
@@ -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
|
// 2026-03-19: translate EKF2_ENGINE_WRM to EKF2_POS_LOCK
|
||||||
{
|
{
|
||||||
if (strcmp("EKF2_ENGINE_WRM", node->name) == 0) {
|
if (strcmp("EKF2_ENGINE_WRM", node->name) == 0) {
|
||||||
int32_t delay_ms = static_cast<int32_t>(node->d);
|
strcpy(node->name, "EKF2_POS_LOCK");
|
||||||
param_set(param_find("EKF2_POS_LOCK"), &delay_ms);
|
|
||||||
PX4_INFO("migrating %s -> %s", "EKF2_ENGINE_WRM", "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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user