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

[Ask][C++] What is a good practice for multiple (channel) subscribe in one process (w/ select approach) ? #540

Open
kshfire opened this issue Nov 4, 2024 · 1 comment

Comments

@kshfire
Copy link

kshfire commented Nov 4, 2024

Example codes are really helpful to use the LCM. Nevertheless, examples only explain one subsribe case.

I would like to subscribe to multiple channels using the select method in one process. Thus, I'm really appreciate it if someone explain me a good solution (or sample code) of it. Because I'm a beginner of the LCM and thus I'm not sure whether my method is correct or not.

It would be nice if the example codes will be a bit richer (such as multiple channel subscribe in a process, etc).

Thank you in advance.

@kshfire kshfire changed the title [Ask][C++] What is a good practice for multiple subscribe (w/ select) ? [Ask][C++] What is a good practice for multiple (channel) subscribe in one process (w/ select approach) ? Nov 4, 2024
@nosracd
Copy link
Contributor

nosracd commented Nov 4, 2024

More advanced examples is a good idea!

In the meantime, please see the API docs for information on how you subscribe to multiple channels. You may be interested in this page specifically. In particular the docs on the channel argument:

This is treated as a regular expression

So, for example, you could use regex to match multiple channels with one call. Or you could call the subscribe method multiple times.

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

No branches or pull requests

2 participants