cicv 2 ay önce
ebeveyn
işleme
d53ceb48a8
100 değiştirilmiş dosya ile 4495 ekleme ve 160 silme
  1. 1 2
      aarch64/pjibot_clean/master/package/config/trigger_init.go
  2. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/Accel.msg
  3. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/AccelStamped.msg
  4. 0 9
      pjibot_clean_msgs/geometry_msgs_msg/AccelWithCovariance.msg
  5. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/AccelWithCovarianceStamped.msg
  6. 0 16
      pjibot_clean_msgs/geometry_msgs_msg/Inertia.msg
  7. 0 2
      pjibot_clean_msgs/geometry_msgs_msg/InertiaStamped.msg
  8. 0 4
      pjibot_clean_msgs/geometry_msgs_msg/Point.msg
  9. 0 11
      pjibot_clean_msgs/geometry_msgs_msg/Point32.msg
  10. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/PointStamped.msg
  11. 0 2
      pjibot_clean_msgs/geometry_msgs_msg/Polygon.msg
  12. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/PolygonStamped.msg
  13. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/Pose.msg
  14. 0 13
      pjibot_clean_msgs/geometry_msgs_msg/Pose2D.msg
  15. 0 5
      pjibot_clean_msgs/geometry_msgs_msg/PoseArray.msg
  16. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/PoseStamped.msg
  17. 0 9
      pjibot_clean_msgs/geometry_msgs_msg/PoseWithCovariance.msg
  18. 0 4
      pjibot_clean_msgs/geometry_msgs_msg/PoseWithCovarianceStamped.msg
  19. 0 6
      pjibot_clean_msgs/geometry_msgs_msg/Quaternion.msg
  20. 0 4
      pjibot_clean_msgs/geometry_msgs_msg/QuaternionStamped.msg
  21. 0 4
      pjibot_clean_msgs/geometry_msgs_msg/Transform.msg
  22. 0 10
      pjibot_clean_msgs/geometry_msgs_msg/TransformStamped.msg
  23. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/Twist.msg
  24. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/TwistStamped.msg
  25. 0 9
      pjibot_clean_msgs/geometry_msgs_msg/TwistWithCovariance.msg
  26. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/TwistWithCovarianceStamped.msg
  27. 0 10
      pjibot_clean_msgs/geometry_msgs_msg/Vector3.msg
  28. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/Vector3Stamped.msg
  29. 0 4
      pjibot_clean_msgs/geometry_msgs_msg/Wrench.msg
  30. 0 3
      pjibot_clean_msgs/geometry_msgs_msg/WrenchStamped.msg
  31. 69 0
      trigger/pjibot_clean/diagnostics/errorcode_1_21031701/main/main.go
  32. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_1_21031702/main/main.go
  33. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21020001/main/main.go
  34. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21020401/main/main.go
  35. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21020501/main/main.go
  36. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21020601/main/main.go
  37. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21021101/main/main.go
  38. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030001/main/main.go
  39. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030401/main/main.go
  40. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030501/main/main.go
  41. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030601/main/main.go
  42. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030701/main/main.go
  43. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030702/main/main.go
  44. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030801/main/main.go
  45. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21030802/main/main.go
  46. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21031001/main/main.go
  47. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21031101/main/main.go
  48. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21031201/main/main.go
  49. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21031403/main/main.go
  50. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21031404/main/main.go
  51. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21040803/main/main.go
  52. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21041001/main/main.go
  53. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21041102/main/main.go
  54. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21050701/main/main.go
  55. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21050703/main/main.go
  56. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21050801/main/main.go
  57. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21051401/main/main.go
  58. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_2_21051402/main/main.go
  59. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_4_21050101/main/main.go
  60. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_4_21050201/main/main.go
  61. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_4_21050202/main/main.go
  62. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_4_21050301/main/main.go
  63. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21030907/main/main.go
  64. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21030908/main/main.go
  65. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031511/main/main.go
  66. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031512/main/main.go
  67. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031513/main/main.go
  68. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031514/main/main.go
  69. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031603/main/main.go
  70. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031604/main/main.go
  71. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21031605/main/main.go
  72. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041501/main/main.go
  73. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041502/main/main.go
  74. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041503/main/main.go
  75. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041504/main/main.go
  76. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041505/main/main.go
  77. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041506/main/main.go
  78. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041507/main/main.go
  79. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041508/main/main.go
  80. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041510/main/main.go
  81. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041601/main/main.go
  82. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041602/main/main.go
  83. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21041606/main/main.go
  84. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21050901/main/main.go
  85. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21050902/main/main.go
  86. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21050904/main/main.go
  87. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21050905/main/main.go
  88. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21050906/main/main.go
  89. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21051509/main/main.go
  90. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21051704/main/main.go
  91. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21051705/main/main.go
  92. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21051706/main/main.go
  93. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21051707/main/main.go
  94. 68 0
      trigger/pjibot_clean/diagnostics/errorcode_5_21051708/main/main.go
  95. 21 0
      trigger/pjibot_clean/imu/unstabledriving/main/main.go
  96. 18 0
      trigger/pjibot_clean/locate_info/locationfailed/main/main.go
  97. 22 0
      trigger/pjibot_clean/move_base_status/navfailed/main/main.go
  98. 36 0
      trigger/pjibot_clean/obstacle_detection/obstacledetection/main/obstacledetection.go
  99. 24 0
      trigger/pjibot_clean/odom/overspeed/main/main.go
  100. 20 0
      trigger/pjibot_clean/sys_info/cpuoveroccupied/main/main.go

