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

Minimal Cpp example using a subclass of rclcpp::Node #3

Open
swiz23 opened this issue Aug 27, 2021 · 6 comments
Open

Minimal Cpp example using a subclass of rclcpp::Node #3

swiz23 opened this issue Aug 27, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@swiz23
Copy link

swiz23 commented Aug 27, 2021

From here, the readme specifies that the recommended style for ros 2 coding is to subclass a rclcpp::Node. Could you write a minimal example in cpp that shows how this works with image transport?

@swiz23
Copy link
Author

swiz23 commented Sep 3, 2021

This specific issue I was having was that it didn't seem possible to initialize an ImageTransport object within a subclass of a rclcpp::Node. However, according to the ImageTransport documentation here, it's not actually necessary to create an ImageTransport object! You can instead initialize publishers and subscribers in a similar fashion to regular publishers and subscribers.

@jacobperron jacobperron added enhancement New feature or request help wanted Extra attention is needed labels Oct 4, 2021
@jacobperron
Copy link

IMO, it would be nice to see such an example, though I haven't investigated if it is possible with the current API. I'm happy to review any PRs or thoughts on the matter.

@swiz23
Copy link
Author

swiz23 commented Nov 8, 2021

I have been able to implement this successfully. When I get around to it, I'll be happy to create a minimal example and create a PR.

@jacobperron
Copy link

@swiz23 Glad to hear it! I look forward to a pull request :)

@Alex-Beh
Copy link

Alex-Beh commented Dec 29, 2022

Maybe the example from Stereolabs might help you.

@Jack-Spleenlab
Copy link

See this PR: #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants