the frequency (38Khz) is a carrier. the transmitter modulates it's output at 38Khz. The tsop looks for the carrier frequency and rejects signals that fall outside of that (+/- 10%, I think). In remote controls, the binary data is modulated onto the carrier. this helps to prevent interference from other IR sources. the tsop strips the carrier and gives you the modulated data.
for obstacle detection, you don't need any data, just the presence or absence of a relection.