Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initialize a plugin before getting subscriptions #1714

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

standmit
Copy link

After initializing and receiving parameters from a ParameterServer, a custom plugin can decide which subscriptions it needs.

Copy link
Member

@vooon vooon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like that approach. It's not portable to ROS2, as there you can't really expect parameter to be set on init stage.

I'd prefer just so subscribe to all possible messages and then ignore unneeded ones.

@standmit
Copy link
Author

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.

@vooon
Copy link
Member

vooon commented Feb 18, 2022

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?

@standmit
Copy link
Author

standmit commented Feb 18, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants