|
@@ -35,7 +35,7 @@ var (
|
|
cicvLocationTime = time.Now()
|
|
cicvLocationTime = time.Now()
|
|
// -----------------------------共享变量
|
|
// -----------------------------共享变量
|
|
// /tpperception
|
|
// /tpperception
|
|
- objDicOfTpperception = make(map[uint32][]float32)
|
|
|
|
|
|
+ ObjDicOfTpperception = make(map[uint32][][]float32)
|
|
objTypeDicOfTpperception = make(map[uint32]uint8)
|
|
objTypeDicOfTpperception = make(map[uint32]uint8)
|
|
objSpeedDicOfTpperception = make(map[uint32]float64)
|
|
objSpeedDicOfTpperception = make(map[uint32]float64)
|
|
// /pji_control_pub
|
|
// /pji_control_pub
|
|
@@ -1405,14 +1405,17 @@ func ProduceWindow() {
|
|
if obj.X <= 5 || math.Abs(float64(obj.Y)) >= 10 {
|
|
if obj.X <= 5 || math.Abs(float64(obj.Y)) >= 10 {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
- if _, ok := objDicOfTpperception[obj.Id]; !ok {
|
|
|
|
- objDicOfTpperception[obj.Id] = []float32{}
|
|
|
|
|
|
+ if _, ok := ObjDicOfTpperception[obj.Id]; !ok {
|
|
|
|
+ ObjDicOfTpperception[obj.Id] = [][]float32{{}, {}, {}, {}}
|
|
}
|
|
}
|
|
- objDicOfTpperception[obj.Id] = append(objDicOfTpperception[obj.Id], obj.Y)
|
|
|
|
|
|
+ ObjDicOfTpperception[obj.Id][0] = append(ObjDicOfTpperception[obj.Id][0], obj.X)
|
|
|
|
+ ObjDicOfTpperception[obj.Id][1] = append(ObjDicOfTpperception[obj.Id][1], obj.Y)
|
|
|
|
+ ObjDicOfTpperception[obj.Id][2] = append(ObjDicOfTpperception[obj.Id][2], obj.Vxrel)
|
|
|
|
+ ObjDicOfTpperception[obj.Id][3] = append(ObjDicOfTpperception[obj.Id][3], obj.Vxabs)
|
|
objTypeDicOfTpperception[obj.Id] = obj.Type
|
|
objTypeDicOfTpperception[obj.Id] = obj.Type
|
|
objSpeedDicOfTpperception[obj.Id] = math.Pow(math.Pow(float64(obj.Vxabs), 2)+math.Pow(float64(obj.Vyabs), 2), 0.5)
|
|
objSpeedDicOfTpperception[obj.Id] = math.Pow(math.Pow(float64(obj.Vxabs), 2)+math.Pow(float64(obj.Vyabs), 2), 0.5)
|
|
}
|
|
}
|
|
- shareVars.Store("ObjDicOfTpperception", objDicOfTpperception)
|
|
|
|
|
|
+ shareVars.Store("ObjDicOfTpperception", ObjDicOfTpperception)
|
|
shareVars.Store("ObjTypeDicOfTpperception", objTypeDicOfTpperception)
|
|
shareVars.Store("ObjTypeDicOfTpperception", objTypeDicOfTpperception)
|
|
shareVars.Store("ObjSpeedDicOfTpperception", objSpeedDicOfTpperception)
|
|
shareVars.Store("ObjSpeedDicOfTpperception", objSpeedDicOfTpperception)
|
|
},
|
|
},
|