IR sensor does not work well on carpets
You may have noticed that this product is no longer available from well known parts distributors like adafruit.com, sparkfun.com or trossenrobotics.com. I would recommend using a Sharp distance sensor designed for the distances you are interested in:

It is about 10 times the price, but produces a variable voltage that you can read with the Arduino's ADC.  Then you can compensate for floor irregularities in your code.  

If you care to experiment, I obsurved that the better distance measurement devices angle the emitter and sensor to light up &amp; observe the same spot at the desired operating distance:


You might try this with your current sensor.  However, it does not appear the manufacture left you enough lead length to make such an adjustment.