Learning to navigate endoscopic capsule robots