{
  "id": "ros2/ros2-topic-statistics-mismatch",
  "signature": "[WARN] [topic_statistics]: Received message on topic '/scan' with sequence number 123, expected 124",
  "signature_zh": "[WARN] [topic_statistics]: 在主题 '/scan' 上收到序列号 123 的消息，期望 124",
  "regex": "\\[topic_statistics\\]: Received message on topic '([^']+)' with sequence number (\\d+), expected (\\d+)",
  "domain": "ros2",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "Topic statistics monitoring detected a gap in message sequence numbers, indicating dropped messages or out-of-order delivery, often due to network congestion, high CPU load, or QoS incompatibility.",
  "root_cause_type": "generic",
  "root_cause_zh": "主题统计监控检测到消息序列号有间隔，表示消息丢失或乱序传递，通常由于网络拥塞、CPU 负载高或 QoS 不兼容导致。",
  "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:rolling",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rclcpp:18.0.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Disabling topic statistics without investigating the root cause",
      "why_fails": "This hides the symptom but does not address the underlying message loss, which may affect application behavior.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increasing the publisher's publishing rate to compensate",
      "why_fails": "Higher rate increases network and CPU load, potentially worsening the problem.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check network bandwidth and CPU usage. If high, reduce the publishing rate or use a more efficient serialization. Example:\nros2 topic hz /scan  # Check current rate\nros2 topic bw /scan   # Check bandwidth\n\nIf bandwidth is high, adjust the publisher to use a lower rate or reduce message size.",
      "success_rate": 0.75,
      "how": "Check network bandwidth and CPU usage. If high, reduce the publishing rate or use a more efficient serialization. Example:\nros2 topic hz /scan  # Check current rate\nros2 topic bw /scan   # Check bandwidth\n\nIf bandwidth is high, adjust the publisher to use a lower rate or reduce message size.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If using unreliable QoS (e.g., BEST_EFFORT), switch to RELIABLE QoS to reduce drops. In publisher code:\nfrom rclpy.qos import QoSProfile, ReliabilityPolicy\n\nqos = QoSProfile(depth=10, reliability=ReliabilityPolicy.RELIABLE)\nself.publisher = self.create_publisher(LaserScan, '/scan', qos)",
      "success_rate": 0.85,
      "how": "If using unreliable QoS (e.g., BEST_EFFORT), switch to RELIABLE QoS to reduce drops. In publisher code:\nfrom rclpy.qos import QoSProfile, ReliabilityPolicy\n\nqos = QoSProfile(depth=10, reliability=ReliabilityPolicy.RELIABLE)\nself.publisher = self.create_publisher(LaserScan, '/scan', qos)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查网络带宽和 CPU 使用率。如果过高，降低发布速率或使用更高效的序列化。示例：\nros2 topic hz /scan  # 检查当前速率\nros2 topic bw /scan   # 检查带宽\n\n如果带宽高，调整发布器使用较低速率或减小消息大小。",
    "如果使用不可靠的 QoS（例如 BEST_EFFORT），切换到 RELIABLE QoS 以减少丢失。在发布器代码中：\nfrom rclpy.qos import QoSProfile, ReliabilityPolicy\n\nqos = QoSProfile(depth=10, reliability=ReliabilityPolicy.RELIABLE)\nself.publisher = self.create_publisher(LaserScan, '/scan', qos)"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.ros.org/en/humble/Tutorials/Intermediate/Topic-Statistics.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-03-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}