-
Notifications
You must be signed in to change notification settings - Fork 364
feat(rqt): Add update rate and async info to details window #2510
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
base: master
Are you sure you want to change the base?
feat(rqt): Add update rate and async info to details window #2510
Conversation
Adds update_rate and is_async parameters to the RQT controller manager details popup. Fetches per-controller parameters and falls back to global/default values if not available. Fixes ros-controls#2166.
@ShahazadAbdulla could you please reattempt uploading the screenshot? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2510 +/- ##
=======================================
Coverage 89.27% 89.27%
=======================================
Files 145 145
Lines 16484 16484
Branches 1395 1395
=======================================
Hits 14716 14716
Misses 1229 1229
Partials 539 539
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
ofc. @bmagyar ![]() ![]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
I tested it, and it works for controllers, but: The same layout is used for controllers and hardware components, but you only query the parameters from the controllers. If you later open the details of a hardware component, the data is wrong because not updated/deleted any more.
Please consider a consistent code style (comments), and remove LLM output
# Update the labels you created in the .ui file | ||
popup.label_update_rate_value.setText(update_rate) | ||
popup.label_async_setting_value.setText(is_async) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds like some LLM description ;)
# Update the labels you created in the .ui file | |
popup.label_update_rate_value.setText(update_rate) | |
popup.label_async_setting_value.setText(is_async) | |
popup.label_update_rate_value.setText(update_rate) | |
popup.label_async_setting_value.setText(is_async) |
node=self._node, node_name=self._cm_name, parameter_names=param_names) | ||
|
||
# Check the response for valid types | ||
# In Rolling, INTEGER is type 2, BOOL is type 1, NOT_SET is 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# In Rolling, INTEGER is type 2, BOOL is type 1, NOT_SET is 0 | |
# INTEGER is type 2, BOOL is type 1, NOT_SET is 0 |
popup.ctrl_type.setText(ctrl.type) | ||
|
||
|
||
#Fetch the update_rate and is_async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#Fetch the update_rate and is_async | |
# Fetch the update_rate and is_async |
if response.values[1].type == 1: # Found per-controller is_async | ||
is_async = str(response.values[1].bool_value) | ||
|
||
# --- If per-controller update_rate not found, check global --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# --- If per-controller update_rate not found, check global --- | |
# If per-controller update_rate not found, check global |
if response_global.values and response_global.values[0].type == 2: | ||
update_rate = f"{response_global.values[0].integer_value} Hz (Global)" | ||
|
||
# --- Set a default for is_async if not found --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# --- Set a default for is_async if not found --- | |
# Set a default for is_async if not found |
is_async = "False (Default)" | ||
|
||
except Exception as e: | ||
# Use the correct '.warning()' method and no exc_info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Use the correct '.warning()' method and no exc_info |
?
is_async = "N/A" # Default to N/A for now | ||
|
||
try: | ||
# --- Check for per-controller params first --- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# --- Check for per-controller params first --- | |
# Check for per-controller params first |
Fixes #2166
This PR adds the
update_rate
andis_async
parameters to the RQT controller manager details popup window.Implementation Details:
popup_info.ui
to add new QLabel widgets for displaying the information._on_ctrl_info
function incontroller_manager.py
to fetch the parameters usingros2param.api.call_get_parameters
.<controller_name>.update_rate
, etc.).update_rate
or a sensible default (False
foris_async
).Testing:
rrbot
demo fromros2_control_demos
, the popup correctly displays the global and default values as shown below.Result: