Przeglądaj źródła

modify pjiout Tjuction trigger

zwh 9 miesięcy temu
rodzic
commit
0cf18dc133

+ 1 - 2
aarch64/pjisuv/master/service/produce_window.go

@@ -601,9 +601,8 @@ func ProduceWindow() {
 						}
 						subscribersTimeMutexes[i].Unlock()
 						// 更新共享变量
-						AbsAccel := math.Sqrt(math.Pow(data.AccelX, 2) + math.Pow(data.AccelY, 2))
 						AbsSpeed := math.Sqrt(math.Pow(data.VelocityX, 2) + math.Pow(data.VelocityY, 2))
-						AccelXSlice = append(AccelXSlice, AbsAccel)
+						AccelXSlice = append(AccelXSlice, data.AccelX)
 						shareVars.Store("AbsSpeed", AbsSpeed)
 						shareVars.Store("AccelXSlice", AccelXSlice)
 						shareVars.Store("VelocityXOfCicvLocation", data.VelocityX)

+ 11 - 8
trigger/pjibot_delivery/robot_pose/EnterTjunction/main/EnterTjunction.go

@@ -23,12 +23,13 @@ type Point struct {
 var (
 
 	//定义园区部门T字路口UTM坐标
-	point3 = Point{35.5711 + 88.96626338170609, 150.49 + 40.553671177476645}
-	point4 = Point{108.108 + 88.96626338170609, 197.537 + 40.553671177476645}
-	point5 = Point{76.0262 + 88.96626338170609, 78.9898 + 40.553671177476645}
-	point6 = Point{149.308 + 88.96626338170609, 118.211 + 40.553671177476645}
-	point7 = Point{105.141 + 88.96626338170609, 21.5495 + 40.553671177476645}
-	point8 = Point{180.037 + 88.96626338170609, 64.8318 + 40.553671177476645}
+	mindistance float64 = 999
+	point3              = Point{35.5711 + 88.96626338170609, 150.49 + 40.553671177476645}
+	point4              = Point{108.108 + 88.96626338170609, 197.537 + 40.553671177476645}
+	point5              = Point{76.0262 + 88.96626338170609, 78.9898 + 40.553671177476645}
+	point6              = Point{149.308 + 88.96626338170609, 118.211 + 40.553671177476645}
+	point7              = Point{105.141 + 88.96626338170609, 21.5495 + 40.553671177476645}
+	point8              = Point{180.037 + 88.96626338170609, 64.8318 + 40.553671177476645}
 
 	pointlist = []Point{point3, point4, point5, point6, point7, point8}
 )
@@ -39,7 +40,7 @@ func Rule(data *geometry_msgs.PoseStamped) string {
 			fmt.Println("Recovered from panic:", r)
 		}
 	}()
-	enterflag := IfEnter(pointlist, 20, data.Pose.Position.X, data.Pose.Position.Y)
+	enterflag := IfEnter(pointlist, 15, data.Pose.Position.X, data.Pose.Position.Y)
 	if enterflag {
 		return "EnterTjunction"
 	}
@@ -51,16 +52,18 @@ func IfEnter(pointlist []Point, radius float64, x, y float64) bool {
 	point1 := Point{X: x, Y: y}
 	for _, point := range pointlist {
 		d := distance(point1, point)
+		mindistance = min(d, mindistance)
 		if d <= radius {
 			return true
 		}
 	}
+	fmt.Printf("mindistance=%f", mindistance)
+	mindistance = 999.0
 	return false
 }
 
 // 计算两点之间的距离(米)
 func distance(point1, point2 Point) float64 {
 	d := math.Sqrt((point2.X-point1.X)*(point2.X-point1.X) + (point2.Y-point1.Y)*(point2.Y-point1.Y))
-
 	return d
 }

+ 1 - 0
trigger/pjibot_delivery/robot_pose/PassManholeCover/main/PassManholeCover.go

@@ -54,6 +54,7 @@ func IfEnter(pointlist []Point, radius float64, x, y float64) bool {
 			return true
 		}
 	}
+
 	return false
 }
 

+ 1 - 1
trigger/pjisuv/cicv_ticker/FrontVehicleCutInFar/main/FrontVehicleCutInFar.go

@@ -49,7 +49,7 @@ func isCuttingIn(ObjectList [][]float32, AngularVelocityZ float64) bool {
 
 	for i, objY := range ObjectList[1] {
 
-		if math.Abs(float64(objY)) >= 1.3 && math.Abs(AngularVelocityZ) <= 0.6 && ObjectList[0][i] >= 2 {
+		if math.Abs(float64(objY)) >= 1.8 && math.Abs(AngularVelocityZ) <= 0.6 && ObjectList[0][i] >= 2 {
 			//fmt.Println(objY)
 			for j := 0; j < len(ObjectList[1])-i-1; j++ {
 				objX := ObjectList[0][1+i+j]

+ 1 - 1
trigger/pjisuv/cicv_ticker/FrontVehicleCutInNear/main/FrontVehicleCutInNear.go

@@ -49,7 +49,7 @@ func isCuttingIn(ObjectList [][]float32, AngularVelocityZ float64) bool {
 
 	for i, objY := range ObjectList[1] {
 
-		if math.Abs(float64(objY)) >= 1.3 && math.Abs(AngularVelocityZ) <= 0.6 && ObjectList[0][i] >= 2 {
+		if math.Abs(float64(objY)) >= 1.8 && math.Abs(AngularVelocityZ) <= 0.6 && ObjectList[0][i] >= 2 {
 			//fmt.Println(objY)
 			for j := 0; j < len(ObjectList[1])-i-1; j++ {
 				objX := ObjectList[0][1+i+j]