mavros
mavros copied to clipboard
initialize a plugin before getting subscriptions
After initializing and receiving parameters from a ParameterServer, a custom plugin can decide which subscriptions it needs.
I'd prefer just so subscribe to all possible messages and then ignore unneeded ones.
There is no way to subscribe to all messages, isn't there? I mean, in current version you need to know MSG_ID at compile time. But earlier initializing solves this problem.
If you don't know msg ID, you won't be able to decode the message. Could you please give overview on what you're trying to get. Maybe i can suggest some other ways?
I need to filter messages that MAVROS forwards to GCS. I want to set a message whitelist at startup time. I would like to avoid any extra conversions and transfers between processes. My solution is to make a plugin. It must receive the whitelist of message IDs from a ParameterServer, subscribe to the allowed messages, and forward ones to a GCS using a MAVConnInterface. No decoding needed. Usually, all other plugins receives parameters at initialization step. Unfortunately, the initialization happens after subscription. Yes, I can get the parameters in get_subscriptions method. But a more elegant way is to simply move one small line in the MAVROS code a little up.