Selaa lähdekoodia

Merge remote-tracking branch 'gogs/master'

LingxinMeng 9 kuukautta sitten
vanhempi
commit
498ed50603

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

@@ -602,7 +602,9 @@ 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)
+						shareVars.Store("AbsSpeed", AbsSpeed)
 						shareVars.Store("AccelXSlice", AccelXSlice)
 						shareVars.Store("VelocityXOfCicvLocation", data.VelocityX)
 						shareVars.Store("VelocityYOfCicvLocation", data.VelocityY)
@@ -1410,7 +1412,7 @@ func ProduceWindow() {
 
 						// 更新共享变量
 						for _, obj := range data.Objs {
-							if obj.X <= 5 || math.Abs(float64(obj.Y)) >= 10 {
+							if math.Abs(float64(obj.X)) >= 30 || math.Abs(float64(obj.Y)) >= 30 {
 								continue
 							}
 							if _, ok := ObjDicOfTpperception[obj.Id]; !ok {

+ 7 - 7
trigger/pjibot_delivery/robot_pose/EnterTjunction/main/EnterTjunction.go

@@ -23,12 +23,12 @@ type Point struct {
 var (
 
 	//定义园区部门T字路口UTM坐标
-	point3 = Point{35.5711, 150.49}
-	point4 = Point{108.108, 197.537}
-	point5 = Point{76.0262, 78.9898}
-	point6 = Point{149.308, 118.211}
-	point7 = Point{105.141, 21.5495}
-	point8 = Point{180.037, 64.8318}
+	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 +39,7 @@ func Rule(data *geometry_msgs.PoseStamped) string {
 			fmt.Println("Recovered from panic:", r)
 		}
 	}()
-	enterflag := IfEnter(pointlist, 15, data.Pose.Position.X, data.Pose.Position.Y)
+	enterflag := IfEnter(pointlist, 20, data.Pose.Position.X, data.Pose.Position.Y)
 	if enterflag {
 		return "EnterTjunction"
 	}

+ 5 - 5
trigger/pjibot_delivery/robot_pose/PassManholeCover/main/PassManholeCover.go

@@ -23,11 +23,11 @@ type Point struct {
 var (
 
 	//定义园区部分井盖UTM坐标
-	point3 = Point{-29.5885, 108.087}
-	point4 = Point{209.923, 210.394}
-	point5 = Point{16.441, -37.0252}
-	point6 = Point{-53.9421, -74.9124}
-	point7 = Point{232.502, 172.084}
+	point3 = Point{-29.5885 + 88.96626338170609, 108.087 + 40.553671177476645}
+	point4 = Point{209.923 + 88.96626338170609, 210.394 + 40.553671177476645}
+	point5 = Point{16.441 + 88.96626338170609, -37.0252 + 40.553671177476645}
+	point6 = Point{-53.9421 + 88.96626338170609, -74.9124 + 40.553671177476645}
+	point7 = Point{232.502 + 88.96626338170609, 172.084 + 40.553671177476645}
 
 	pointlist = []Point{point3, point4, point5, point6, point7}
 )

+ 14 - 8
trigger/pjisuv/cicv_ticker/BeOvertakenInCorner/main/BeOvertakenInCorner.go

@@ -52,13 +52,18 @@ func Rule(shareVars *sync.Map) {
 		}
 	}(shareVars)
 }
-func isBrake(ObjectList [][]float32) bool {
-	for i, speed := range ObjectList[3] {
+func IsOvertaken(AbsSpeed float32, ObjectList [][]float32) bool {
 
-		if math.Abs(float64(ObjectList[1][i])) <= 1.3 && speed >= 3 && ObjectList[0][i] >= 1.3 {
-			for j := 0; j < len(ObjectList[0])-i-1; j++ {
-				if math.Abs(float64(ObjectList[1][1+i+j])) <= 1.3 && ObjectList[3][1+i+j] <= 1 {
-					return true
+	if AbsSpeed > 1.0 {
+		//fmt.Println("yes")
+		//fmt.Println(ObjectList)
+		for i, objX := range ObjectList[0] {
+
+			if math.Abs(float64(ObjectList[1][i])) <= 8 && objX <= -2 {
+				for j := 0; j < len(ObjectList[0])-i-1; j++ {
+					if math.Abs(float64(ObjectList[1][1+i+j])) <= 8 && ObjectList[0][1+i+j] >= 2.5 {
+						return true
+					}
 				}
 			}
 		}
@@ -99,15 +104,16 @@ func FinalCallback(shareVars *sync.Map) {
 
 	Latitude, ok1 := shareVars.Load("Latitude")
 	Longitude, ok2 := shareVars.Load("Longitude")
+	AbsSpeed, ok3 := shareVars.Load("AbsSpeed")
 
-	if ok && ok1 && ok2 && IfEnter(pointlist1, 50, Latitude.(float64), Longitude.(float64)) {
+	if ok && ok1 && ok2 && ok3 && IfEnter(pointlist1, 50, Latitude.(float64), Longitude.(float64)) {
 		ObjDicOfTpperception, okn := shareVars.Load("objDicOfTpperception")
 		ObjDic := ObjDicOfTpperception.(map[uint32][][]float32)
 
 		if okn && OutsideWorkshopFlag.(bool) == true {
 			for _, objValue := range ObjDic {
 				Maxlenobj = max(Maxlenobj, int32(len(objValue[0])))
-				if len(ObjDic[0]) <= 10 || !isBrake(objValue) {
+				if len(ObjDic[0]) <= 10 || !IsOvertaken(AbsSpeed.(float32), objValue) {
 					continue
 				}
 				event_lable := "BeOvertakenInCorner"