-
Notifications
You must be signed in to change notification settings - Fork 11
Add controlling topic expected frequencies and tolerances through ROS 2 parameters #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bmchalenv
wants to merge
11
commits into
NVIDIA-ISAAC-ROS:main
Choose a base branch
from
bmchalenv:topics_parameters
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,690
−36
Conversation
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
Greptile SummaryThis PR implements ROS 2 parameter-based configuration for topic monitoring, allowing users to specify expected frequencies and tolerances through YAML files or dynamic parameter changes. The implementation adds a new parameter syntax Key Changes
Implementation Quality
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant Node as GreenwaveMonitor Node
participant ParamCallback as on_parameter_change
participant ConfigHandler as apply_topic_config_if_complete
participant TopicHandler as set_topic_expected_frequency
participant Diagnostics as MessageDiagnostics
Note over User,Diagnostics: Startup: Loading Parameters from YAML/Overrides
User->>Node: Launch with parameter file
Node->>Node: Constructor: allow_undeclared_parameters(true)
Node->>Node: Constructor: automatically_declare_parameters_from_overrides(true)
Node->>Node: load_topic_parameters_from_overrides()
Node->>Node: Parse all "topics.{topic}.{field}" parameters
Node->>Node: Store in pending_topic_configs_
loop For each topic with expected_frequency
Node->>TopicHandler: set_topic_expected_frequency(add_topic_if_missing=true)
TopicHandler->>Node: add_topic() if not exists
TopicHandler->>Diagnostics: setExpectedDt(freq, tolerance)
TopicHandler->>Node: declare_or_set_parameter() to sync params
end
Note over User,Diagnostics: Runtime: Dynamic Parameter Changes
User->>Node: ros2 param set topics.{topic}.expected_frequency {value}
Node->>ParamCallback: on_parameter_change([parameters])
loop For each parameter
ParamCallback->>ParamCallback: parse_topic_param_name()
ParamCallback->>ParamCallback: Update pending_topic_configs_[topic]
ParamCallback->>ConfigHandler: apply_topic_config_if_complete(topic)
ConfigHandler->>ConfigHandler: Check if frequency is set
alt Frequency available
ConfigHandler->>TopicHandler: set_topic_expected_frequency(add_topic_if_missing=true)
TopicHandler->>Node: add_topic() if needed
TopicHandler->>Diagnostics: setExpectedDt(freq, tolerance)
ConfigHandler->>ConfigHandler: erase from pending_topic_configs_
else No frequency
ConfigHandler->>ConfigHandler: Wait for frequency parameter
end
end
Note over User,Diagnostics: Service Call: Set Expected Frequency
User->>Node: Call set_expected_frequency service
Node->>TopicHandler: set_topic_expected_frequency(update_parameters=true)
TopicHandler->>Diagnostics: setExpectedDt(freq, tolerance)
TopicHandler->>Node: declare_or_set_parameter() to sync params
Node-->>User: Response with success/message
|
6ddeeab to
4a3f4d3
Compare
… 2 parameters Signed-off-by: Blake McHale <bmchale@nvidia.com>
…y time Signed-off-by: Blake McHale <bmchale@nvidia.com>
0caeff7 to
596cc53
Compare
…cing with parameters Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
Signed-off-by: Blake McHale <bmchale@nvidia.com>
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
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.
Resolves #19 and gives the capability to specify expected frequencies and tolerance through ROS 2 parameters. The
topicsparameter can now be specified with subfieldstopics.<topic_name>.(expected_frequency|tolerance).The original topics parameter with a list still exists and can be used during initialization, but now parameters specified with the new subfields will also add those topics to the monitor node with the expected frequency and tolerance already set. They can be set in a ROS 2 parameter file like:
or