Task-based Grasp Adaptation on a Humanoid Robot