|
@@ -52,13 +52,18 @@ func Rule(shareVars *sync.Map) {
|
|
}
|
|
}
|
|
}(shareVars)
|
|
}(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")
|
|
Latitude, ok1 := shareVars.Load("Latitude")
|
|
Longitude, ok2 := shareVars.Load("Longitude")
|
|
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")
|
|
ObjDicOfTpperception, okn := shareVars.Load("objDicOfTpperception")
|
|
ObjDic := ObjDicOfTpperception.(map[uint32][][]float32)
|
|
ObjDic := ObjDicOfTpperception.(map[uint32][][]float32)
|
|
|
|
|
|
if okn && OutsideWorkshopFlag.(bool) == true {
|
|
if okn && OutsideWorkshopFlag.(bool) == true {
|
|
for _, objValue := range ObjDic {
|
|
for _, objValue := range ObjDic {
|
|
Maxlenobj = max(Maxlenobj, int32(len(objValue[0])))
|
|
Maxlenobj = max(Maxlenobj, int32(len(objValue[0])))
|
|
- if len(ObjDic[0]) <= 10 || !isBrake(objValue) {
|
|
|
|
|
|
+ if len(ObjDic[0]) <= 10 || !IsOvertaken(AbsSpeed.(float32), objValue) {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
event_lable := "BeOvertakenInCorner"
|
|
event_lable := "BeOvertakenInCorner"
|