|
@@ -21,6 +21,7 @@ import (
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
+ cicvLocationTime = time.Now()
|
|
|
// -----------------------------共享变量
|
|
|
// /tpperception
|
|
|
objDicOfTpperception = make(map[uint32][]float32)
|
|
@@ -555,7 +556,6 @@ func ProduceWindow() {
|
|
|
Node: commonConfig.RosNode,
|
|
|
Topic: topic,
|
|
|
Callback: func(data *pjisuv_msgs.PerceptionLocalization) {
|
|
|
-
|
|
|
subscribersTimeMutexes[i].Lock()
|
|
|
if time.Since(subscribersTimes[i]).Seconds() > triggerInterval {
|
|
|
subscribersMutexes[i].Lock()
|
|
@@ -595,6 +595,11 @@ func ProduceWindow() {
|
|
|
shareVars.Store("AngularVelocityZOfCicvLocation", data.AngularVelocityZ)
|
|
|
shareVars.Store("PositionXOfCicvLocation", data.PositionX)
|
|
|
shareVars.Store("PositionYOfCicvLocation", data.PositionY)
|
|
|
+ // 用于判断是否在车间内
|
|
|
+ if time.Since(cicvLocationTime).Seconds() > 1 {
|
|
|
+ shareVars.Store("key", "value")
|
|
|
+ cicvLocationTime = time.Now()
|
|
|
+ }
|
|
|
},
|
|
|
})
|
|
|
}
|