Electron spin resonance of Er in cubic metals: Th:Er, Rh:Er, Pt:Er and Cu:Er