pygazebo
pygazebo copied to clipboard
PyGazebo can now wait until Gazebo starts
Added a feature to allow PyGazebo to wait until Gazebo starts up. This is useful if you want to say launch Gazebo and then wait for the network service to become available before proceeding with your PyGazebo code.
This code will block an event loop, seems like this should be implemented with trollius and set a future instead.
I am little confused on how to do that. Do I just return a future true or false and put this in a coroutine?
Almost. You would return a future object, yes. And then you would do some socket operations using the async API (not using socket directly), and when the connection finally succeeds then you would set the future value to something.
virtuald is correct, you'd want to use trollius/asyncio primitives to accomplish waiting. Here that would mean returning a future object which was invoked when the connection was made.