Skip to content

Conversation

@coderjake91
Copy link

Hello!

First off — thanks for creating DataTamer. It’s an awesome library.

I’ve been developing a ROS2 Jazzy system using a composition-based architecture with both lifecycle and regular nodes. We use DataTamer to collect time-series data and pipe it into Foxglove, and the ROS2 publisher sink makes that integration super smooth.

I ran into an issue when adding the ROS2 publisher sink inside composable nodes. In composition, node ownership changes — the executor owns the shared pointer and spins the nodes — so you often don’t have direct access to the node shared_ptr in the same way as when running standalone nodes. This affects both lifecycle and regular nodes.

I tried workarounds like shared_from_this(), but those are fragile and can easily lead to invalid weak pointers.

I noticed recent support for lifecycle nodes was added via additional constructor overloads, and this PR builds on that idea by updating ROS2PublisherSink to accept a NodeInterfaces façade instead of requiring a shared_ptr. Since this sink only needs the topics interface, this lets users pass either:

  1. A NodeInterfaces object directly
  2. A Node / LifecycleNode
  3. A shared_ptr to either

while remaining fully backwards compatible.

I took my colleague @jlack1987’s advice (he’s been working with DataTamer for a while) and structured this to preserve all existing usage patterns.

Thanks again — happy to adjust anything if needed!

@coderjake91
Copy link
Author

Also, I added new ROS2 Publisher Sink Tests in: data_tamer_cpp/tests/ros2_publisher_tests.cpp

@henrygerardmoore henrygerardmoore self-requested a review February 10, 2026 18:55
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.

1 participant