Guiding a robot by visual feedback in assembling tasks