LingxinMeng há 1 ano atrás
pai
commit
c57080c493
65 ficheiros alterados com 53 adições e 3694 exclusões
  1. 52 22
      test/main/main.go
  2. 0 68
      trigger/pji/diagnostics/errorcode#2#21030601/main/main.go
  3. 0 68
      trigger/pji/diagnostics/errorcode#2#21030701/main/main.go
  4. 0 68
      trigger/pji/diagnostics/errorcode#2#21030702/main/main.go
  5. 0 68
      trigger/pji/diagnostics/errorcode#2#21030801/main/main.go
  6. 0 68
      trigger/pji/diagnostics/errorcode#2#21030802/main/main.go
  7. 0 68
      trigger/pji/diagnostics/errorcode#2#21031001/main/main.go
  8. 0 68
      trigger/pji/diagnostics/errorcode#2#21031101/main/main.go
  9. 0 68
      trigger/pji/diagnostics/errorcode#2#21031201/main/main.go
  10. 0 68
      trigger/pji/diagnostics/errorcode#2#21031403/main/main.go
  11. 0 68
      trigger/pji/diagnostics/errorcode#2#21031404/main/main.go
  12. 0 68
      trigger/pji/diagnostics/errorcode#2#21040803/main/main.go
  13. 0 68
      trigger/pji/diagnostics/errorcode#2#21041001/main/main.go
  14. 0 68
      trigger/pji/diagnostics/errorcode#2#21041102/main/main.go
  15. 0 68
      trigger/pji/diagnostics/errorcode#2#21050701/main/main.go
  16. 0 68
      trigger/pji/diagnostics/errorcode#2#21050703/main/main.go
  17. 0 68
      trigger/pji/diagnostics/errorcode#2#21050801/main/main.go
  18. 0 68
      trigger/pji/diagnostics/errorcode#2#21051401/main/main.go
  19. 0 68
      trigger/pji/diagnostics/errorcode#2#21051402/main/main.go
  20. 0 68
      trigger/pji/diagnostics/errorcode#4#21050101/main/main.go
  21. 0 68
      trigger/pji/diagnostics/errorcode#4#21050201/main/main.go
  22. 0 68
      trigger/pji/diagnostics/errorcode#4#21050202/main/main.go
  23. 0 68
      trigger/pji/diagnostics/errorcode#4#21050301/main/main.go
  24. 0 68
      trigger/pji/diagnostics/errorcode#5#21030907/main/main.go
  25. 0 68
      trigger/pji/diagnostics/errorcode#5#21030908/main/main.go
  26. 0 68
      trigger/pji/diagnostics/errorcode#5#21031511/main/main.go
  27. 0 68
      trigger/pji/diagnostics/errorcode#5#21031512/main/main.go
  28. 0 68
      trigger/pji/diagnostics/errorcode#5#21031513/main/main.go
  29. 0 68
      trigger/pji/diagnostics/errorcode#5#21031514/main/main.go
  30. 0 68
      trigger/pji/diagnostics/errorcode#5#21031603/main/main.go
  31. 0 68
      trigger/pji/diagnostics/errorcode#5#21031604/main/main.go
  32. 0 68
      trigger/pji/diagnostics/errorcode#5#21031605/main/main.go
  33. 0 68
      trigger/pji/diagnostics/errorcode#5#21041501/main/main.go
  34. 0 68
      trigger/pji/diagnostics/errorcode#5#21041502/main/main.go
  35. 0 68
      trigger/pji/diagnostics/errorcode#5#21041503/main/main.go
  36. 0 68
      trigger/pji/diagnostics/errorcode#5#21041504/main/main.go
  37. 0 68
      trigger/pji/diagnostics/errorcode#5#21041505/main/main.go
  38. 0 68
      trigger/pji/diagnostics/errorcode#5#21041506/main/main.go
  39. 0 68
      trigger/pji/diagnostics/errorcode#5#21041507/main/main.go
  40. 0 68
      trigger/pji/diagnostics/errorcode#5#21041508/main/main.go
  41. 0 68
      trigger/pji/diagnostics/errorcode#5#21041510/main/main.go
  42. 0 68
      trigger/pji/diagnostics/errorcode#5#21041601/main/main.go
  43. 0 68
      trigger/pji/diagnostics/errorcode#5#21041602/main/main.go
  44. 0 68
      trigger/pji/diagnostics/errorcode#5#21041606/main/main.go
  45. 0 68
      trigger/pji/diagnostics/errorcode#5#21050901/main/main.go
  46. 0 68
      trigger/pji/diagnostics/errorcode#5#21050902/main/main.go
  47. 0 68
      trigger/pji/diagnostics/errorcode#5#21050904/main/main.go
  48. 0 68
      trigger/pji/diagnostics/errorcode#5#21050905/main/main.go
  49. 0 68
      trigger/pji/diagnostics/errorcode#5#21050906/main/main.go
  50. 0 68
      trigger/pji/diagnostics/errorcode#5#21051509/main/main.go
  51. 0 68
      trigger/pji/diagnostics/errorcode#5#21051704/main/main.go
  52. 0 68
      trigger/pji/diagnostics/errorcode#5#21051705/main/main.go
  53. 0 68
      trigger/pji/diagnostics/errorcode#5#21051706/main/main.go
  54. 0 68
      trigger/pji/diagnostics/errorcode#5#21051707/main/main.go
  55. 0 68
      trigger/pji/diagnostics/errorcode#5#21051708/main/main.go
  56. 1 0
      trigger/pji/diagnostics/errorcode_1_21031701/main/main.go
  57. 0 0
      trigger/pji/diagnostics/errorcode_1_21031702/main/main.go
  58. 0 0
      trigger/pji/diagnostics/errorcode_2_21020001/main/main.go
  59. 0 0
      trigger/pji/diagnostics/errorcode_2_21020401/main/main.go
  60. 0 0
      trigger/pji/diagnostics/errorcode_2_21020501/main/main.go
  61. 0 0
      trigger/pji/diagnostics/errorcode_2_21020601/main/main.go
  62. 0 0
      trigger/pji/diagnostics/errorcode_2_21021101/main/main.go
  63. 0 0
      trigger/pji/diagnostics/errorcode_2_21030001/main/main.go
  64. 0 0
      trigger/pji/diagnostics/errorcode_2_21030401/main/main.go
  65. 0 0
      trigger/pji/diagnostics/errorcode_2_21030501/main/main.go

