From 635a483dea87f784e9f7f97f895718ef594536c9 Mon Sep 17 00:00:00 2001 From: Adriana Reus Date: Mon, 26 May 2014 14:54:54 +0300 Subject: [PATCH] Tweaked parameters for faster magnetometer calibration These parameters are taken into consideration when collecting the data samples (the points that we are going to fit on an ellipsoid). MIN_DIFF Minimum difference between collected points (there is no point in collecting events that are similar or very close because we won't get a sphere or an ellipsoid that way, however a big value doesn't make much sense either because the time of collecting a certain number of "good" events would increase, many would be rejected) MAX_SQR_ERR Maximum allowed error for a calibration, if a calibration has an error bigger than this we won't allow it. LOOKBACK_COUNT The number of previous events that we consider that should be different enough from the current event (tightly coupled to the MIN_DIFF parameter). The smaller the MIN_DIFF and the LOOPBACK_COUNT the faster a collection is gathered. The bigger the MAX_SQR_ERR the faster a calibration is accepted. Testing shows that this new set of parameters leads to a faster first calibration with no visible user impact on its quality. Change-Id: Ibe09c02c00975321459d599039d7e4767a880e96 Signed-off-by: Adriana Reus Signed-off-by: Patrick Porlan --- calibration.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/calibration.h b/calibration.h index 3da2156..dd67ed3 100644 --- a/calibration.h +++ b/calibration.h @@ -13,12 +13,12 @@ /* If no cal data is present - first calibration will use a more relaxed set of values to get an initial calibration faster */ -#define FIRST_MIN_DIFF 1.0f -#define FIRST_MAX_SQR_ERR 3.5f +#define FIRST_MIN_DIFF 0.5f +#define FIRST_MAX_SQR_ERR 5.0f #define FIRST_LOOKBACK_COUNT 4 -#define MIN_DIFF 1.5f -#define MAX_SQR_ERR 2.5f +#define MIN_DIFF 1.0f +#define MAX_SQR_ERR 3.5f #define LOOKBACK_COUNT 6 -- 2.11.0