Skip to content

Commit

Permalink
Merge pull request #159 from lkumar93/master
Browse files Browse the repository at this point in the history
Log additional variables and fix a bug
  • Loading branch information
krichardsson authored Nov 9, 2016
2 parents 843bd05 + 03cf9ff commit 3694af4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/modules/src/sensfusion6.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <math.h>

#include "sensfusion6.h"
#include "log.h"
#include "param.h"

#define M_PI_F ((float) M_PI)
Expand Down Expand Up @@ -306,6 +307,18 @@ static void estimatedGravityDirection(float* gx, float* gy, float* gz)
*gz = q0 * q0 - q1 * q1 - q2 * q2 + q3 * q3;
}

LOG_GROUP_START(sensorfusion6)
LOG_ADD(LOG_FLOAT, qw, &q0)
LOG_ADD(LOG_FLOAT, qx, &q1)
LOG_ADD(LOG_FLOAT, qy, &q2)
LOG_ADD(LOG_FLOAT, qz, &q3)
LOG_ADD(LOG_FLOAT, gravityX, &gravX)
LOG_ADD(LOG_FLOAT, gravityY, &gravY)
LOG_ADD(LOG_FLOAT, gravityZ, &gravZ)
LOG_ADD(LOG_FLOAT, accZbase, &baseZacc)
LOG_ADD(LOG_UINT8, isInit, &isInit)
LOG_ADD(LOG_UINT8, isCalibrated, &isCalibrated)
LOG_GROUP_STOP(sensorfusion6)

PARAM_GROUP_START(sensorfusion6)
#ifdef MADWICK_QUATERNION_IMU
Expand Down
2 changes: 1 addition & 1 deletion src/modules/src/sensors_stock.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ PARAM_ADD(PARAM_UINT32, t, &position.timestamp)
PARAM_ADD(PARAM_FLOAT, x, &position.x)
PARAM_ADD(PARAM_FLOAT, y, &position.y)
PARAM_ADD(PARAM_FLOAT, z, &position.z)
PARAM_GROUP_STOP(sensorfusion6)
PARAM_GROUP_STOP(lps)

0 comments on commit 3694af4

Please sign in to comment.