Added code to the onStop and onPause events to stop the robot. Not
tested.