Skip to content

Comments

Unify timestamp checks and fix headerless FPS checks#31

Draft
bmchalenv wants to merge 3 commits intoNVIDIA-ISAAC-ROS:mainfrom
bmchalenv:fix-headerless-ts
Draft

Unify timestamp checks and fix headerless FPS checks#31
bmchalenv wants to merge 3 commits intoNVIDIA-ISAAC-ROS:mainfrom
bmchalenv:fix-headerless-ts

Conversation

@bmchalenv
Copy link
Contributor

No description provided.

Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
@bmchalenv bmchalenv marked this pull request as draft February 25, 2026 00:03
@greptile-apps
Copy link

greptile-apps bot commented Feb 25, 2026

Greptile Summary

Refactored timestamp validation logic to use a unified TimeSourceState struct and generic checkTimeSource() function, reducing code duplication. The PR fixes handling of headerless messages (those with msg_timestamp_ns == 0) by skipping message timestamp checks when no header is present, preventing incorrect FPS calculations.

  • Introduced TimeSourceState struct to encapsulate per-source state (node time vs message timestamp)
  • Unified timestamp checking into checkTimeSource(), checkFPS(), and checkIncreasing() helper functions
  • Added enable_increasing_node_time_diagnostics config option for symmetry
  • Fixed headerless message handling: only checks message timestamp source when has_msg_timestamp is true
  • Updated setExpectedDt() and clearExpectedDt() to synchronize both config flags and source state

Confidence Score: 4/5

  • Safe to merge with one minor initialization fix needed
  • The refactoring significantly improves code organization and fixes the headerless message handling bug. One missing initialization for node_source_.check_increasing should be added before merging to ensure complete symmetry between node and message time sources.
  • greenwave_monitor/include/greenwave_diagnostics.hpp needs node_source_.check_increasing initialization added in constructor

Important Files Changed

Filename Overview
greenwave_monitor/include/greenwave_diagnostics.hpp Refactors timestamp checking logic into unified TimeSourceState struct and checkTimeSource() function. Adds support for increasing node time diagnostics. Missing initialization for node_source_.check_increasing in constructor.

Last reviewed commit: 44ae17d

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

msg_window_.window_size = diagnostics_config_.filter_window_size;

node_source_.label = "Node Time";
node_source_.check_fps = diagnostics_config_.enable_node_time_diagnostics;
Copy link

Choose a reason for hiding this comment

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

node_source_.check_increasing is never initialized, but msg_source_.check_increasing is set on line 95. Add:

Suggested change
node_source_.check_fps = diagnostics_config_.enable_node_time_diagnostics;
node_source_.check_increasing = diagnostics_config_.enable_increasing_node_time_diagnostics;

Signed-off-by: Blake McHale <bmchale@nvidia.com>
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