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

subscribe to any topic of any type and get received messages as a raw vector of bytes #192

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

lucasw
Copy link
Contributor

@lucasw lucasw commented Aug 10, 2024

Description

Subscribe to a topic without needing to know the type, and then get the received message as a raw vector of bytes, similar to rospy AnyMsg and roscpp ShapeShifter.

This isn't quite what was suggested in #190 (comment) I couldn't figure out how to make a function within the existing Subscriber that can do different things depending on type, it needs specialization? Is having both a Subscriber and SubscriberAny bad for other parts of roslibrust?

Fixes

Closes: #190

Checklist

  • [ ✔️ ] Update CHANGELOG.md

@Carter12s
Copy link
Owner

I'm not opposed to this as the solution, and I think having this in the crate is better than not having anything, so I'm okay with merging this.

The part where this can get messy is with the TopicProvider trait I'm working on now. Having SubscriberAny just makes it hard (not impossible) to create a generic trait that represents a ROS api. It adds another generic associated type on the trait, but that is probably fine?

If you are interested I'd be happy to throw together a version of what I was think of, and we could compare them?

Otherwise happy to merge this as is (once Drop stuff is fixed).

@lucasw
Copy link
Contributor Author

lucasw commented Aug 15, 2024

I'm not opposed to this as the solution, and I think having this in the crate is better than not having anything, so I'm okay with merging this.

The part where this can get messy is with the TopicProvider trait I'm working on now. Having SubscriberAny just makes it hard (not impossible) to create a generic trait that represents a ROS api. It adds another generic associated type on the trait, but that is probably fine?

If you are interested I'd be happy to throw together a version of what I was think of, and we could compare them?

Otherwise happy to merge this as is (once Drop stuff is fixed).

I suppose just unwind any amount of this once topic provider is ready?

I also have a publisher any commit I could add here, it's very similar.

But if topic provider is very close this doesn't need to be merged.

@Carter12s
Copy link
Owner

If you have publisher any ready, go ahead and put PR up. TopicProvider stuff can take a back seat!

@Carter12s Carter12s merged commit f9ccf04 into Carter12s:master Aug 15, 2024
5 checks passed
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.

Subscribe to any topic type like ShapeShifter/AnyMsg and get raw bytes from next() instead of deserializing
2 participants