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

Add timeout option to call_service messages (backport #984) #994

Merged
merged 4 commits into from
Jan 23, 2025

Conversation

bjsowa
Copy link
Collaborator

@bjsowa bjsowa commented Jan 20, 2025

No description provided.

@bjsowa bjsowa marked this pull request as draft January 20, 2025 18:30
@bjsowa bjsowa marked this pull request as ready for review January 21, 2025 13:54
self.fail("Timed out waiting for service response message.")

self.assertFalse(self.received_message is None)
self.assertEqual(self.received_message["op"], "service_response")
self.assertTrue(self.received_message["result"])

@unittest.skip("Gets stuck in rclpy.shutdown on teardown")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have no idea why this test gets stuck, tried different things but nothing worked. Probably a bug in rclpy

Copy link
Contributor

@sea-bass sea-bass Jan 23, 2025

Choose a reason for hiding this comment

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

If you use a MultiThreadedExecutor instead of the (single-threaded) global ROS executor, does it work?

Or even better, if you set:

self.node.declare_parameter("call_services_in_new_thread", True)

@bjsowa bjsowa requested a review from sea-bass January 21, 2025 14:01
@bjsowa bjsowa merged commit dfc412c into humble Jan 23, 2025
4 checks passed
@bjsowa bjsowa deleted the backport/humble-add-service-timeout branch January 23, 2025 11:03
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.

2 participants