forked from Archive/PX4-Autopilot
Merge pull request #178 from PX4/attitude_filter_improvement
Better attitude filter, not sensitive to sudden accelerations
This commit is contained in:
commit
2e73421fa0
|
@ -47,8 +47,6 @@ CSRCS = attitude_estimator_ekf_main.c \
|
|||
codegen/rtGetInf.c \
|
||||
codegen/rtGetNaN.c \
|
||||
codegen/norm.c \
|
||||
codegen/diag.c \
|
||||
codegen/power.c \
|
||||
codegen/cross.c
|
||||
|
||||
|
||||
|
|
|
@ -431,6 +431,10 @@ int attitude_estimator_ekf_thread_main(int argc, char *argv[])
|
|||
att.rollspeed = x_aposteriori[0];
|
||||
att.pitchspeed = x_aposteriori[1];
|
||||
att.yawspeed = x_aposteriori[2];
|
||||
att.rollacc = x_aposteriori[3];
|
||||
att.pitchacc = x_aposteriori[4];
|
||||
att.yawacc = x_aposteriori[5];
|
||||
|
||||
//att.yawspeed =z_k[2] ;
|
||||
/* copy offsets */
|
||||
memcpy(&att.rate_offsets, &(x_aposteriori[3]), sizeof(att.rate_offsets));
|
||||
|
|
|
@ -44,34 +44,20 @@
|
|||
/* Extended Kalman Filter covariances */
|
||||
|
||||
/* gyro process noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q0, 1e1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q1, 1e1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q2, 1e1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_Q0, 1e-4f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_Q1, 0.08f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_Q2, 0.009f);
|
||||
/* gyro offsets process noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q3, 1e-4f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q4, 1e-4f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q5, 1e-4f);
|
||||
/* accelerometer process noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q6, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q7, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q8, 1e-1f);
|
||||
/* magnetometer process noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q9, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q10, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_Q11, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_Q3, 0.005f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_Q4, 0.0f);
|
||||
|
||||
/* gyro measurement noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R0, 0.01f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R1, 0.01f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R2, 0.01f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_R0, 0.0008f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_R1, 0.8f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_R2, 1.0f);
|
||||
/* accelerometer measurement noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R3, 1e2f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R4, 1e2f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R5, 1e2f);
|
||||
/* magnetometer measurement noise */
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R6, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R7, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_R8, 1e-1f);
|
||||
PARAM_DEFINE_FLOAT(EKF_ATT_V2_R3, 0.0f);
|
||||
|
||||
/* offsets in roll, pitch and yaw of sensor plane and body */
|
||||
PARAM_DEFINE_FLOAT(ATT_ROLL_OFFS, 0.0f);
|
||||
PARAM_DEFINE_FLOAT(ATT_PITCH_OFFS, 0.0f);
|
||||
|
@ -80,28 +66,16 @@ PARAM_DEFINE_FLOAT(ATT_YAW_OFFS, 0.0f);
|
|||
int parameters_init(struct attitude_estimator_ekf_param_handles *h)
|
||||
{
|
||||
/* PID parameters */
|
||||
h->q0 = param_find("EKF_ATT_Q0");
|
||||
h->q1 = param_find("EKF_ATT_Q1");
|
||||
h->q2 = param_find("EKF_ATT_Q2");
|
||||
h->q3 = param_find("EKF_ATT_Q3");
|
||||
h->q4 = param_find("EKF_ATT_Q4");
|
||||
h->q5 = param_find("EKF_ATT_Q5");
|
||||
h->q6 = param_find("EKF_ATT_Q6");
|
||||
h->q7 = param_find("EKF_ATT_Q7");
|
||||
h->q8 = param_find("EKF_ATT_Q8");
|
||||
h->q9 = param_find("EKF_ATT_Q9");
|
||||
h->q10 = param_find("EKF_ATT_Q10");
|
||||
h->q11 = param_find("EKF_ATT_Q11");
|
||||
h->q0 = param_find("EKF_ATT_V2_Q0");
|
||||
h->q1 = param_find("EKF_ATT_V2_Q1");
|
||||
h->q2 = param_find("EKF_ATT_V2_Q2");
|
||||
h->q3 = param_find("EKF_ATT_V2_Q3");
|
||||
h->q4 = param_find("EKF_ATT_V2_Q4");
|
||||
|
||||
h->r0 = param_find("EKF_ATT_R0");
|
||||
h->r1 = param_find("EKF_ATT_R1");
|
||||
h->r2 = param_find("EKF_ATT_R2");
|
||||
h->r3 = param_find("EKF_ATT_R3");
|
||||
h->r4 = param_find("EKF_ATT_R4");
|
||||
h->r5 = param_find("EKF_ATT_R5");
|
||||
h->r6 = param_find("EKF_ATT_R6");
|
||||
h->r7 = param_find("EKF_ATT_R7");
|
||||
h->r8 = param_find("EKF_ATT_R8");
|
||||
h->r0 = param_find("EKF_ATT_V2_R0");
|
||||
h->r1 = param_find("EKF_ATT_V2_R1");
|
||||
h->r2 = param_find("EKF_ATT_V2_R2");
|
||||
h->r3 = param_find("EKF_ATT_V2_R3");
|
||||
|
||||
h->roll_off = param_find("ATT_ROLL_OFFS");
|
||||
h->pitch_off = param_find("ATT_PITCH_OFFS");
|
||||
|
@ -117,23 +91,11 @@ int parameters_update(const struct attitude_estimator_ekf_param_handles *h, stru
|
|||
param_get(h->q2, &(p->q[2]));
|
||||
param_get(h->q3, &(p->q[3]));
|
||||
param_get(h->q4, &(p->q[4]));
|
||||
param_get(h->q5, &(p->q[5]));
|
||||
param_get(h->q6, &(p->q[6]));
|
||||
param_get(h->q7, &(p->q[7]));
|
||||
param_get(h->q8, &(p->q[8]));
|
||||
param_get(h->q9, &(p->q[9]));
|
||||
param_get(h->q10, &(p->q[10]));
|
||||
param_get(h->q11, &(p->q[11]));
|
||||
|
||||
param_get(h->r0, &(p->r[0]));
|
||||
param_get(h->r1, &(p->r[1]));
|
||||
param_get(h->r2, &(p->r[2]));
|
||||
param_get(h->r3, &(p->r[3]));
|
||||
param_get(h->r4, &(p->r[4]));
|
||||
param_get(h->r5, &(p->r[5]));
|
||||
param_get(h->r6, &(p->r[6]));
|
||||
param_get(h->r7, &(p->r[7]));
|
||||
param_get(h->r8, &(p->r[8]));
|
||||
|
||||
param_get(h->roll_off, &(p->roll_off));
|
||||
param_get(h->pitch_off, &(p->pitch_off));
|
||||
|
|
|
@ -50,8 +50,8 @@ struct attitude_estimator_ekf_params {
|
|||
};
|
||||
|
||||
struct attitude_estimator_ekf_param_handles {
|
||||
param_t r0, r1, r2, r3, r4, r5, r6, r7, r8;
|
||||
param_t q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, q10, q11;
|
||||
param_t r0, r1, r2, r3;
|
||||
param_t q0, q1, q2, q3, q4;
|
||||
param_t roll_off, pitch_off, yaw_off;
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -29,6 +29,6 @@
|
|||
/* Variable Definitions */
|
||||
|
||||
/* Function Declarations */
|
||||
extern void attitudeKalmanfilter(const uint8_T updateVect[3], real32_T dt, const real32_T z[9], const real32_T x_aposteriori_k[12], const real32_T P_aposteriori_k[144], const real32_T q[12], const real32_T r[9], real32_T eulerAngles[3], real32_T Rot_matrix[9], real32_T x_aposteriori[12], real32_T P_aposteriori[144]);
|
||||
extern void attitudeKalmanfilter(const uint8_T updateVect[3], real32_T dt, const real32_T z[9], const real32_T x_aposteriori_k[12], const real32_T P_aposteriori_k[144], const real32_T q[12], real32_T r[9], real32_T eulerAngles[3], real32_T Rot_matrix[9], real32_T x_aposteriori[12], real32_T P_aposteriori[144]);
|
||||
#endif
|
||||
/* End of code generation (attitudeKalmanfilter.h) */
|
||||
|
|
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.c
Normal file → Executable file
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.c
Normal file → Executable file
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter_initialize'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.h
Normal file → Executable file
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_initialize.h
Normal file → Executable file
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter_initialize'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.c
Normal file → Executable file
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.c
Normal file → Executable file
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter_terminate'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.h
Normal file → Executable file
2
apps/attitude_estimator_ekf/codegen/attitudeKalmanfilter_terminate.h
Normal file → Executable file
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter_terminate'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'cross'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'cross'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,78 +0,0 @@
|
|||
/*
|
||||
* diag.c
|
||||
*
|
||||
* Code generation for function 'diag'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
*
|
||||
*/
|
||||
|
||||
/* Include files */
|
||||
#include "rt_nonfinite.h"
|
||||
#include "attitudeKalmanfilter.h"
|
||||
#include "diag.h"
|
||||
|
||||
/* Type Definitions */
|
||||
|
||||
/* Named Constants */
|
||||
|
||||
/* Variable Declarations */
|
||||
|
||||
/* Variable Definitions */
|
||||
|
||||
/* Function Declarations */
|
||||
|
||||
/* Function Definitions */
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void b_diag(const real32_T v[9], real32_T d[81])
|
||||
{
|
||||
int32_T j;
|
||||
memset(&d[0], 0, 81U * sizeof(real32_T));
|
||||
for (j = 0; j < 9; j++) {
|
||||
d[j + 9 * j] = v[j];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void c_diag(const real32_T v[3], real32_T d[9])
|
||||
{
|
||||
int32_T j;
|
||||
for (j = 0; j < 9; j++) {
|
||||
d[j] = 0.0F;
|
||||
}
|
||||
|
||||
for (j = 0; j < 3; j++) {
|
||||
d[j + 3 * j] = v[j];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void d_diag(const real32_T v[6], real32_T d[36])
|
||||
{
|
||||
int32_T j;
|
||||
memset(&d[0], 0, 36U * sizeof(real32_T));
|
||||
for (j = 0; j < 6; j++) {
|
||||
d[j + 6 * j] = v[j];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void diag(const real32_T v[12], real32_T d[144])
|
||||
{
|
||||
int32_T j;
|
||||
memset(&d[0], 0, 144U * sizeof(real32_T));
|
||||
for (j = 0; j < 12; j++) {
|
||||
d[j + 12 * j] = v[j];
|
||||
}
|
||||
}
|
||||
|
||||
/* End of code generation (diag.c) */
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* diag.h
|
||||
*
|
||||
* Code generation for function 'diag'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __DIAG_H__
|
||||
#define __DIAG_H__
|
||||
/* Include files */
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "rt_defines.h"
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
#include "rtwtypes.h"
|
||||
#include "attitudeKalmanfilter_types.h"
|
||||
|
||||
/* Type Definitions */
|
||||
|
||||
/* Named Constants */
|
||||
|
||||
/* Variable Declarations */
|
||||
|
||||
/* Variable Definitions */
|
||||
|
||||
/* Function Declarations */
|
||||
extern void b_diag(const real32_T v[9], real32_T d[81]);
|
||||
extern void c_diag(const real32_T v[3], real32_T d[9]);
|
||||
extern void d_diag(const real32_T v[6], real32_T d[36]);
|
||||
extern void diag(const real32_T v[12], real32_T d[144]);
|
||||
#endif
|
||||
/* End of code generation (diag.h) */
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'eye'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'eye'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'mrdivide'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'mrdivide'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'norm'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'norm'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* power.c
|
||||
*
|
||||
* Code generation for function 'power'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
*
|
||||
*/
|
||||
|
||||
/* Include files */
|
||||
#include "rt_nonfinite.h"
|
||||
#include "attitudeKalmanfilter.h"
|
||||
#include "power.h"
|
||||
|
||||
/* Type Definitions */
|
||||
|
||||
/* Named Constants */
|
||||
|
||||
/* Variable Declarations */
|
||||
|
||||
/* Variable Definitions */
|
||||
|
||||
/* Function Declarations */
|
||||
static real32_T rt_powf_snf(real32_T u0, real32_T u1);
|
||||
|
||||
/* Function Definitions */
|
||||
static real32_T rt_powf_snf(real32_T u0, real32_T u1)
|
||||
{
|
||||
real32_T y;
|
||||
real32_T f1;
|
||||
real32_T f2;
|
||||
if (rtIsNaNF(u0) || rtIsNaNF(u1)) {
|
||||
y = ((real32_T)rtNaN);
|
||||
} else {
|
||||
f1 = (real32_T)fabs(u0);
|
||||
f2 = (real32_T)fabs(u1);
|
||||
if (rtIsInfF(u1)) {
|
||||
if (f1 == 1.0F) {
|
||||
y = ((real32_T)rtNaN);
|
||||
} else if (f1 > 1.0F) {
|
||||
if (u1 > 0.0F) {
|
||||
y = ((real32_T)rtInf);
|
||||
} else {
|
||||
y = 0.0F;
|
||||
}
|
||||
} else if (u1 > 0.0F) {
|
||||
y = 0.0F;
|
||||
} else {
|
||||
y = ((real32_T)rtInf);
|
||||
}
|
||||
} else if (f2 == 0.0F) {
|
||||
y = 1.0F;
|
||||
} else if (f2 == 1.0F) {
|
||||
if (u1 > 0.0F) {
|
||||
y = u0;
|
||||
} else {
|
||||
y = 1.0F / u0;
|
||||
}
|
||||
} else if (u1 == 2.0F) {
|
||||
y = u0 * u0;
|
||||
} else if ((u1 == 0.5F) && (u0 >= 0.0F)) {
|
||||
y = (real32_T)sqrt(u0);
|
||||
} else if ((u0 < 0.0F) && (u1 > (real32_T)floor(u1))) {
|
||||
y = ((real32_T)rtNaN);
|
||||
} else {
|
||||
y = (real32_T)pow(u0, u1);
|
||||
}
|
||||
}
|
||||
|
||||
return y;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
void power(const real32_T a[12], real32_T y[12])
|
||||
{
|
||||
int32_T k;
|
||||
for (k = 0; k < 12; k++) {
|
||||
y[k] = rt_powf_snf(a[k], 2.0F);
|
||||
}
|
||||
}
|
||||
|
||||
/* End of code generation (power.c) */
|
|
@ -1,34 +0,0 @@
|
|||
/*
|
||||
* power.h
|
||||
*
|
||||
* Code generation for function 'power'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __POWER_H__
|
||||
#define __POWER_H__
|
||||
/* Include files */
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "rt_defines.h"
|
||||
#include "rt_nonfinite.h"
|
||||
|
||||
#include "rtwtypes.h"
|
||||
#include "attitudeKalmanfilter_types.h"
|
||||
|
||||
/* Type Definitions */
|
||||
|
||||
/* Named Constants */
|
||||
|
||||
/* Variable Declarations */
|
||||
|
||||
/* Variable Definitions */
|
||||
|
||||
/* Function Declarations */
|
||||
extern void power(const real32_T a[12], real32_T y[12]);
|
||||
#endif
|
||||
/* End of code generation (power.h) */
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'rdivide'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'rdivide'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Code generation for function 'attitudeKalmanfilter'
|
||||
*
|
||||
* C source code generated on: Tue Oct 16 15:27:58 2012
|
||||
* C source code generated on: Sat Jan 19 15:25:29 2013
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
|||
* Number of bits: char: 8 short: 16 int: 32
|
||||
* long: 32 native word size: 32
|
||||
* Byte ordering: LittleEndian
|
||||
* Signed integer division rounds to: Undefined
|
||||
* Shift right on a signed integer as arithmetic shift: off
|
||||
* Signed integer division rounds to: Zero
|
||||
* Shift right on a signed integer as arithmetic shift: on
|
||||
*=======================================================================*/
|
||||
|
||||
/*=======================================================================*
|
||||
|
|
|
@ -290,7 +290,6 @@ void KalmanNav::updatePublications()
|
|||
|
||||
_att.R_valid = true;
|
||||
_att.q_valid = true;
|
||||
_att.counter = _navFrames;
|
||||
|
||||
// selectively update publications,
|
||||
// do NOT call superblock do-all method
|
||||
|
|
|
@ -511,7 +511,6 @@ handle_message(mavlink_message_t *msg)
|
|||
hil_attitude.yawspeed = hil_state.yawspeed;
|
||||
|
||||
/* set timestamp and notify processes (broadcast) */
|
||||
hil_attitude.counter++;
|
||||
hil_attitude.timestamp = hrt_absolute_time();
|
||||
orb_publish(ORB_ID(vehicle_attitude), pub_hil_attitude, &hil_attitude);
|
||||
}
|
||||
|
|
|
@ -57,29 +57,26 @@
|
|||
*/
|
||||
struct vehicle_attitude_s {
|
||||
|
||||
/*
|
||||
* Actual data, this is specific to the type of data which is stored in this struct
|
||||
* A line containing L0GME will be added by the Python logging code generator to the
|
||||
* logged dataset.
|
||||
*/
|
||||
uint64_t timestamp; /**< in microseconds since system start */
|
||||
uint64_t timestamp; /**< in microseconds since system start */
|
||||
|
||||
/* This is similar to the mavlink message ATTITUDE, but for onboard use */
|
||||
|
||||
/* @warning Roll, pitch and yaw have always to be valid, the rotation matrix and quaternion are optional */
|
||||
/** @warning roll, pitch and yaw have always to be valid, the rotation matrix and quaternion are optional */
|
||||
|
||||
float roll; /**< Roll angle (rad, Tait-Bryan, NED) LOGME */
|
||||
float pitch; /**< Pitch angle (rad, Tait-Bryan, NED) LOGME */
|
||||
float yaw; /**< Yaw angle (rad, Tait-Bryan, NED) LOGME */
|
||||
float rollspeed; /**< Roll angular speed (rad/s, Tait-Bryan, NED) LOGME */
|
||||
float pitchspeed; /**< Pitch angular speed (rad/s, Tait-Bryan, NED) LOGME */
|
||||
float yawspeed; /**< Yaw angular speed (rad/s, Tait-Bryan, NED) LOGME */
|
||||
float rate_offsets[3];/**< Offsets of the body angular rates from zero */
|
||||
float R[3][3]; /**< Rotation matrix body to world, (Tait-Bryan, NED) */
|
||||
float q[4]; /**< Quaternion (NED) */
|
||||
bool R_valid; /**< Rotation matrix valid */
|
||||
bool q_valid; /**< Quaternion valid */
|
||||
uint16_t counter; /**< Counter of all attitude messages (wraps) */
|
||||
float roll; /**< Roll angle (rad, Tait-Bryan, NED) */
|
||||
float pitch; /**< Pitch angle (rad, Tait-Bryan, NED) */
|
||||
float yaw; /**< Yaw angle (rad, Tait-Bryan, NED) */
|
||||
float rollspeed; /**< Roll angular speed (rad/s, Tait-Bryan, NED) */
|
||||
float pitchspeed; /**< Pitch angular speed (rad/s, Tait-Bryan, NED) */
|
||||
float yawspeed; /**< Yaw angular speed (rad/s, Tait-Bryan, NED) */
|
||||
float rollacc; /**< Roll angular accelration (rad/s, Tait-Bryan, NED) */
|
||||
float pitchacc; /**< Pitch angular acceleration (rad/s, Tait-Bryan, NED) */
|
||||
float yawacc; /**< Yaw angular acceleration (rad/s, Tait-Bryan, NED) */
|
||||
float rate_offsets[3]; /**< Offsets of the body angular rates from zero */
|
||||
float R[3][3]; /**< Rotation matrix body to world, (Tait-Bryan, NED) */
|
||||
float q[4]; /**< Quaternion (NED) */
|
||||
bool R_valid; /**< Rotation matrix valid */
|
||||
bool q_valid; /**< Quaternion valid */
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue