Death caused by automated vehicle is not the controversial aspect, the difficulty comes when there is a choice that the vehicle must make between possible outcomes:
* avoid crashing into pedestrian(s) but kill occupant(s)
* crash into pedestrian(s) to save occupant(s)
Real life trolley problem at work and programmed by someone somewhere
Trolley problems don't really come up in real driving. If there are pedestrians in the way the driver, human or not will nearly always hit the brakes and that is unlikely to kill the occupants.
* avoid crashing into pedestrian(s) but kill occupant(s)
* crash into pedestrian(s) to save occupant(s)
Real life trolley problem at work and programmed by someone somewhere