I’m working with a Portenta C33 UWB shield and Stella UWB.
I'm using the PortentaUWBShield and StellaUWB libraries.
The default examples (UWB_RangingControlee and UWB_Tracker) give me distance using TWR.
I found AoA structs in uwb_types.hpp, but when I try to access angleOfArrival, I get a compile error:
'class UWBRangingData' has no member named 'extraAoaPdoaMeasure'.
Has anyone successfully retrieved both distance and angle (AoA) in the same sketch?
Do I need to run two sessions (TWR + OWR_AOA), or is there a combined mode available in the current library? Please help.
I found the solution to my own question on how to get both distance and angle (AoA) using the Portenta UWB Shield and Stella setup in TWR mode, so sharing it here in case it helps others.
I used the PortentaUWBShield and StellaUWB libraries.
For the Portenta side, open:
File → Examples → PortentaUWBShield → UWB_RangingControlee.ino
For the Stella side, open:
File → Examples → StellaUWB → UWB_Tracker.ino
Keep the example code unchanged except for the rangingHandler() function.
Replace the existing rangingHandler() in both examples with the following:
aoa_azimuth and aoa_elevation are already available inside the TWR measurement structure. These values are stored in Q9.7 fixed-point format, so they must be divided by 128.0 to convert them into degrees. The azimuth FOM (Figure of Merit) indicates the quality or reliability of the angle measurement. After uploading the modified code to both boards and opening the Serial Monitor at 115200 baud(Try in Portenta ), you will be able to see distance, azimuth angle, elevation, and FOM values. So basically, the angle information is already provided by the library, and we only need to read and print those fields inside the rangingHandler() function. Hope this helps anyone working with Portenta UWB Shield and Stella UWB in TWR mode.
From the same setup, I am now able to read and print the azimuth angle successfully. However, I am still trying to understand the exact meaning and functionality of this angle. Could someone explain what this azimuth angle represents physically — i.e., with respect to which board’s orientation (Stella or Portenta) the angle is measured, and how it should be interpreted in the setup?
It would be helpful if someone could explain this in detail.