Modelling Human-Robot Interaction to Optimize Their Safety, Sustainability and Efficiency