For closed spaces (like a robot in a factory moving pieces from A to B) it is usually the best solution to put some beacons on walls, carpet, edge, doors, etc.. and doing a localisation based on fixed markers or beacons. Here get you an idea: https://parasol.tamu.edu/wafr06/papers/p45.pdf
but I strongly suggest you to read the following book
Forget Voronoi, potential fields and EKF or Markov probabilistic methods. The way you want to go is triangulation between fixed markers. Usually you need at least 3 of them, preferably 4. It is not really difficult as you can image. It is enough to mount a light emitter on your robot, put some reflecting strips on the wall and write a program to read the intensity of the light reflected from the marker and the angle. Some of them are in Infrared light spectrum, so you don't see anything. If I find the book, where I read about this, I ll tell you.
Or you can use a solenoid under the carpet..a line follower just to get the idea. The idea with the reflective strips is the most commons in industry where a robot must move in a given space but on medium-long distance.
A GPS does in reality the same...with 4 satellites