mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
uavcan_v1: Don't re-subscribe to fixed port ID subscribers
This commit is contained in:
parent
a99b657f03
commit
ab46b8026c
@ -60,6 +60,11 @@ void SubscriptionManager::subscribe()
|
||||
_getinfo_rsp.subscribe();
|
||||
_access_rsp.subscribe();
|
||||
|
||||
updateDynamicSubscriptions();
|
||||
}
|
||||
|
||||
void SubscriptionManager::updateDynamicSubscriptions()
|
||||
{
|
||||
for (auto &sub : _uavcan_subs) {
|
||||
if (sub.instance == NULL) {
|
||||
param_t param_handle = param_find(sub.px4_name);
|
||||
@ -124,5 +129,5 @@ void SubscriptionManager::updateParams()
|
||||
}
|
||||
|
||||
// Check for any newly-enabled subscriptions
|
||||
subscribe();
|
||||
updateDynamicSubscriptions();
|
||||
}
|
||||
|
||||
@ -74,6 +74,8 @@ public:
|
||||
void updateParams();
|
||||
|
||||
private:
|
||||
void updateDynamicSubscriptions();
|
||||
|
||||
CanardInstance &_canard_instance;
|
||||
UavcanParamManager &_param_manager;
|
||||
UavcanDynamicPortSubscriber *_dynsubscribers {NULL};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user