A few years ago, Silicon Valley companies working in the tech area known colloquially as artificial intelligence or AI convinced traditional car companies that they could handle these edge cases. Using sophisticated software and probability theory, these AI-driven cars would easily predict when a mattress was about to fall off a truck in front of them or when another car was about to cut them off.

But the designers were wrong.

"They thought, ‘We're all done but for the software,'” said Sam Anthony, the chief technology officer and cofounder of Perceptive Automata. Anthony's Boston-based company is developing software that can predict what a nearby pedestrian is likely to do — whether he or she is about to jaywalk, continue strolling along the sidewalk or suddenly rush into a crosswalk.

Human whims foil cars’ technology

The pedestrian problem is serious. If all the cars and trucks on the street were to suddenly become autonomous and follow the same rules, they still would have to deal with humans and their quirks, including pedestrians and people riding bicycles.

Adding more sensors and technology means adding more cost. Just four years ago, automotive suppliers believed they would be able to offer autonomous systems that would only add $8,000 to the price of a car today.

But the cost has remained stubbornly high, primarily because of a need for more advanced sensors like lidar and more computing power, which together can almost double the price of a basic sedan.

The one exception has been Tesla, which is trying to do more with less technology than other carmakers. It is the only company that believes it can get self-driving cars to work without expensive sensors and instead rely only on video cameras, radar and short-range ultrasonic sensors.

However, Tesla's confident chief executive, Elon Musk, initially said the magic software that would turn his cars into autonomous vehicles would be released in fall 2019. It still hasn't appeared, and the latest information from Tesla, based in Palo Alto, California, is that the self-driving feature will work only in very specific conditions, weather and roads permitting.

Here or there, but not everywhere

The final challenge facing autonomous cars is consumer acceptance. Automotive companies often couch the issue in terms of government regulation, but what they really mean is the introduction of self-driving vehicles will require a receptive audience.

Once the public clearly wants it, legislation will fall quickly into place.

Toward that end, upstarts like Yandex are working with authorities in towns like Innopolis, Russia, about 450 miles east of Moscow, on pilot projects that test consumer acceptance as much as they do the technology. Others, like Ford's Detroit-based autonomous vehicle division, also are taking a city-by-city approach, working closely with local municipalities before letting their self-driving vehicles loose on city streets.

So when will we get our autonomous cars?

Ford says it is still on track to offer commercial service by the end of 2021. By that they mean a form of robotic taxi service limited to certain predefined areas.

It already is testing the service in six U.S. cities — Austin, Texas; Detroit; Miami; Palo Alto, California; Pittsburgh and Washington, D.C. — and Ford has committed to offering the robot taxi in Austin, Miami and Washington. From California to Florida, companies such as EasyMile, May Mobility and Transdev also are testing slow-moving, self-driving shuttles.

Other companies ranging from Volvo to Waymo have said they are no longer making predictions about when fully self-driving cars will be available to buy. But they all are convinced our self-driving cars are coming.

According to Ford's Rich, “It's not an ‘if.’ It's a ‘when.'"

John R. Quain is a contributor to the New York Times and editor-in-chief of OntheRoad.