Man sentenced to prison in robbery plea agreement