Currently, the behavior of the controller server and the environment step is a bit hacky. Basically, the HTTP request from the emulator to the controller server to request the current controller state needs to wait until the agent has acted in the environment (step). Likewise, the step call needs to wait to return to the agent until the emulator has read the latest controller state. They do this by toggling the value of hold_response and sleeping in a busy wait until the other side toggles its value back.
This should be replaced with a proper, non-blocking async await (see here for some possibilities). Depending on the approach, this may be dependent on the Python3 upgrade (#81). Obviously, this will need thorough testing as well.
Currently, the behavior of the controller server and the environment step is a bit hacky. Basically, the HTTP request from the emulator to the controller server to request the current controller state needs to wait until the agent has acted in the environment (step). Likewise, the step call needs to wait to return to the agent until the emulator has read the latest controller state. They do this by toggling the value of
hold_response
and sleeping in a busy wait until the other side toggles its value back.This should be replaced with a proper, non-blocking async await (see here for some possibilities). Depending on the approach, this may be dependent on the Python3 upgrade (#81). Obviously, this will need thorough testing as well.
See
send_controls
anddo_GET