|
@@ -10,7 +10,7 @@ func Topic() string {
|
|
|
return "/robot_pose"
|
|
|
}
|
|
|
|
|
|
-// Label todo 禁止存在下划线_
|
|
|
+// 禁止存在下划线_
|
|
|
func Label() string {
|
|
|
return "PassManholeCover"
|
|
|
}
|
|
@@ -38,23 +38,23 @@ func Rule(data *geometry_msgs.PoseStamped) string {
|
|
|
fmt.Println("Recovered from panic:", r)
|
|
|
}
|
|
|
}()
|
|
|
- enterflag := IfEnter(pointlist, 1.5, data.Pose.Position.X, data.Pose.Position.Y)
|
|
|
- if enterflag {
|
|
|
- return "PassManholeCover"
|
|
|
+ //fmt.Println("判断是否覆盖井盖")
|
|
|
+ enterFlag := IfEnter(pointlist, 1.5, data.Pose.Position.X, data.Pose.Position.Y)
|
|
|
+ if enterFlag {
|
|
|
+ return Label()
|
|
|
}
|
|
|
|
|
|
return ""
|
|
|
}
|
|
|
-func IfEnter(pointlist []Point, radius float64, x, y float64) bool {
|
|
|
+func IfEnter(pointList []Point, radius float64, x, y float64) bool {
|
|
|
// 判断是否进入点列表中的区域
|
|
|
point1 := Point{X: x, Y: y}
|
|
|
- for _, point := range pointlist {
|
|
|
+ for _, point := range pointList {
|
|
|
d := distance(point1, point)
|
|
|
if d <= radius {
|
|
|
return true
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return false
|
|
|
}
|
|
|
|