MEMS-based lidar for autonomous driving