How to use the evasdk.robot_state.RobotState.ERROR function in evasdk

To help you get started, we’ve selected a few evasdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github automata-tech / eva_python_sdk / evasdk / eva_http_client.py View on Github external
def control_wait_for(self, goal, interval_sec=1):
        """
        control_wait_for will poll Eva's state, waiting for Eva to reach the goal state
        """
        parsed_goal = RobotState(goal)

        while True:
            robot_state = RobotState(self.data_snapshot()['control']['state'])

            if robot_state == RobotState.ERROR:
                eva_error('Eva is in error control state')
            elif robot_state == parsed_goal:
                return

            time.sleep(interval_sec)