Fix issue #23: prevent duplicate diagnostics when external node is already publishing#33
Merged
sgillen merged 5 commits intoNVIDIA-ISAAC-ROS:mainfrom Feb 27, 2026
Conversation
…ernal node is already publishing Subscribe to /diagnostics in GreenwaveMonitor to track topic names already published externally. add_topic() now returns an error if a topic's diagnostics are already being published by an external node, preventing duplicate and potentially conflicting diagnostic entries. Also fix copyright-required pre-commit hook to only run at pre-commit stage, preventing it from incorrectly checking COMMIT_EDITMSG for a copyright header. Signed-off-by: Blake McHale <bmchale@nvidia.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Greptile SummaryThis PR successfully implements automatic detection and prevention of duplicate diagnostics when external nodes are already publishing for a topic. Key Changes:
Design Decisions:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Ext as External Node
participant Diag as /diagnostics topic
participant GW as GreenwaveMonitor
participant User as Service Caller
Note over GW: Constructor subscribes to /diagnostics early
Ext->>Diag: Publish DiagnosticArray{status.name=/foo}
Diag->>GW: diagnostics_callback(msg)
alt /foo not in greenwave_diagnostics_
GW->>GW: Add /foo to externally_diagnosed_topics_
else /foo already monitored by us
Note over GW: Skip (prevents self-blocking)
end
User->>GW: add_topic(/foo)
alt /foo in externally_diagnosed_topics_
GW-->>User: Error: Topic is externally monitored
else /foo not externally diagnosed
GW->>GW: Create subscription and add to greenwave_diagnostics_
GW-->>User: Success
end
Last reviewed commit: a25e74a |
sgillen
reviewed
Feb 27, 2026
Signed-off-by: Blake McHale <bmchale@nvidia.com>
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.
Fixes #23.
Subscribe to /diagnostics in GreenwaveMonitor to track topic names already published externally. add_topic() now returns an error if a topic's diagnostics are already being published by an external node, preventing duplicate and potentially conflicting diagnostic entries.