Safety for human-robot interaction in dynamic environments