Skip to content

Commit

Permalink
#163 Corrections to remove unused variables due to build configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed Nov 23, 2016
1 parent 6ecbff0 commit 143aebc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/deck/drivers/src/lpsTdoaTag.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ static uint64_t truncateToTimeStamp(uint64_t fullTimeStamp) {
return fullTimeStamp & 0x00FFFFFFFFFFul;
}

#ifdef ESTIMATOR_TYPE_kalman
static void enqueueTDOA(uint8_t anchor, double distanceDiff, double timeBetweenMeasurements) {
tdoaMeasurement_t tdoa = {
.stdDev = MEASUREMENT_NOISE_STD,
Expand All @@ -89,10 +90,9 @@ static void enqueueTDOA(uint8_t anchor, double distanceDiff, double timeBetweenM
}
};

#ifdef ESTIMATOR_TYPE_kalman
stateEstimatorEnqueueTDOA(&tdoa);
#endif
}
#endif

// A note on variable names. They might seem a bit verbose but express quite a lot of information
// We have three actors: Master (M), Anchor n (An) and the deck on the CF called Tag (T)
Expand Down Expand Up @@ -146,12 +146,14 @@ static void rxcallback(dwDevice_t *dev) {
int64_t timeDiffOfArrival_in_cl_M = truncateToTimeStamp(rxAn_by_T_in_cl_T - rxM_by_T_in_cl_T) * clockCorrection_T_To_M - delta_txM_to_txAn_in_cl_M;

float tdoaDistDiff = SPEED_OF_LIGHT * timeDiffOfArrival_in_cl_M / LOCODECK_TS_FREQ;
float timeBetweenMeasurements = truncateToTimeStamp(rxAn_by_T_in_cl_T - rxM_by_T_in_cl_T) / LOCODECK_TS_FREQ;

// Sanity check distances in case of missed packages
if (tdoaDistDiff > -MAX_DISTANCE_DIFF && tdoaDistDiff < MAX_DISTANCE_DIFF) {
uwbTdoaDistDiff[anchor] = tdoaDistDiff;
#ifdef ESTIMATOR_TYPE_kalman
float timeBetweenMeasurements = truncateToTimeStamp(rxAn_by_T_in_cl_T - rxM_by_T_in_cl_T) / LOCODECK_TS_FREQ;
enqueueTDOA(anchor, tdoaDistDiff, timeBetweenMeasurements);
#endif
}
}

Expand Down

0 comments on commit 143aebc

Please sign in to comment.