LingxinMeng 9 月之前
父節點
當前提交
880103e2ac

+ 8 - 2
trigger/pjisuv/cicv_location/AbnormalStopOnCurve/main/AbnormalStopOnCurve.go

@@ -72,8 +72,14 @@ func Rule(shareVars *sync.Map, data *pjisuv_msgs.PerceptionLocalization) string
 	}()
 	if count1%10 == 0 {
 		Automode, _ := shareVars.Load("AutomodeOfPjVehicleFdbPub")
-		Longitude, _ := shareVars.Load("EndPointX")
-		Latitude, _ := shareVars.Load("EndPointY")
+		Longitude, ok1 := shareVars.Load("EndPointX")
+		if !ok1 {
+			Longitude = 0.0
+		}
+		Latitude, ok2 := shareVars.Load("EndPointY")
+		if !ok2 {
+			Latitude = 0.0
+		}
 		Automode = Automode.(int16)
 		EndPoint.Longitude = Longitude.(float64)
 		EndPoint.Latitude = Latitude.(float64)

+ 8 - 2
trigger/pjisuv/cicv_location/AbnormalStopOnJunction/main/AbnormalStopOnJunction.go

@@ -78,8 +78,14 @@ func Rule(shareVars *sync.Map, data *pjisuv_msgs.PerceptionLocalization) string
 	}()
 	if count1%10 == 0 {
 		Automode, _ := shareVars.Load("AutomodeOfPjVehicleFdbPub")
-		Longitude, _ := shareVars.Load("EndPointX")
-		Latitude, _ := shareVars.Load("EndPointY")
+		Longitude, ok1 := shareVars.Load("EndPointX")
+		if !ok1 {
+			Longitude = 0.0
+		}
+		Latitude, ok2 := shareVars.Load("EndPointY")
+		if !ok2 {
+			Latitude = 0.0
+		}
 		Automode = Automode.(int16)
 		EndPoint.Longitude = Longitude.(float64)
 		EndPoint.Latitude = Latitude.(float64)