-
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
Open
bmchalenv
wants to merge
33
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.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
256a121
Add controlling topic expected frequencies and tolerances through ROS…
bmchalenv 596cc53
Add tests for nested YAML and don't specify the topics parameter ever…
bmchalenv 2f31969
More common functions and use rclpy instead of subprocess for interfa…
bmchalenv e78aca3
Fix cpplint
bmchalenv b891a6b
Fix lint
bmchalenv eb488e3
Fix tests
bmchalenv 4fdc70c
Don't maintain pending_topic_configs_
bmchalenv f715325
Use same base class for RosNodeTestCase
bmchalenv 31e9148
Update copyrights
bmchalenv 88ddcd2
More tests and linting
bmchalenv ad2aacb
Cover when topics is specified alongside its subfields
bmchalenv 61c898f
Move code inline and add param delete
bmchalenv 99f2981
Catch exceptions with declare
bmchalenv de7b899
Fix typo
bmchalenv 4ef8db8
Reject non-numeric parameters and allow both int and double
bmchalenv 6fa7976
Add tests for deleting and setting invalid parameters
bmchalenv 53b052a
Fix lint
bmchalenv 82971d7
Move parameters to greenwave_diagnostics.hpp
bmchalenv cc67a22
Add parameter tests to test_greenwave_diagnostics
bmchalenv 154d35e
More tests. One consolidated test no deletions.
bmchalenv b9292b3
Remove old test files
bmchalenv e0327dd
Refactor UI adaptor
bmchalenv e4d02af
Use parameters instead of ManageTopic
bmchalenv b8e6141
Fix CI tests
bmchalenv 37aee84
Fix CI issues
bmchalenv 136f3a7
Remove last monitor-interfaces reference
bmchalenv 658dc50
Test no destructor
bmchalenv 01c3f09
Try to fix CI
bmchalenv c4273fd
Small fixes to improve destructor safety
bmchalenv c78675c
Fix ROS race conditions during initialization
bmchalenv 7308ae0
Fix lint
bmchalenv 7f1c64f
Small greptile fixups
bmchalenv 97a8f80
Fix lint
bmchalenv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,51 @@ | ||
| # Services | ||
| # Parameters | ||
|
|
||
| The Greenwave Monitor provides two services. The `ManageTopic` service dynamically adds or removes topics from monitoring. The `SetExpectedFrequency` service dynamically sets or clears expected frequencies for a specified topic, which enables additional diagnostic values and statuses. | ||
| The Greenwave Monitor uses ROS parameters for all topic configuration, including enabling/disabling monitoring and setting expected frequencies. | ||
|
|
||
| ## Manage Topic | ||
| ## Topic Monitoring Control | ||
|
|
||
| The monitor node exposes a `/greenwave_monitor/manage_topic` service that follows the `greenwave_monitor_interfaces/srv/ManageTopic` service definition. | ||
| Topics can be enabled or disabled via the `greenwave_diagnostics.<topic>.enabled` parameter. | ||
|
|
||
| **Usage Examples** | ||
|
|
||
| To add a topic to the monitoring list: | ||
| To enable monitoring for a topic: | ||
| ```bash | ||
| ros2 service call /greenwave_monitor/manage_topic greenwave_monitor_interfaces/srv/ManageTopic "{topic_name: '/topic2', add_topic: true}" | ||
| ros2 param set /greenwave_monitor greenwave_diagnostics./topic2.enabled true | ||
| ``` | ||
|
|
||
| To remove a topic from the monitoring list: | ||
| To disable monitoring for a topic: | ||
| ```bash | ||
| ros2 service call /greenwave_monitor/manage_topic greenwave_monitor_interfaces/srv/ManageTopic "{topic_name: '/topic2', add_topic: false}" | ||
| ros2 param set /greenwave_monitor greenwave_diagnostics./topic2.enabled false | ||
| ``` | ||
|
|
||
| ## Set Expected Frequency | ||
| ## Expected Frequency Parameters | ||
|
|
||
| The monitor node exposes a `/greenwave_monitor/set_expected_frequency` service that follows the `greenwave_monitor_interfaces/srv/SetExpectedFrequency` service definition. | ||
| Expected frequencies are configured via ROS parameters with the following naming convention: | ||
| - `greenwave_diagnostics.<topic>.expected_frequency` - Expected publish rate in Hz | ||
| - `greenwave_diagnostics.<topic>.tolerance` - Tolerance percentage (default: 5.0%) | ||
|
|
||
| **Usage Examples** | ||
|
|
||
| To set the expected frequency for a topic: | ||
| ```bash | ||
| ros2 service call /greenwave_monitor/set_expected_frequency greenwave_monitor_interfaces/srv/SetExpectedFrequency "{topic_name: '/topic2', expected_hz: <float>, tolerance_percent: <float>, add_topic_if_missing: true}" | ||
| ros2 param set /greenwave_monitor greenwave_diagnostics./topic2.expected_frequency 30.0 | ||
| ros2 param set /greenwave_monitor greenwave_diagnostics./topic2.tolerance 10.0 | ||
| ``` | ||
|
|
||
| To clear the expected frequency for a topic: | ||
| Parameters can also be set at launch time via YAML: | ||
| ```yaml | ||
| greenwave_monitor: | ||
| ros__parameters: | ||
| greenwave_diagnostics./topic2.expected_frequency: 30.0 | ||
| greenwave_diagnostics./topic2.tolerance: 10.0 | ||
| greenwave_diagnostics./topic2.enabled: true | ||
| ``` | ||
|
|
||
| Or via command line: | ||
| ```bash | ||
| ros2 service call /greenwave_monitor/set_expected_frequency greenwave_monitor_interfaces/srv/SetExpectedFrequency "{topic_name: '/topic2', clear_expected: true}" | ||
| ros2 run greenwave_monitor greenwave_monitor --ros-args \ | ||
| -p greenwave_diagnostics./topic2.expected_frequency:=30.0 \ | ||
| -p greenwave_diagnostics./topic2.tolerance:=10.0 | ||
| ``` | ||
|
|
||
| Note: The topic name must include the leading slash (e.g., '/topic2' not 'topic2'). |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| /**: | ||
| ros__parameters: | ||
| # All topics declared in greenwave_diagnostics will be automatically monitored | ||
| # if detected at startup. | ||
| greenwave_diagnostics: | ||
| /params_from_yaml_topic: | ||
| enabled: true | ||
| expected_frequency: 10.0 | ||
| tolerance: 5.0 |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.