Toyota Motor Corp. said its researchers have programmed a vehicle to autonomously drift around obstacles on a closed track, a first that the automaker said provides a preview into how self-driving systems can complement human driving in hazardous conditions.