There is a similarity between the receiver in a typical zigbee radio and a GPS receiver. And it goes like this..
RF front end.
Down converter (usually to a low IF)
A/D converter
And lets stop there. At this point a GPS does it's correlation thing. And what makes that work is the sample clock driving the A/D.
If you could take a zigbee apart and use the raw A/D data you would have a timebase with which to measure time of arrival of incoming data packets (relative to the local clock).
Now, if you *could* do that all you then need to do is use the zigbee transmitter itself as the means to (separately) transmit packets used for time of flight measurement and later a packet describing the time of transmission. Again relative to the local clock of the transmitter.
You can see where this is headed. Once you've bounced a couple of packets from A to B and then back from B to A, then A can establish the relationship between its clock and B's clock. Once you have that then the distance calculation is (like it is with GPS) a matter of iteration.
Now, unfortunately, you can't get at the digital data stream and the sample clock of a zigbee receiver. Correct me if I'm wrong there btw
So, why not build a separate special purpose receiver. 2.4ghz front end. (chip suggestions, anyone?) down to a low IF. Then an A/D. build your own clock. Do a bit of DSP and you've got your distance.
I should explain, what happens here is you deliberately craft a timing packet that you transmit via the regular zigbee. Meanwhile your local, special purpose receiver picks up this packet, decodes it and establishes it's timing. Later that timing information is transmitted via a separate zigbee packet. Then you listen using your special purpose receiver for the reply timing packet from the other end and then the corresponding data packet which gives you the clock relationships.
Yes its a bit messy, and yes, it'd be nice if the zigbee people latched onto this idea and you could just read out the respective time intervals. But hey, its worth a thought
Tell me if I'm mad.