Grasp planning with a soft reconfigurable gripper exploiting embedded and environmental constraints