def reset_arm(self, arm, mode, data): """ Issues a position command to an arm. Args: arm: Either TRIAL_ARM or AUXILIARY_ARM. mode: An integer code (defined in gps_pb2). data: An array of floats. """ reset_command = PositionCommand() reset_command.mode = mode reset_command.data = data reset_command.pd_gains = self._hyperparams['pid_params'] reset_command.arm = arm timeout = self._hyperparams['trial_timeout'] reset_command.id = self._get_next_seq_id() self._reset_service.publish_and_wait(reset_command, timeout=timeout)
def reset_arm(self, arm, mode, data): """ Issues a position command to an arm. Args: arm: Either TRIAL_ARM or AUXILIARY_ARM. mode: An integer code (defined in gps_pb2). data: An array of floats. """ reset_command = PositionCommand() reset_command.mode = mode reset_command.data = data reset_command.pd_gains = self._hyperparams['pid_params'] reset_command.arm = arm timeout = self._hyperparams['trial_timeout'] reset_command.id = self._get_next_seq_id() try: self._reset_service.publish_and_wait(reset_command, timeout=timeout) except TimeoutException: self.relax_arm(arm) wait = raw_input( 'The robot arm seems to be stuck. Unstuck it and press <ENTER> to continue.' ) self.reset_arm(arm, mode, data)