LingxinMeng 1 년 전
부모
커밋
a8753593b7
1개의 변경된 파일26개의 추가작업 그리고 0개의 파일을 삭제
  1. 26 0
      trigger/pji/obstacle_detection/obstacledetection/main/obstacledetection.go

+ 26 - 0
trigger/pji/obstacle_detection/obstacledetection/main/obstacledetection.go

@@ -0,0 +1,26 @@
+package main
+
+import (
+	"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-表示前方有障碍物且局部规划不过去
+	*/
+	if data.Data == 3 {
+		return "obstacledetection"
+	}
+	return ""
+}