A unified architecture for physical and ergonomic human–robot collaboration