+ 1 - 2
aarch64/pjibot_clean/master/package/config/trigger_init.go

@@ -601,7 +601,6 @@ var (
 	Topic283 = "/xd1a_2"
 	Topic284 = "/xd1a_3"
 
-
 	Rule1   []func(data *std_msgs.Int16MultiArray) string
 	Rule2   []func(data *geometry_msgs.PoseStamped) string
 	Rule3   []func(data *dynamic_reconfigure.ConfigDescription) string
@@ -2602,7 +2601,7 @@ func InitTriggerConfig() {
 			log(triggerLocalPath)
 			continue
 		} else if Topic236 == topic2 { // 1
-			if f, ok1 := rule.(func(data *rosgraph_msgs.Log.Log) string); ok1 {
+			if f, ok1 := rule.(func(data *rosgraph_msgs.Log) string); ok1 {
 				Rule236 = append(Rule236, f)
 				goto JudgeDone
 			}

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/Accel.msg

@@ -1,3 +0,0 @@
-# This expresses acceleration in free space broken into its linear and angular parts.
-Vector3  linear
-Vector3  angular

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/AccelStamped.msg

@@ -1,3 +0,0 @@
-# An accel with reference coordinate frame and timestamp
-Header header
-Accel accel

+ 0 - 9
pjibot_clean_msgs/geometry_msgs_msg/AccelWithCovariance.msg

@@ -1,9 +0,0 @@
-# This expresses acceleration in free space with uncertainty.
-
-Accel accel
-
-# Row-major representation of the 6x6 covariance matrix
-# The orientation parameters use a fixed-axis representation.
-# In order, the parameters are:
-# (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
-float64[36] covariance

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/AccelWithCovarianceStamped.msg

@@ -1,3 +0,0 @@
-# This represents an estimated accel with reference coordinate frame and timestamp.
-Header header
-AccelWithCovariance accel

+ 0 - 16
pjibot_clean_msgs/geometry_msgs_msg/Inertia.msg

@@ -1,16 +0,0 @@
-# Mass [kg]
-float64 m
-
-# Center of mass [m]
-geometry_msgs/Vector3 com
-
-# Inertia Tensor [kg-m^2]
-#     | ixx ixy ixz |
-# I = | ixy iyy iyz |
-#     | ixz iyz izz |
-float64 ixx
-float64 ixy
-float64 ixz
-float64 iyy
-float64 iyz
-float64 izz

+ 0 - 2
pjibot_clean_msgs/geometry_msgs_msg/InertiaStamped.msg

@@ -1,2 +0,0 @@
-Header header
-Inertia inertia

+ 0 - 4
pjibot_clean_msgs/geometry_msgs_msg/Point.msg

@@ -1,4 +0,0 @@
-# This contains the position of a point in free space
-float64 x
-float64 y
-float64 z

+ 0 - 11
pjibot_clean_msgs/geometry_msgs_msg/Point32.msg

@@ -1,11 +0,0 @@
-# This contains the position of a point in free space(with 32 bits of precision).
-# It is recommeded to use Point wherever possible instead of Point32.  
-# 
-# This recommendation is to promote interoperability.  
-#
-# This message is designed to take up less space when sending
-# lots of points at once, as in the case of a PointCloud.  
-
-float32 x
-float32 y
-float32 z

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/PointStamped.msg

@@ -1,3 +0,0 @@
-# This represents a Point with reference coordinate frame and timestamp
-Header header
-Point point

+ 0 - 2
pjibot_clean_msgs/geometry_msgs_msg/Polygon.msg

@@ -1,2 +0,0 @@
-#A specification of a polygon where the first and last points are assumed to be connected
-Point32[] points

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/PolygonStamped.msg

@@ -1,3 +0,0 @@
-# This represents a Polygon with reference coordinate frame and timestamp
-Header header
-Polygon polygon

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/Pose.msg

@@ -1,3 +0,0 @@
-# A representation of pose in free space, composed of position and orientation. 
-Point position
-Quaternion orientation

+ 0 - 13
pjibot_clean_msgs/geometry_msgs_msg/Pose2D.msg

@@ -1,13 +0,0 @@
-# Deprecated
-# Please use the full 3D pose.
-
-# In general our recommendation is to use a full 3D representation of everything and for 2D specific applications make the appropriate projections into the plane for their calculations but optimally will preserve the 3D information during processing.
-
-# If we have parallel copies of 2D datatypes every UI and other pipeline will end up needing to have dual interfaces to plot everything. And you will end up with not being able to use 3D tools for 2D use cases even if they're completely valid, as you'd have to reimplement it with different inputs and outputs. It's not particularly hard to plot the 2D pose or compute the yaw error for the Pose message and there are already tools and libraries that can do this for you.
-
-
-# This expresses a position and orientation on a 2D manifold.
-
-float64 x
-float64 y
-float64 theta

+ 0 - 5
pjibot_clean_msgs/geometry_msgs_msg/PoseArray.msg

@@ -1,5 +0,0 @@
-# An array of poses with a header for global reference.
-
-Header header
-
-Pose[] poses

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/PoseStamped.msg

@@ -1,3 +0,0 @@
-# A Pose with reference coordinate frame and timestamp
-Header header
-Pose pose

+ 0 - 9
pjibot_clean_msgs/geometry_msgs_msg/PoseWithCovariance.msg

@@ -1,9 +0,0 @@
-# This represents a pose in free space with uncertainty.
-
-Pose pose
-
-# Row-major representation of the 6x6 covariance matrix
-# The orientation parameters use a fixed-axis representation.
-# In order, the parameters are:
-# (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
-float64[36] covariance

+ 0 - 4
pjibot_clean_msgs/geometry_msgs_msg/PoseWithCovarianceStamped.msg

@@ -1,4 +0,0 @@
-# This expresses an estimated pose with a reference coordinate frame and timestamp
-
-Header header
-PoseWithCovariance pose

+ 0 - 6
pjibot_clean_msgs/geometry_msgs_msg/Quaternion.msg

@@ -1,6 +0,0 @@
-# This represents an orientation in free space in quaternion form.
-
-float64 x
-float64 y
-float64 z
-float64 w

+ 0 - 4
pjibot_clean_msgs/geometry_msgs_msg/QuaternionStamped.msg

@@ -1,4 +0,0 @@
-# This represents an orientation with reference coordinate frame and timestamp.
-
-Header header
-Quaternion quaternion

+ 0 - 4
pjibot_clean_msgs/geometry_msgs_msg/Transform.msg

@@ -1,4 +0,0 @@
-# This represents the transform between two coordinate frames in free space.
-
-Vector3 translation
-Quaternion rotation

+ 0 - 10
pjibot_clean_msgs/geometry_msgs_msg/TransformStamped.msg

@@ -1,10 +0,0 @@
-# This expresses a transform from coordinate frame header.frame_id
-# to the coordinate frame child_frame_id
-#
-# This message is mostly used by the 
-# <a href="http://wiki.ros.org/tf">tf</a> package. 
-# See its documentation for more information.
-
-Header header
-string child_frame_id # the frame id of the child frame
-Transform transform

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/Twist.msg

@@ -1,3 +0,0 @@
-# This expresses velocity in free space broken into its linear and angular parts.
-Vector3  linear
-Vector3  angular

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/TwistStamped.msg

@@ -1,3 +0,0 @@
-# A twist with reference coordinate frame and timestamp
-Header header
-Twist twist

+ 0 - 9
pjibot_clean_msgs/geometry_msgs_msg/TwistWithCovariance.msg

@@ -1,9 +0,0 @@
-# This expresses velocity in free space with uncertainty.
-
-Twist twist
-
-# Row-major representation of the 6x6 covariance matrix
-# The orientation parameters use a fixed-axis representation.
-# In order, the parameters are:
-# (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)
-float64[36] covariance

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/TwistWithCovarianceStamped.msg

@@ -1,3 +0,0 @@
-# This represents an estimated twist with reference coordinate frame and timestamp.
-Header header
-TwistWithCovariance twist

+ 0 - 10
pjibot_clean_msgs/geometry_msgs_msg/Vector3.msg

@@ -1,10 +0,0 @@
-# This represents a vector in free space. 
-# It is only meant to represent a direction. Therefore, it does not
-# make sense to apply a translation to it (e.g., when applying a 
-# generic rigid transformation to a Vector3, tf2 will only apply the
-# rotation). If you want your data to be translatable too, use the
-# geometry_msgs/Point message instead.
-
-float64 x
-float64 y
-float64 z

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/Vector3Stamped.msg

@@ -1,3 +0,0 @@
-# This represents a Vector3 with reference coordinate frame and timestamp
-Header header
-Vector3 vector

+ 0 - 4
pjibot_clean_msgs/geometry_msgs_msg/Wrench.msg

@@ -1,4 +0,0 @@
-# This represents force in free space, separated into
-# its linear and angular parts.
-Vector3  force
-Vector3  torque

+ 0 - 3
pjibot_clean_msgs/geometry_msgs_msg/WrenchStamped.msg

@@ -1,3 +0,0 @@
-# A wrench with reference coordinate frame and timestamp
-Header header
-Wrench wrench

+ 69 - 0
trigger/pjibot_clean/diagnostics/errorcode_1_21031701/main/main.go

@@ -0,0 +1,69 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+输入电源欠压
+*/
+
+var (
+	errorType       = "1"
+	errorCode       = "21031701"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+// Label 此处用 # 号隔开,包名只支持下划线 _
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_1_21031702/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+输入电源过压
+*/
+
+var (
+	errorType       = "1"
+	errorCode       = "21031702"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21020001/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+电池数据通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21020001"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21020401/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+imu通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21020401"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21020501/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+odom通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21020501"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21020601/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+motor通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21020601"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21021101/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+电驱通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21021101"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030001/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+电池数据通讯超时丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030001"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030401/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+imu通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030401"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030501/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+odom通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030501"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030601/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+motor通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030601"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030701/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+防跌落传感器通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030701"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030702/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+防跌落传感器数值异常
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030702"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030801/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+超声波传感器通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030801"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21030802/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+超声波传感器数值异常
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21030802"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21031001/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+激光雷达通讯轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21031001"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21031101/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+电驱通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21031101"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21031201/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+红外数据返回超时
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21031201"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21031403/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+深度相机1数据轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21031403"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21031404/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+深度相机2数据轻微丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21031404"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21040803/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+超声波数据返回超时
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21040803"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21041001/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+激光雷达通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21041001"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21041102/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+电驱数据返回超时
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21041102"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21050701/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+防跌落传感器通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21050701"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21050703/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+防跌落数据返回超时
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21050703"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21050801/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+超声波传感器通讯严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21050801"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21051401/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+深度相机1数据严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21051401"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_2_21051402/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+深度相机2数据严重丢失
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21051402"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_4_21050101/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+与云端通讯丢失
+*/
+
+var (
+	errorType       = "4"
+	errorCode       = "21050101"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_4_21050201/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+与计算平台网关通讯异常
+*/
+
+var (
+	errorType       = "4"
+	errorCode       = "21050201"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_4_21050202/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+4G卡号读不到
+*/
+
+var (
+	errorType       = "4"
+	errorCode       = "21050202"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_4_21050301/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+与计算平台MCU通讯丢失
+*/
+
+var (
+	errorType       = "4"
+	errorCode       = "21050301"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21030907/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+定位警告
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21030907"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21030908/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+定位状态未初始化
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21030908"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031511/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+机器人进入不可行区域
+*/
+
+var (
+	errorType       = "2"
+	errorCode       = "21031511"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031512/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+未得到局部规划路径
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21031512"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031513/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+无法旋转至起点姿态
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21031513"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031514/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+无法旋转至目标点姿态
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21031514"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031603/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+cpu占用过高(高于90%)或内存占用过高(高于80%)
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21031603"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031604/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+系统信息轻微超时
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21031604"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21031605/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+系统信息严重超时
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21031605"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041501/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+全局规划器构造失败
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041501"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041502/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+局部规划器构造失败
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041502"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041503/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+目标点四元数格式不合法
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041503"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041504/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+未得到全局规划路径
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041504"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041505/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+电驱通讯轻微丢失
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041505"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041506/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+未得到全局规划路径 - 目标点位被占据
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041506"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041507/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+未得到全局规划路径 - 地图上无可通行的通道
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041507"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041508/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+costmap的观察缓冲区不是最新的
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041508"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041510/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+全局规划路径碰撞
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041510"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041601/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+cartographer节点通讯中断(可去除)
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041601"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041602/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+	move_base节点中断
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041602"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21041606/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+自动充电节点通讯中断
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21041606"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21050901/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+定位丢失
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21050901"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21050902/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+定位失败
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21050902"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21050904/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+地图内丢定位
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21050904"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21050905/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+地图外丢定位
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21050905"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21050906/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+匹配点不够丢定位
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21050906"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21051509/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+全局路径转换失败
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21051509"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21051704/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+识别阶段未识别充电桩
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21051704"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21051705/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+靠近时未识别到充电桩,超时
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21051705"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21051706/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+旋转阶段超时
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21051706"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21051707/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+后退超时,未到充电桩
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21051707"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 68 - 0
trigger/pjibot_clean/diagnostics/errorcode_5_21051708/main/main.go

@@ -0,0 +1,68 @@
+package main
+
+import (
+	"fmt"
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/diagnostic_msgs"
+	"strconv"
+)
+
+/*
+后退时未识别到红外,超时
+*/
+
+var (
+	errorType       = "5"
+	errorCode       = "21051708"
+	code12          = "21"
+	hardwareIdIndex = map[string]string{
+		"batter":        "00",
+		"cloud":         "01",
+		"gateway":       "02",
+		"mcu":           "03",
+		"imu":           "04",
+		"odom":          "05",
+		"motor":         "06",
+		"preventFall":   "07",
+		"sonar":         "08",
+		"locate":        "09",
+		"laserLadar":    "10",
+		"electricDrive": "11",
+		"infrared":      "12",
+		"livoxLidar":    "13",
+		"camera":        "14",
+		"navigation":    "15",
+		"system":        "16",
+	}
+)
+
+func Topic() string {
+	return "/diagnostics"
+}
+
+func Label() string {
+	return "errorcode#" + errorType + "#" + errorCode
+}
+
+func Rule(data *diagnostic_msgs.DiagnosticArray) string {
+	if len(data.Status) == 0 {
+		return ""
+	}
+	for _, status := range data.Status {
+		if status.Level != 5 || len(status.Values) == 0 {
+			continue
+		}
+
+		code34 := fmt.Sprintf("%02d", status.Level)
+		code56 := hardwareIdIndex[status.HardwareId]
+		intVal, err := strconv.Atoi(status.Values[1].Value)
+		if err != nil {
+			fmt.Println("字段 【status.Values[1].Value】转整数报错:", err)
+			return ""
+		}
+		code78 := fmt.Sprintf("%02d", intVal)
+		if errorCode == code12+code34+code56+code78 {
+			return Label()
+		}
+	}
+	return ""
+}

+ 21 - 0
trigger/pjibot_clean/imu/unstabledriving/main/main.go

@@ -0,0 +1,21 @@
+package main
+
+import (
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/sensor_msgs"
+	"math"
+)
+
+func Topic() string {
+	return "/imu"
+}
+
+func Label() string {
+	return "unstabledriving"
+}
+
+func Rule(data *sensor_msgs.Imu) string {
+	if math.Abs(data.LinearAcceleration.X) >= 0.7 && math.Abs(data.LinearAcceleration.Y) >= 0.7 {
+		return "unstabledriving"
+	}
+	return ""
+}

+ 18 - 0
trigger/pjibot_clean/locate_info/locationfailed/main/main.go

@@ -0,0 +1,18 @@
+package main
+
+import "cicv-data-closedloop/pjibot_guide_msgs"
+
+func Topic() string {
+	return "/locate_info"
+}
+
+func Label() string {
+	return "locationfailed"
+}
+
+func Rule(data *pjibot_guide_msgs.LocateInfo) string {
+	if data.LocateStatus == 0 {
+		return "locationfailed"
+	}
+	return ""
+}

+ 22 - 0
trigger/pjibot_clean/move_base_status/navfailed/main/main.go

@@ -0,0 +1,22 @@
+package main
+
+import (
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/actionlib_msgs"
+)
+
+func Topic() string {
+	return "/move_base/status"
+}
+
+func Label() string {
+	return "navfailed"
+}
+
+func Rule(data *actionlib_msgs.GoalStatusArray) string {
+	for _, status := range data.StatusList {
+		if status.Status == 5 {
+			return "navfailed"
+		}
+	}
+	return ""
+}

+ 36 - 0
trigger/pjibot_clean/obstacle_detection/obstacledetection/main/obstacledetection.go

@@ -0,0 +1,36 @@
+package main
+
+import (
+	"fmt"
+
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/std_msgs"
+)
+
+func Topic() string {
+	return "/obstacle_detection"
+}
+
+func Label() string {
+	return "obstacledetection"
+}
+
+func Rule(data *std_msgs.UInt8) string {
+	/*
+		0-表示导航前方无障碍物,
+		1-表示找不到全局路径
+		2-表示前方有障碍物但能绕过去
+		3-表示前方有障碍物且局部规划不过去
+	*/
+	switch data.Data {
+	case 0:
+		fmt.Println("无法避障触发器的当前状态为 0,表示导航前方无障碍物")
+	case 1:
+		fmt.Println("无法避障触发器的当前状态为 1,表示找不到全局路径")
+	case 2:
+		fmt.Println("无法避障触发器的当前状态为 2,表示前方有障碍物但能绕过去")
+	case 3:
+		fmt.Println("无法避障触发器的当前状态为 3,表示前方有障碍物且局部规划不过去")
+		return "obstacledetection"
+	}
+	return ""
+}

+ 24 - 0
trigger/pjibot_clean/odom/overspeed/main/main.go

@@ -0,0 +1,24 @@
+package main
+
+import (
+	"github.com/bluenviron/goroslib/v2/pkg/msgs/nav_msgs"
+	"math"
+)
+
+func Topic() string {
+	return "/odom"
+}
+
+func Label() string {
+	return "overspeed"
+}
+
+func Rule(data *nav_msgs.Odometry) string {
+	velocityX := data.Twist.Twist.Linear.X
+	velocityY := data.Twist.Twist.Linear.Y
+	absV := math.Pow(math.Pow(velocityX, 2)+math.Pow(velocityY, 2), 0.5)
+	if absV*3.6 > 0 {
+		return "overspeed"
+	}
+	return ""
+}

+ 20 - 0
trigger/pjibot_clean/sys_info/cpuoveroccupied/main/main.go

@@ -0,0 +1,20 @@
+package main
+
+import (
+	"cicv-data-closedloop/pjibot_guide_msgs"
+)
+
+func Topic() string {
+	return "/sys_info"
+}
+
+func Label() string {
+	return "cpuoveroccupied"
+}
+
+func Rule(data *pjibot_guide_msgs.SysInfo) string {
+	if data.CpuOccupied > 99 {
+		return "cpuoveroccupied"
+	}
+	return ""
+}

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor