setDelay() AntennaDelay isn't updated.
mikucukyilmaz opened this issue · 0 comments
mikucukyilmaz commented
Hi ,
When using SetDelay library use dev->antennaDelay to calculate futureTime. But dev->antennaDelay set to 0 in uwbInit.So it doesn't add antennaDelay to futureTime calculation.
dwTime_t delay = {.full = 0};
dwSetAntenaDelay(dwm, delay);
But in dwInit()
writeValueToBytes(dev->antennaDelay.raw, 16384, LEN_STAMP);
ANTENNA_DELAY/2 value in twr_tag & anchor ~16475. I guess in uwbInit() if antennaDelay set correctly it could be used for calculations and
#define ANTENNA_OFFSET 154.6 // In meter
#define ANTENNA_DELAY (ANTENNA_OFFSET*499.2e6*128)/299792458.0 // In radio tick
part of the code can be moved to uwb.h . dev->antennaDelay can bu used for adding & subtracting from departure & arrival times.