mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
[ahrs] use weak functions for things that don't need to be implemented by each algorithm
This commit is contained in:
@@ -29,3 +29,13 @@
|
||||
|
||||
struct Ahrs ahrs;
|
||||
|
||||
#define WEAK __attribute__((weak))
|
||||
// weak functions, used if not explicitly provided by implementation
|
||||
|
||||
void WEAK ahrs_propagate(void) {}
|
||||
|
||||
void WEAK ahrs_update_accel(void) {}
|
||||
|
||||
void WEAK ahrs_update_mag(void) {}
|
||||
|
||||
void WEAK ahrs_update_gps(void) {}
|
||||
|
||||
@@ -61,25 +61,25 @@ extern void ahrs_align(void);
|
||||
|
||||
/** Propagation. Usually integrates the gyro rates to angles.
|
||||
* Reads the global #imu data struct.
|
||||
* Needs to be implemented by each AHRS algorithm.
|
||||
* Does nothing if not implemented by specific AHRS algorithm.
|
||||
*/
|
||||
extern void ahrs_propagate(void);
|
||||
|
||||
/** Update AHRS state with accerleration measurements.
|
||||
* Reads the global #imu data struct.
|
||||
* Needs to be implemented by each AHRS algorithm.
|
||||
* Does nothing if not implemented by specific AHRS algorithm.
|
||||
*/
|
||||
extern void ahrs_update_accel(void);
|
||||
|
||||
/** Update AHRS state with magnetometer measurements.
|
||||
* Reads the global #imu data struct.
|
||||
* Needs to be implemented by each AHRS algorithm.
|
||||
* Does nothing if not implemented by specific AHRS algorithm.
|
||||
*/
|
||||
extern void ahrs_update_mag(void);
|
||||
|
||||
/** Update AHRS state with GPS measurements.
|
||||
* Reads the global #gps data struct.
|
||||
* Needs to be implemented by each AHRS algorithm.
|
||||
* Does nothing if not implemented by specific AHRS algorithm.
|
||||
*/
|
||||
extern void ahrs_update_gps(void);
|
||||
|
||||
|
||||
@@ -195,22 +195,8 @@ void ahrs_propagate(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void ahrs_update_accel(void) {
|
||||
|
||||
}
|
||||
|
||||
void ahrs_update_mag(void) {
|
||||
|
||||
}
|
||||
|
||||
void ahrs_update_gps(void) {
|
||||
|
||||
}
|
||||
|
||||
void ahrs_aligner_init(void) {
|
||||
|
||||
}
|
||||
|
||||
void ahrs_aligner_run(void) {
|
||||
|
||||
}
|
||||
|
||||
@@ -125,9 +125,6 @@ void ahrs_propagate(void) {
|
||||
set_body_state_from_quat();
|
||||
}
|
||||
|
||||
void ahrs_update_gps(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_accel(void) {
|
||||
struct FloatVect3 imu_g;
|
||||
ACCELS_FLOAT_OF_BFP(imu_g, imu.accel);
|
||||
|
||||
@@ -347,14 +347,3 @@ void ahrs_aligner_run(void) {
|
||||
void ahrs_aligner_init(void) {
|
||||
}
|
||||
|
||||
void ahrs_propagate(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_accel(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_mag(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_gps(void) {
|
||||
}
|
||||
|
||||
@@ -87,11 +87,6 @@ void ahrs_propagate(void) {
|
||||
stateSetBodyRates_f(&body_rate);
|
||||
}
|
||||
|
||||
void ahrs_update_accel(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_mag(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_gps(void) {
|
||||
|
||||
|
||||
@@ -278,10 +278,6 @@ void ahrs_update_mag(void) {
|
||||
|
||||
}
|
||||
|
||||
void ahrs_update_gps(void) {
|
||||
|
||||
}
|
||||
|
||||
/* measures phi and theta assuming no dynamic acceleration ?!! */
|
||||
__attribute__ ((always_inline)) static inline void get_phi_theta_measurement_fom_accel(int32_t* phi_meas, int32_t* theta_meas, struct Int32Vect3 accel) {
|
||||
|
||||
|
||||
@@ -94,13 +94,3 @@ void ahrs_propagate(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void ahrs_update_accel(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_mag(void) {
|
||||
}
|
||||
|
||||
void ahrs_update_gps(void) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user