mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-22 14:19:57 +08:00
While a topic has no device node, every Subscription::update(), copy(), updated() and advertised() repeats the device node lookup and fails again. Polling modules touch many optional topics on every loop: in a SITL flight about 8% of all instructions, and about a quarter of each MAVLink thread, were such failed lookups. Device nodes are never removed, so a lookup that failed cannot succeed before a node is added. Count the nodes added in DeviceMaster and only retry the lookup once that count has changed. Protected builds, where user space has no cheap access to it, keep retrying every time. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>