|
@@ -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 ""
|
|
|
|
+}
|