* * *
Programming a machine to do something is easy. Programming a machine to pick the right thing to do out of a bunch of options is much, much harder.
It's dead simple to program a robot to pick something up and put it somewhere else; one of my final projects in college was to build an interface between computer and robot arm, and then program the robot arm to do just that. It worked flawlessly, although the repeatability was rather bad since it was a cheap training device with no position feedback. (The point was building the interface and programming it.)
I could have it pick up an object, move it elsewhere, and set it down again; and having finished that much with time to spare, I wrote an additional routine to pick that object back up (most of the time--"repeatability") and put it back more-or-less where it started. Given more time I probably would have added an optional routine to set the object down wherever you wanted, specified by user input, and then pick it up again from there.
Dead simple stuff. Dead simple because the robot didn't have to make any choices; all it had to do was follow the given instructions.
But if there was nothing to pick up? It would gladly go through the motions, closing the "hand" on empty air and moving it to the target location. The object had to be right at the origin point, because the robot could not adjust its position to pick it up, and if it was off at all, the object would slide out from between the fingers and the robot would move empty air to the destination.
The problem with autonomy in machines is that it's very hard to make it reliable. When you're driving, you're constantly making decisions--dozens a second--about which way to point the wheels, how much pressure to put on which pedal, and so forth. When something moves into your path, it takes perhaps a quarter of a second for you to decide how to react, but false positives are rare: you'll stand on the brakes if it's a person, but you'll shrug it off if it's a leaf or an empty plastic bag.
Programming that kind of judgement into a computer is very, very hard to do. It is, as I said, dead simple to program a robot to pick up something and move it elsewhere, as long as that "something" is always where the robot expects it to be. What's hard is to give the robot the ability to decide what to pick up, and to give it some degree of latitude as to where it can pick it up from.
And even doing that is a vastly simpler task than driving a car!
The first self-driving vehicle I ever saw was a panel van that drove itself at the stunning speed of about thirty feet per minute. It needed to be that big to contain the electronics, and the computes of the time couldn't process fast enough. We've made some big steps forward in the last twenty-five years, but this is decidedly not a solved problem.
* * *
Had to fill up when gas was $3.10 a gallon, and of course a few days later it dropped to $2.92. A fiver says that it's now back at (or above) that $3.10 mark, since Trump ruined the world by pulling out of Obama's stupid Iran deal. *rolleyes*