Machine-learning method developed to make controlling robots easier