Skip to content

Commit

Permalink
make AHRS_MAG_UPDATE_YAW_ONLY the default, to update all axes with ma…
Browse files Browse the repository at this point in the history
…g use AHRS_MAG_UPDATE_ALL_AXES
  • Loading branch information
flixr committed Jan 6, 2012
1 parent 2891a06 commit d84137e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 7 additions & 4 deletions sw/airborne/subsystems/ahrs/ahrs_float_cmpl_rmat.c
Expand Up @@ -39,6 +39,10 @@
#error "You have to define either AHRS_PROPAGATE_RMAT or AHRS_PROPAGATE_QUAT"
#endif

#ifdef AHRS_MAG_UPDATE_YAW_ONLY
#warning "AHRS_MAG_UPDATE_YAW_ONLY is deprecated, please remove it. This is the default behaviour. Define AHRS_MAG_UPDATE_ALL_AXES to use mag for all axes and not only yaw."
#endif

void ahrs_update_mag_full(void);
void ahrs_update_mag_2d(void);
void ahrs_update_mag_2d_dumb(void);
Expand Down Expand Up @@ -197,11 +201,10 @@ void ahrs_update_accel(void) {


void ahrs_update_mag(void) {
#ifdef AHRS_MAG_UPDATE_YAW_ONLY
ahrs_update_mag_2d();
// ahrs_update_mag_2d_dumb();
#else
#if AHRS_MAG_UPDATE_ALL_AXES
ahrs_update_mag_full();
#else
ahrs_update_mag_2d();
#endif
}

Expand Down
9 changes: 6 additions & 3 deletions sw/airborne/subsystems/ahrs/ahrs_int_cmpl.c
Expand Up @@ -44,6 +44,9 @@
static inline void ahrs_update_mag_full(void);
static inline void ahrs_update_mag_2d(void);

#ifdef AHRS_MAG_UPDATE_YAW_ONLY
#warning "AHRS_MAG_UPDATE_YAW_ONLY is deprecated, please remove it. This is the default behaviour. Define AHRS_MAG_UPDATE_ALL_AXES to use mag for all axes and not only yaw."
#endif

/* in place quaternion first order integration with constante rotational velocity */
/* */
Expand Down Expand Up @@ -230,10 +233,10 @@ void ahrs_update_accel(void) {
}

void ahrs_update_mag(void) {
#ifdef AHRS_MAG_UPDATE_YAW_ONLY
ahrs_update_mag_2d();
#else
#if AHRS_MAG_UPDATE_ALL_AXES
ahrs_update_mag_full();
#else
ahrs_update_mag_2d();
#endif
}

Expand Down

0 comments on commit d84137e

Please sign in to comment.