Skip to content

Conversation

@tuanhungngyn
Copy link
Member

@tuanhungngyn tuanhungngyn commented Nov 21, 2025

Closes #14

Please check if the PR fulfills these requirements

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • CHANGELOG.md has been updated (for bug fixes / features / docs)

What kind of change does this PR introduce?

Feature - Support Dynamic Labels

What was changed?

-Introduced LabelStateTracker class to track and update dynamic label values based on incoming ROS messages
-Added LabelTopicConfig and LabelMode models to configure dynamic label behavior per topic
-Integrated label tracking into both MCAP and CDR output writers

Related issues

(Add links to related issues)

Does this PR introduce a breaking change?

(What changes might users need to make in their application due to this PR?)

Other information:

@tuanhungngyn
Copy link
Member Author

@atimin 'max' mode for CDR does not make sense to me. We currently treat each message to be a record in CDR, which would destroy the logic of 'max'.

@tuanhungngyn tuanhungngyn changed the title modified README 14 - Support Dynamic Labels Nov 25, 2025
@tuanhungngyn tuanhungngyn marked this pull request as ready for review November 25, 2025 13:29
@AnthonyCvn AnthonyCvn requested a review from Copilot November 25, 2025 13:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for dynamic labels to the reductstore_agent, allowing labels to be extracted from ROS message fields and attached to recorded data. The feature supports three modes: "last" (most recent value), "first" (first value in file), and "max" (maximum value across messages).

Key Changes

  • Introduced LabelStateTracker class to track and update dynamic label values based on incoming ROS messages
  • Added LabelTopicConfig and LabelMode models to configure dynamic label behavior per topic
  • Integrated label tracking into both MCAP and CDR output writers

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
reductstore_agent/dynamic_labels.py New file implementing the LabelStateTracker class for tracking dynamic label state across messages
reductstore_agent/models.py Added LabelMode enum and LabelTopicConfig model for configuring dynamic labels; added labels field to PipelineConfig
reductstore_agent/writer/mcap.py Integrated label tracker: added parameter, updated messages, and merged dynamic labels with static labels during upload
reductstore_agent/writer/cdr.py Integrated label tracker: added parameter, updated messages in both batch and streaming paths
reductstore_agent/writer/factory.py Instantiates LabelStateTracker when creating writers if labels are configured; minor docstring formatting improvements
reductstore_agent/utils.py Added extract_field() utility function to extract field values from ROS messages
README.md Added documentation for the three dynamic label modes (last, first, max)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@atimin atimin left a comment

Choose a reason for hiding this comment

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

Looks good, there is something to polish. See my comments. I think we can write tests.

@tuanhungngyn tuanhungngyn requested a review from atimin November 28, 2025 14:07
Copy link
Member

@atimin atimin left a comment

Choose a reason for hiding this comment

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

Good job! I have a few minor suggestions, and then we can merge.

Please fill out the PR description.

@tuanhungngyn tuanhungngyn requested a review from atimin December 2, 2025 10:16
Copy link
Member

@atimin atimin left a comment

Choose a reason for hiding this comment

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

Perfect!

@atimin atimin merged commit 985f51b into main Dec 2, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in ReductStore Roadmap Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Support dynamic labels from ROS topics

3 participants