Yes you read correctly, Researchers at the University of Maryland have developed an algorithm called ProxEmo

This new discovery will enable robots to interact with humans based on their gathered data while the person is walking towards them, If angry the robot will take a wider route around the person, if sad they could approach them and ask if they would like assistance. 

 

More information on this new innovation can be found on wired