Skip to content
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

fix(params): prevent parameter retrieval crashes in ROS2 #978

Open
wants to merge 2 commits into
base: ros2
Choose a base branch
from

Conversation

Mehsias
Copy link

@Mehsias Mehsias commented Dec 5, 2024

Public API Changes
None

Description

  • Add check for node's fully qualified name to prevent deadlocks
  • Add 2.0s timeout to spin_until_future_complete to avoid endless loop
  • Fix crashes when retrieving parameters via Roslibjs

Fixes #972

Mehsias and others added 2 commits December 5, 2024 09:57
- Add check for node's fully qualified name to prevent deadlocks
- Add 2.0s timeout to spin_until_future_complete
- Fix crashes when retrieving parameters via Roslibjs

Fixes RobotWebTools#972
@@ -238,7 +238,7 @@ def _get_param_names(node_name):
request = ListParameters.Request()
future = client.call_async(request)
if _node.executor:
_node.executor.spin_until_future_complete(future)
_node.executor.spin_until_future_complete(future, timeout_sec=2.0)
Copy link
Contributor

@sea-bass sea-bass Jan 4, 2025

Choose a reason for hiding this comment

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

Changes look good, but this 2.0 may not hold in all cases. Wonder if should at least be a named constant instead of hard-coded, or even better an input argument to this function that comes from a configurable ROS parameter of the node?

Copy link
Contributor

@sea-bass sea-bass Jan 4, 2025

Choose a reason for hiding this comment

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

Also, would it help to add this timeout in the else case right below this as well, which does the same but with the global executor?

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.

ROS2 humble getParams
3 participants