Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def control_cancel(self, wait_for_ready=True):
r = self.api_call_with_auth('POST', 'controls/cancel')
if r.status_code != 200:
eva_error('control_cancel error', r)
elif wait_for_ready:
time.sleep(0.1) # sleep for small period to avoid race condition between updating cache and reading state
self.control_wait_for(RobotState.READY)