Skip to content

Add a deserialize method to Subscription - #19

Merged
StefanFabian merged 2 commits into
rollingfrom
feature/add-deserialize-in-subscription
Apr 16, 2026
Merged

Add a deserialize method to Subscription#19
StefanFabian merged 2 commits into
rollingfrom
feature/add-deserialize-in-subscription

Conversation

@StefanFabian

@StefanFabian StefanFabian commented Apr 16, 2026

Copy link
Copy Markdown
Member

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::SerializationBase and 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.

Comment thread ros_babel_fish/src/detail/babel_fish_subscription.cpp Outdated
Comment thread ros_babel_fish/src/detail/babel_fish_subscription.cpp Outdated
@sonarqubecloud

sonarqubecloud Bot commented Apr 16, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
1 Accepted issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@StefanFabian StefanFabian self-assigned this Apr 16, 2026
@StefanFabian
StefanFabian merged commit 8fbbefc into rolling Apr 16, 2026
4 of 5 checks passed
@StefanFabian

Copy link
Copy Markdown
Member Author

Backport failed for humble, because it was unable to cherry-pick the commit(s).

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)
@StefanFabian

Copy link
Copy Markdown
Member Author

Successfully created backport PR for jazzy:

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)
@StefanFabian

Copy link
Copy Markdown
Member Author

Successfully created backport PR for kilted:

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)
@StefanFabian
StefanFabian deleted the feature/add-deserialize-in-subscription branch April 17, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants