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

Unity hangs when client is waiting for service being debugged #63

Open
moccij opened this issue Mar 13, 2024 · 2 comments
Open

Unity hangs when client is waiting for service being debugged #63

moccij opened this issue Mar 13, 2024 · 2 comments

Comments

@moccij
Copy link

moccij commented Mar 13, 2024

Hi,

By calling the desired service with Call(request) from a Unity client, the service implemented on another C++ process executes its callback and builds the response, so that Unity can receive and process it. Under normal conditions the Unity client is always able to process the response, even when the C++ service callback takes time to complete the callback.

If the C++ service callback hits a debugger breakpoint and then gets resumed after some time (20secs), then the Unity client never receives the response and hangs, unable to recover. If the callback gets resumed very early then the Unity client is more likely to receive the response.

This behavior is not observed when calling the service from a C++ or Python client (ex. with rqt).

All ROS2 binaries are built for Windows x64 from ROS2 Humble sources. The connector binaries are also compiled in the same way. Debugging is done with cdb.

This problem is reproduced on multiple machines, with both Windows 10 and Windows 11.

@krosthw
Copy link

krosthw commented Aug 7, 2024

Same problem here!
also for the example in this repo: ros2cs_examples/ROS2Client + ROS2Service the Call method never returns.
Calling the service from rqt, it returns the expected result.

@Deric-W
Copy link
Contributor

Deric-W commented Aug 7, 2024

also for the example in this repo: ros2cs_examples/ROS2Client + ROS2Service the Call method never returns.

I can confirm this, when changing the client to use the wait set I totally forgot to spin in the example, which is why the client example does not handle incoming responses.

I will create a PR to update the examples soon, but that won't fix the strange behavior with the debugged service.

When I have time I will create a C example to test what the C++ implementation does in addition to the calls ros2cs does.

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

No branches or pull requests

3 participants