+ 52 - 22
test/main/main.go

@@ -1,36 +1,66 @@
 package main
 
 import (
-	"cicv-data-closedloop/common/util"
 	"fmt"
-	"log"
 	"os"
+	"path/filepath"
 	"strings"
 )
 
-// 生成插件命令
+//// 生成插件命令到 sh文件
+//func main() {
+//	//go build --buildmode=plugin -o ./so/pji/errorcode#1#21031701.so ./trigger/pji/diagnostics/errorcode#1#21031701/main/main.go
+//	// 指定目录的路径
+//	dirPath := "D:\\code\\cicv-data-closedloop\\trigger\\pji\\diagnostics"
+//
+//	// 读取目录内容
+//	files, err := os.ReadDir(dirPath)
+//	if err != nil {
+//		log.Fatal(err)
+//	}
+//
+//	// 遍历目录中的文件和子目录
+//	content := ""
+//	for _, file := range files {
+//		// 如果是目录
+//		if file.IsDir() {
+//			// 打印子目录名称
+//
+//			fileName := strings.Replace(strings.Replace(file.Name(), " ", "", -1), "\n", "", -1)
+//			fmt.Println()
+//			content = content + "go build --buildmode=plugin -o ./so/pji/" + fileName + ".so ./trigger/pji/diagnostics/" + fileName + "/main/main.go" + "\n"
+//		}
+//	}
+//	util.WriteFile(content, "D:\\test.sh")
+//}
+
+func replaceSymbolInDir(root string, oldSymbol, newSymbol string) error {
+	return filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
+		if err != nil {
+			return err
+		}
+		if info.IsDir() {
+			// Rename directory
+			newPath := strings.Replace(path, oldSymbol, newSymbol, -1)
+			if newPath != path {
+				fmt.Printf("Renaming %s to %s\n", path, newPath)
+				return os.Rename(path, newPath)
+			}
+		}
+		return nil
+	})
+}
+
 func main() {
-	//go build --buildmode=plugin -o ./so/pji/errorcode#1#21031701.so ./trigger/pji/diagnostics/errorcode#1#21031701/main/main.go
-	// 指定目录的路径
-	dirPath := "D:\\code\\cicv-data-closedloop\\trigger\\pji\\diagnostics"
+	rootDir := "D:\\code\\cicv-data-closedloop\\trigger\\pji\\diagnostics"
+	oldSymbol := "#"
+	newSymbol := "_"
 
-	// 读取目录内容
-	files, err := os.ReadDir(dirPath)
+	err := replaceSymbolInDir(rootDir, oldSymbol, newSymbol)
 	if err != nil {
-		log.Fatal(err)
+		fmt.Println("Error:", err)
+		return
 	}
 
-	// 遍历目录中的文件和子目录
-	content := ""
-	for _, file := range files {
-		// 如果是目录
-		if file.IsDir() {
-			// 打印子目录名称
-
-			fileName := strings.Replace(strings.Replace(file.Name(), " ", "", -1), "\n", "", -1)
-			fmt.Println()
-			content = content + "go build --buildmode=plugin -o ./so/pji/" + fileName + ".so ./trigger/pji/diagnostics/" + fileName + "/main/main.go" + "\n"
-		}
-	}
-	util.WriteFile(content, "D:\\test.sh")
+	fmt.Println("Replacement completed successfully.")
 }

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21030601/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21030701/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21030702/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21030801/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21030802/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21031001/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21031101/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21031201/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21031403/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21031404/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21040803/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21041001/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21041102/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21050701/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21050703/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21050801/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21051401/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#2#21051402/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#4#21050101/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#4#21050201/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#4#21050202/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#4#21050301/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21030907/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21030908/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031511/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031512/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031513/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031514/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031603/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031604/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21031605/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041501/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041502/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041503/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041504/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041505/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041506/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041507/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041508/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041510/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041601/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041602/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21041606/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21050901/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21050902/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21050904/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21050905/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21050906/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21051509/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21051704/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21051705/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21051706/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21051707/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 0 - 68
trigger/pji/diagnostics/errorcode#5#21051708/main/main.go

