{
  "id": "ros2/parameter-override-not-applied",
  "signature": "[WARN] [parameter_handler]: Parameter 'my_param' not found in node, override ignored",
  "signature_zh": "[WARN] [parameter_handler]：节点中未找到参数'my_param'，覆盖被忽略",
  "regex": "Parameter '.*?' not found in node, override ignored",
  "domain": "ros2",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A parameter override (via YAML file, command line, or launch file) specifies a parameter name that the node has not declared using declare_parameter(), so the override is silently dropped.",
  "root_cause_type": "generic",
  "root_cause_zh": "参数覆盖（通过YAML文件、命令行或启动文件）指定了一个节点未使用declare_parameter()声明的参数名，因此覆盖被静默丢弃。",
  "versions": [
    {
      "version": "ROS2 Humble",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ROS2 Iron",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ROS2 Jazzy",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding the parameter to the YAML file with a different name hoping it will be automatically matched",
      "why_fails": "The parameter name must exactly match the declared parameter; typos or case mismatches cause the override to be ignored.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Removing all parameter declarations from the node code to avoid the warning",
      "why_fails": "Without declarations, the node cannot use parameters at all; overrides will still be ignored because there is no declared parameter to accept them.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a declare_parameter() call in the node's constructor for the missing parameter: 'this->declare_parameter<std::string>('my_param', 'default_value');'. Then rebuild and rerun.",
      "success_rate": 0.95,
      "how": "Add a declare_parameter() call in the node's constructor for the missing parameter: 'this->declare_parameter<std::string>('my_param', 'default_value');'. Then rebuild and rerun.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Check the exact parameter name by running 'ros2 param list /node_name' after starting the node to see which parameters are declared, and adjust the override file accordingly.",
      "success_rate": 0.9,
      "how": "Check the exact parameter name by running 'ros2 param list /node_name' after starting the node to see which parameters are declared, and adjust the override file accordingly.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using a launch file, ensure the parameter is passed with the correct namespace: e.g., for node 'my_node', use '/my_node/my_param' in the YAML file.",
      "success_rate": 0.85,
      "how": "If using a launch file, ensure the parameter is passed with the correct namespace: e.g., for node 'my_node', use '/my_node/my_param' in the YAML file.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "在节点的构造函数中添加declare_parameter()调用以声明缺失的参数：'this->declare_parameter<std::string>('my_param', 'default_value');'。然后重新构建并运行。",
    "通过启动节点后运行'ros2 param list /node_name'检查确切的参数名，并相应调整覆盖文件。",
    "如果使用启动文件，确保参数以正确的命名空间传递：例如，对于节点'my_node'，在YAML文件中使用'/my_node/my_param'。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.ros.org/en/humble/Tutorials/Intermediate/Parameters/Understanding-ROS2-Parameters.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2024-02-14",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}