Add a deserialize method to Subscription - #19
Merged
Conversation
…ializedMessage and deserialize later.
There was a problem hiding this comment.
Pull request overview
Adds an API on BabelFishSubscription to deserialize an rclcpp::SerializedMessage into a CompoundMessage, enabling deferred decoding of serialized subscription data.
Changes:
- Introduce
BabelFishSubscription::deserialize(const rclcpp::SerializedMessage&, CompoundMessage&). - Implement deserialization using
rclcpp::SerializationBaseand the subscription’s type support. - Add a gtest validating round-trip behavior for serialized subscription callbacks.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
ros_babel_fish/test/message_decoding.cpp |
Adds a new test that receives a SerializedMessage and verifies subscription->deserialize(...) produces the expected CompoundMessage. |
ros_babel_fish/src/detail/babel_fish_subscription.cpp |
Implements deserialize(...) using ROS 2 serialization utilities. |
ros_babel_fish/include/ros_babel_fish/detail/babel_fish_subscription.hpp |
Declares the new deserialize(...) method on BabelFishSubscription. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Member
Author
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin humble
git worktree add -d .worktree/backport-19-to-humble origin/humble
cd .worktree/backport-19-to-humble
git switch --create backport-19-to-humble
git cherry-pick -x 8fbbefc47ea389c7a5c7fbd0b2f7759d19bd65bf |
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 16, 2026
* Add a deserialize method to Subscription to enable users to use a SerializedMessage and deserialize later. * Catch exceptions when deserializing. (cherry picked from commit 8fbbefc)
Member
Author
|
Successfully created backport PR for |
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 16, 2026
* Add a deserialize method to Subscription to enable users to use a SerializedMessage and deserialize later. * Catch exceptions when deserializing. (cherry picked from commit 8fbbefc)
Member
Author
|
Successfully created backport PR for |
StefanFabian
added a commit
that referenced
this pull request
Apr 16, 2026
* Add a deserialize method to Subscription to enable users to use a SerializedMessage and deserialize later. * Catch exceptions when deserializing. (cherry picked from commit 8fbbefc)
StefanFabian
added a commit
that referenced
this pull request
Apr 16, 2026
* Add a deserialize method to Subscription to enable users to use a SerializedMessage and deserialize later. * Catch exceptions when deserializing. (cherry picked from commit 8fbbefc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This enables users to use a SerializedMessage callback and deserialize later.
Not ABI breaking, so can be backported.
My use case is bandwidth monitoring, so I know the size of the message that was transmitted and can add monitoring to qml6_ros2_plugin and rqml.