Accessing TWR data



I am looking at the uwbtalk examples, and it only gives example on how to use RPT messages. Is there any documentation on how to listen to the two way ranging data?

The same data that is displayed on the TWR tab on the GUI.


TWR Data Format or Type

The procedure for listening to TWR data is exactly the same as the procedure for listening to the RPT messages, which you can find an example of here: How to parse position data emitted by DWUSB GUI?.

The only things you will need to change when dealing with TWR data are the following:

  1. You will need to use the TWR data’s subscription method (uwbtalk_twr_t_subscribe) in order to subscribe to its data stream, instead of the call to uwbtalk_pos3_t_subscribe in the linked example.
  2. You will need to use the proper TWR channel in your subscription method. The files provided on our website for v1.3.30 of the UWBTALK protocol did not include a definition for the TWR data’s channel. However, the TWR data’s channel is simply the character string “TWR”, and thus, you will still be able to subscribe to the TWR data’s channel if you replace the RPT data’s channel (UWBTALK_CHAN_POS3) with the TWR data’s channel (“TWR”) in the linked example.
  3. In the callback function you pass into the uwbtalk_twr_t_subscribe function, you will want to have as the data structure parameter the twr_t data structure (as opposed to the POS3_receive_callback in the linked example which has the uwbtalk_pos3_t as the data structure).

If you do all of the above, you will be able to listen to the two way ranging data directly instead of only being able to see it through our GUI.


Also, just to clarify, the TWR data between any two devices is only calculated and published whenever there is an open tab between those two devices in the TWR window of the GUI, so you can listen to the TWR data that is used in our GUI, but only when our GUI is open on the TWR tab.


First of all, I would like to thank you for your awesome, and quick support. It has been great to work with you guys.

I have another request. While it is possible to setup the environment through the GUI, it has been growing annoying to have to setup through the gui every time I want to test or accidentally unplug the device.

Is there a way to setup through the .cfg, or through UWBtalk, to specify the tabs to open on the TWR page?


As of DWUSB-GUI REL-, there is no way to specify which tabs to open on the TWR page other than the “New Tab” option in the menu bar, but as you are not the first person to make such a request, this is definitely a feature that we intend to add into the GUI in the next couple of releases.



Is there a way to access the TWR data from the newer CUWB-Server software without running the gui similar to how we can access the RTLS data?



We do not currently support this. Currently we only emit TWR data for the items that are being graphed in the GUI.