A real-time hierarchical control method for safe human–robot coexistence | Synapse