Yes, it is trivial to calculate how to respond to known hazards. What is hard to calculate is what the hazards actually are in any given situation. Humans don't merely look at the road and compute how much standing water is there, they have prior experiences and a sense of what other drivers are doing on the road and why they are doing those things.
Machine Learning still confuses Elephants for Cats.
While it's quite fun if you pin up a cat dressed up in an elephant costume and surely amuses a few colleagues, a self-driving car is not something that should confuse an Elephant for a Cat.
ML is IMO not reliable enough for use in self-driving cars, in complicated situations the driver should take over.
humans regularly get killed misjudging how much water is in underpasses, I guess an autonomous car based on detailed mapping can measure water deep quite better comparing sensor result with its map (eventually).