fusion-util: geomagnetic-field: Remove unused functions 58/297958/1
authorSangYoun Kwak <sy.kwak@samsung.com>
Wed, 23 Aug 2023 10:45:52 +0000 (19:45 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Tue, 29 Aug 2023 06:54:04 +0000 (15:54 +0900)
Functions below are not used and not tested by the UTC.
 - fusion-util.c: clamp, matrixToQuat
 - geomagnetic-field.c: getDeclination, getInclination

Thus, they are removed.

Change-Id: Ic684158ac796cd5cc05b84db98ca1bdfa9a4858a
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
include/private/sensor-private.h
src/fusion-util.c
src/geomagnetic-field.c

index 0133ea9..fb1df73 100644 (file)
@@ -37,14 +37,10 @@ extern "C"
 {
 #endif
 
-float clamp(float v);
 int getAngleChange(float *R, float *prevR, float *angleChange);
 int quatToMatrix(float *quat, float *R);
-int matrixToQuat(float *mat, float *q);
 int getRotationMatrix(float *accel, float *geo, float *R, float *I);
 int remapCoordinateSystem(float *inR, int X, int Y, float *outR);
-int getDeclination(float *decl);
-int getInclination(float *incl);
 int setCoordinate(float latitude, float longitude, float altitude, float *declination, float *inclination, int option);
 
 #ifdef __cplusplus
index b370cc8..1ac0b45 100644 (file)
 #include <math.h>
 #include <stdlib.h>
 
-float clamp(float v)
-{
-       return (v < 0) ? 0.0 : v;
-}
-
 int getAngleChange(float *R, float *prevR, float *angleChange)
 {
        if (R == NULL || prevR == NULL || angleChange == NULL)
@@ -96,25 +91,6 @@ int quatToMatrix(float *quat, float *R)
        return 0;
 }
 
-int matrixToQuat(float *mat, float *q)
-{
-       if (q == NULL || mat == NULL)
-               return -1;
-
-       const float Hx = mat[0];
-       const float My = mat[4];
-       const float Az = mat[8];
-       q[0] = sqrtf(clamp(Hx - My - Az + 1) * 0.25f);
-       q[1] = sqrtf(clamp(-Hx + My - Az + 1) * 0.25f);
-       q[2] = sqrtf(clamp(-Hx - My + Az + 1) * 0.25f);
-       q[3] = sqrtf(clamp(Hx + My + Az + 1) * 0.25f);
-       q[0] = copysignf(q[0], mat[7] - mat[5]);
-       q[1] = copysignf(q[1], mat[2] - mat[6]);
-       q[2] = copysignf(q[2], mat[3] - mat[1]);
-
-       return 0;
-}
-
 int getRotationMatrix(float *accel, float *geo, float *R, float *I)
 {
        if (accel == NULL || geo == NULL || R == NULL || I == NULL)
index 8093ccb..4bcb9b1 100644 (file)
@@ -59,26 +59,6 @@ static int is_float_equal(float f1, float f2)
        return ((f1 - precision) < f2) && ((f1 + precision) > f2);
 }
 
-int getDeclination(float *decl)
-{
-       if (decl == NULL)
-               return -1;
-
-       *decl = g_declination;
-
-       return 0;
-}
-
-int getInclination(float *incl)
-{
-       if (incl == NULL)
-               return -1;
-
-       *incl = g_inclination;
-
-       return 0;
-}
-
 int setCoordinate(float latitude, float longitude, float altitude, float *declination, float *inclination, int option)
 {
        float dec, dip, ti, gv;