-
Notifications
You must be signed in to change notification settings - Fork 6
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
Support cbor-raw encoding for messages #34
Comments
@Carter12s would like to get your take on this since you've written the trait for async fn publish<T: RosMessageType>(&mut self, topic: &str, msg: T) -> RosLibRustResult<()>; The |
Ah I see that I misunderstood. |
Yeah I think this should be as easy as subscribe() taking an argument about compression and then swapping in a different decode closure into the internal callback queue. There is a bigger conversation around how to more broadly restructure the crate to support completely different comm backends if/when we want to do something like support ROS1 or ROS2 native protocols, but I don't want to think about that yet. I reality I think we should punt on cbor-raw support for now, and focus more on documentation and tests. |
Currently roslibrust assumes and only supports default json-encoding.
It looks in the two affected places are
Client::handle_publish
where messages are decoded (and there's an unwrap assuming the encoding is json) andWriter::publish
which assumes the msg is aRosMessageType
. It probably makes sense to construct the publisher with an encoding mechanism defined in order to prevent changing the publish/subscribe APIs.The format of these messages is not extremely well documented in rosbridge_suite's protocol document, nor is it even implemented in roslibpy, but from what I can tell it should produce messages like:
We can make use of
serde_rosmsg
which implements the correct encoding mechanism, as despite the name it has no relation with cbor other than that their both in binary...The text was updated successfully, but these errors were encountered: