Hi Chris,
Comments below.
After experimenting with this some more, I think I’m comfortable with pushing my changes in to the nightly build. Do you want them in the task definition file build, too?
Great!! I’ll test them in the nightly. I don’t need them in the task definition build for now.
I plan to use a “wait” action for a fixed 25 ms before acting on the output from Python, so I’d be interested in the worst case. I could add another state each time I need to wait for this, but if you expect a non-constant latency perhaps a new action that waits for a variable to take a value would be useful.
After tweaking the timing a bit more, I now get consistent round-trip times of ~20ms with the client bridge and ~10ms with the server bridge. However, I don’t think I can ensure a hard upper limit on the round trip time, so waiting for explicit confirmation that the output from Python has been received would be the more robust approach.
Great. Can I request a wait_for_condition action? ie.
<action type="wait_for_true" condition="python_output_received==1" error_timeout_ms="100" error_message="Python semaphore not high within 100 ms"/>
(If the condition is not true in 100ms the task system stops with a console error.)
We can implement this now in the state system, but it requires creating a separate new state for each wait, this would be a huge improvement.
In practice, I’m likely to use a fixed 30 ms delay action plus an assert for each wait, instead of a new state, so this action would just make for faster, more precise roundtrips.
Dave said a while ago that the server bridge had lower latency - does that mean only for passing events from MWorks to Python (and not the reverse), or is that no longer true?
It’s still true, and the latency is lower in both directions. The reason is that events sent over the client-side bridge have to first pass from server to client before going from the client to the Python process, whereas events going over the server-side bridge go directly from the server to Python.
Good, and it’s nice to know the difference quantitatively: 20ms and 10ms for roundtrips.
Thanks again, this is great.
Mark