HAWTHORNE, Calif.—Tesla Motors Inc. unveiled an all-wheel-drive version of its Model S luxury electric car and an automated driving system designed to prevent accidents and even allow vehicles to park themselves.

The new autopilot features rely on a combination of radar, sonar and cameras that are able to recognize stop signs, pedestrians and highway barriers. Tesla Chief Executive Elon Musk said the self-driving features are…