Reinforcement Learning-based Switching Controller for a Milliscale Robot in a Constrained Environment