State- and context-dependent robotic manipulation and grasping via uncertainty-aware imitation learning