[ahrs] convert float_cmpl

This commit is contained in:
Felix Ruess
2014-10-13 19:06:12 +02:00
parent 70c9997af1
commit 0df0aefe48
3 changed files with 168 additions and 145 deletions
+5 -5
View File
@@ -4,11 +4,11 @@
<dl_settings>
<dl_settings NAME="AHRS">
<dl_setting var="ahrs_impl.gravity_heuristic_factor" min="0" step="1" max="50" module="subsystems/ahrs/ahrs_float_cmpl" shortname="g_heuristic" param="AHRS_GRAVITY_HEURISTIC_FACTOR"/>
<dl_setting var="ahrs_impl.accel_omega" min="0.02" step="0.02" max="0.2" module="subsystems/ahrs/ahrs_float_cmpl" shortname="acc_omega" param="AHRS_ACCEL_OMEGA" unit="rad/s"/>
<dl_setting var="ahrs_impl.accel_zeta" min="0.7" step="0.05" max="1.5" module="subsystems/ahrs/ahrs_float_cmpl" shortname="acc_zeta" param="AHRS_ACCEL_ZETA"/>
<dl_setting var="ahrs_impl.mag_omega" min="0.02" step="0.01" max="0.1" module="subsystems/ahrs/ahrs_float_cmpl" shortname="mag_omega" param="AHRS_MAG_OMEGA" unit="rad/s"/>
<dl_setting var="ahrs_impl.mag_zeta" min="0.7" step="0.05" max="1.5" module="subsystems/ahrs/ahrs_float_cmpl" shortname="mag_zeta" param="AHRS_MAG_ZETA"/>
<dl_setting var="ahrs_fc.gravity_heuristic_factor" min="0" step="1" max="50" module="subsystems/ahrs/ahrs_float_cmpl" shortname="g_heuristic" param="AHRS_GRAVITY_HEURISTIC_FACTOR"/>
<dl_setting var="ahrs_fc.accel_omega" min="0.02" step="0.02" max="0.2" module="subsystems/ahrs/ahrs_float_cmpl" shortname="acc_omega" param="AHRS_ACCEL_OMEGA" unit="rad/s"/>
<dl_setting var="ahrs_fc.accel_zeta" min="0.7" step="0.05" max="1.5" module="subsystems/ahrs/ahrs_float_cmpl" shortname="acc_zeta" param="AHRS_ACCEL_ZETA"/>
<dl_setting var="ahrs_fc.mag_omega" min="0.02" step="0.01" max="0.1" module="subsystems/ahrs/ahrs_float_cmpl" shortname="mag_omega" param="AHRS_MAG_OMEGA" unit="rad/s"/>
<dl_setting var="ahrs_fc.mag_zeta" min="0.7" step="0.05" max="1.5" module="subsystems/ahrs/ahrs_float_cmpl" shortname="mag_zeta" param="AHRS_MAG_ZETA"/>
</dl_settings>
</dl_settings>
File diff suppressed because it is too large Load Diff
+16 -4
View File
@@ -60,23 +60,35 @@ struct AhrsFloatCmpl {
/* internal counters for the gains */
uint16_t accel_cnt; ///< number of propagations since last accel update
uint16_t mag_cnt; ///< number of propagations since last mag update
struct OrientationReps* body_to_imu;
};
extern struct AhrsFloatCmpl ahrs_impl;
extern struct AhrsFloatCmpl ahrs_fc;
#define DefaultAhrsImpl ahrs_fc
extern void ahrs_fc_register(void);
extern void ahrs_fc_init(struct OrientationReps* body_to_imu);
extern bool_t ahrs_fc_align(struct Int32Rates* lp_gyro, struct Int32Vect3* lp_accel,
struct Int32Vect3* lp_mag);
extern void ahrs_fc_propagate(struct Int32Rates* gyro, float dt);
extern void ahrs_fc_update_accel(struct Int32Vect3* accel, float dt);
extern void ahrs_fc_update_mag(struct Int32Vect3* mag, float dt);
extern void ahrs_fc_update_gps(void);
/** Update yaw based on a heading measurement.
* e.g. from GPS course
* @param heading Heading in body frame, radians (CW/north)
*/
void ahrs_update_heading(float heading);
void ahrs_fc_update_heading(float heading);
/** Hard reset yaw to a heading.
* Doesn't affect the bias.
* Sets ahrs_impl.heading_aligned to TRUE.
* Sets ahrs_fc.heading_aligned to TRUE.
* @param heading Heading in body frame, radians (CW/north)
*/
void ahrs_realign_heading(float heading);
void ahrs_fc_realign_heading(float heading);
#endif /* AHRS_FLOAT_CMPL_RMAT */