Schur–Weyl duality for orthogonal groups