  Uncertainty in perception, actuation, and the environment often require
multiple attempts for a robotic task to be successful. We study a class of
problems providing (1) low-entropy indicators of terminal success / failure,
and (2) unreliable (high-entropy) data to predict the final outcome of an
ongoing task. Examples include a robot trying to connect with a charging
station, parallel parking, or assembling a tightly-fitting part. The ability to
restart after predicting failure early, versus simply running to failure, can
significantly decrease the makespan, that is, the total time to completion,
with the drawback of potentially short-cutting an otherwise successful
operation. Assuming task running times to be Poisson distributed, and using a
Markov Jump process to capture the dynamics of the underlying Markov Decision
Process, we derive a closed form solution that predicts makespan based on the
confusion matrix of the failure predictor. This allows the robot to learn
failure prediction in a production environment, and only adopt a preemptive
policy when it actually saves time. We demonstrate this approach using a
robotic peg-in-hole assembly problem using a real robotic system. Failures are
predicted by a dilated convolutional network based on force-torque data,
showing an average makespan reduction from 101s to 81s (N=120, p<0.05). We
posit that the proposed algorithm generalizes to any robotic behavior with an
unambiguous terminal reward, with wide ranging applications on how robots can
learn and improve their behaviors in the wild.