@@ -1,68 +0,0 @@
-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 ""
-}

+ 1 - 0
trigger/pji/diagnostics/errorcode!1#21031701/main/main.go → trigger/pji/diagnostics/errorcode_1_21031701/main/main.go

@@ -39,6 +39,7 @@ func Topic() string {
 	return "/diagnostics"
 }
 
+// Label 此处用 # 号隔开,包名只支持下划线 _
 func Label() string {
 	return "errorcode#" + errorType + "#" + errorCode
 }

+ 0 - 0
trigger/pji/diagnostics/errorcode#1#21031702/main/main.go → trigger/pji/diagnostics/errorcode_1_21031702/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21020001/main/main.go → trigger/pji/diagnostics/errorcode_2_21020001/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21020401/main/main.go → trigger/pji/diagnostics/errorcode_2_21020401/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21020501/main/main.go → trigger/pji/diagnostics/errorcode_2_21020501/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21020601/main/main.go → trigger/pji/diagnostics/errorcode_2_21020601/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21021101/main/main.go → trigger/pji/diagnostics/errorcode_2_21021101/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21030001/main/main.go → trigger/pji/diagnostics/errorcode_2_21030001/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21030401/main/main.go → trigger/pji/diagnostics/errorcode_2_21030401/main/main.go


+ 0 - 0
trigger/pji/diagnostics/errorcode#2#21030501/main/main.go → trigger/pji/diagnostics/errorcode_2_21030501/main/main.go