Gravar-mail: Task space adaptation via the learning of gait controllers of magnetic soft millirobots