|
@@ -1761,7 +1761,6 @@ func ProduceWindow() {
|
|
|
subscribersMutexes[i].Unlock()
|
|
|
}
|
|
|
subscribersTimeMutexes[i].Unlock()
|
|
|
- // -------- 触发后更新共享变量
|
|
|
// 更新共享变量
|
|
|
mutexOfTpperception.RLock()
|
|
|
{
|
|
@@ -2187,16 +2186,12 @@ func ProduceWindow() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- // 39
|
|
|
- if topic == masterConfig.TopicOfPjVehicleFdbPub &&
|
|
|
- (len(masterConfig.RuleOfPjVehicleFdbPub1) > 0 ||
|
|
|
- len(masterConfig.RuleOfPjVehicleFdbPub2) > 0 ||
|
|
|
- len(masterConfig.RuleOfPjVehicleFdbPub3) > 0) {
|
|
|
+ // 39 有共享变量的订阅者必须被创建
|
|
|
+ if topic == masterConfig.TopicOfPjVehicleFdbPub {
|
|
|
subscribers[i], err = goroslib.NewSubscriber(goroslib.SubscriberConf{
|
|
|
Node: commonConfig.RosNode,
|
|
|
Topic: topic,
|
|
|
Callback: func(data *pjisuv_msgs.VehicleFdb) {
|
|
|
- shareVars.Store("Automode", data.Automode)
|
|
|
subscribersTimeMutexes[i].Lock()
|
|
|
if time.Since(subscribersTimes[i]).Seconds() > triggerInterval {
|
|
|
subscribersMutexes[i].Lock()
|
|
@@ -2240,6 +2235,8 @@ func ProduceWindow() {
|
|
|
subscribersMutexes[i].Unlock()
|
|
|
}
|
|
|
subscribersTimeMutexes[i].Unlock()
|
|
|
+ // 更新共享变量
|
|
|
+ shareVars.Store("Automode", data.Automode)
|
|
|
},
|
|
|
})
|
|
|
}
|