|
@@ -2,9 +2,9 @@ package main
|
|
|
|
|
|
import (
|
|
import (
|
|
"cicv-data-closedloop/pjisuv_msgs"
|
|
"cicv-data-closedloop/pjisuv_msgs"
|
|
- "cicv-data-closedloop/pjisuv_param"
|
|
|
|
"fmt"
|
|
"fmt"
|
|
"math"
|
|
"math"
|
|
|
|
+ "sync"
|
|
)
|
|
)
|
|
|
|
|
|
func Topic() string {
|
|
func Topic() string {
|
|
@@ -35,19 +35,19 @@ var (
|
|
pointlist = []Point{point3, point4, point5, point6, point7, point8}
|
|
pointlist = []Point{point3, point4, point5, point6, point7, point8}
|
|
)
|
|
)
|
|
|
|
|
|
-func Rule(data *pjisuv_msgs.PerceptionLocalization, param *pjisuv_param.PjisuvParam) string {
|
|
|
|
|
|
+func Rule(shareVars *sync.Map, data *pjisuv_msgs.PerceptionLocalization) string {
|
|
defer func() {
|
|
defer func() {
|
|
if r := recover(); r != nil {
|
|
if r := recover(); r != nil {
|
|
fmt.Println("Recovered from panic:", r)
|
|
fmt.Println("Recovered from panic:", r)
|
|
}
|
|
}
|
|
}()
|
|
}()
|
|
if count2%10 == 0 {
|
|
if count2%10 == 0 {
|
|
-
|
|
|
|
enterflag := IfEnter(pointlist, 12.0, data.Latitude, data.Longitude)
|
|
enterflag := IfEnter(pointlist, 12.0, data.Latitude, data.Longitude)
|
|
- if enterflag && param.VelocityXOfCicvLocation >= 1 {
|
|
|
|
- //eventLabel := "EnterTjunction"
|
|
|
|
- //fmt.Println(eventLabel)
|
|
|
|
- return Label()
|
|
|
|
|
|
+ velocityXOfCicvLocation, ok := shareVars.Load("VelocityXOfCicvLocation")
|
|
|
|
+ if ok {
|
|
|
|
+ if enterflag && velocityXOfCicvLocation.(float64) >= 1 {
|
|
|
|
+ return Label()
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
count2++
|
|
count2++
|