mirror of
https://github.com/collabora/libsurvive.git
synced 2026-08-04 00:51:21 -04:00
initialize variables before logging
This commit is contained in:
parent
440518bb7b
commit
32cf62c527
1 changed files with 4 additions and 2 deletions
|
|
@ -132,6 +132,8 @@ static inline bool SurviveSensorActivations_check_outlier(SurviveSensorActivatio
|
|||
FLT *oldangle = &self->angles[sensor_id][lh][axis];
|
||||
FLT chauvenet_criterion = -1;
|
||||
FLT dev = 0;
|
||||
FLT measured_dev = -1;
|
||||
int cnt = -1;
|
||||
const char *failure_reason = "None";
|
||||
if (self->angles_center_dev[lh][axis] == 0) {
|
||||
goto accept_data;
|
||||
|
|
@ -143,9 +145,9 @@ static inline bool SurviveSensorActivations_check_outlier(SurviveSensorActivatio
|
|||
goto delta_failure;
|
||||
}
|
||||
|
||||
FLT measured_dev = self->angles_center_dev[lh][axis];
|
||||
measured_dev = self->angles_center_dev[lh][axis];
|
||||
dev = linmath_max(self->params.filterVarianceMin, measured_dev);
|
||||
int cnt = self->angles_center_cnt[lh][axis];
|
||||
cnt = self->angles_center_cnt[lh][axis];
|
||||
if (cnt < self->params.filterOutlierMinCount)
|
||||
cnt = self->params.filterOutlierMinCount;
|
||||
chauvenet_criterion = linmath_chauvenet_criterion(angle, self->angles_center_x[lh][axis], dev, cnt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue