Decawave offers a ready to use PANS but not the source code. And they offer a simple example for pair ranging.
The only thing Decawave do not provide is a TDMA for positioning a node within many anchors.
I have developed an open source code to do that, I’ve been posting it all around in this forum, you can just google “uwb meshposition” if you don’t find it, or if you have any question let me know.
But this only gives you a single sided range for each device. To get two way ranges for each device you need more messages.
A TWR requires 3 or 4 messages (1) a->b, 2) b->a, 3) a->b 4) b->a data packet with results) so to combine this we do:
A transmit acts as AB1, AC1, AD1
B transmit acts as BC1, BD1, AB2
C transmit acts as CD1, AC2, BC2
D transmit acta as AD2, BD2, CD2
A transmit acts as AB3, AC3, AD3 and results data from unit A to others.
B transmit acts as BC3, BD3 and results data from unit B to others.
C transmit acts as CD3 and results data from unit C to others.
D transmits results to others.
At this point all units have all of the information to calculate all of the ranges.
Personally I didn’t need this type of functionality very frequently and had optimised the 4 packet point to point two way range system so that it takes 1.25 ms so rather than implement a second completely different measurement method I opted for the simple but slow method of doing lots of point to point ranges. It keeps the radio side of things constant no matter how many devices are involved, all the extra complexity is done outside of the radio logic.
I was simply going by the decawave app note that the number of packets for TWR using point to point is ranges order n^2 but for a highly asymmetric system you can do it in 2n packets.
If you don’t mind it being single sided then it only requires n packets.
It depends on the accuracy you want however given the inaccuracies in single sided ranging, especially with the levels of delay involved in such a system, I would have thought that a double sided system would be worth the extra time. Unless you don’t mind massive errors the performance benefits will normally more than compensate for the longer time and higher power requirements.