bitcraze / libdw1000

Driver for DW1000
Apache License 2.0
44 stars 32 forks source link

setDelay() AntennaDelay isn't updated. #4

Closed mikucukyilmaz closed 7 years ago

mikucukyilmaz commented 7 years ago

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.