diff --git a/sw/airborne/modules/ins/ahrs_chimu_spi.c b/sw/airborne/modules/ins/ahrs_chimu_spi.c index 18ed9222d2..f2d53fa8ca 100644 --- a/sw/airborne/modules/ins/ahrs_chimu_spi.c +++ b/sw/airborne/modules/ins/ahrs_chimu_spi.c @@ -40,6 +40,13 @@ struct AhrsChimu ahrs_chimu; void ahrs_chimu_update_gps(uint8_t gps_fix, uint16_t gps_speed_3d); #include "subsystems/abi.h" +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef AHRS_CHIMU_GPS_ID +#define AHRS_CHIMU_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(AHRS_CHIMU_GPS_ID) static abi_event gps_ev; static void gps_cb(uint8_t sender_id __attribute__((unused)), uint32_t stamp __attribute__((unused)), @@ -58,7 +65,7 @@ void ahrs_chimu_register(void) { ahrs_chimu_init(); ahrs_register_impl(ahrs_chimu_enable_output); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(AHRS_CHIMU_GPS_ID, &gps_ev, gps_cb); } void ahrs_chimu_init(void) diff --git a/sw/airborne/modules/ins/ins_xsens.c b/sw/airborne/modules/ins/ins_xsens.c index 5c3d3bc9d3..38b0df830a 100644 --- a/sw/airborne/modules/ins/ins_xsens.c +++ b/sw/airborne/modules/ins/ins_xsens.c @@ -259,6 +259,13 @@ void ins_xsens_init(void) } #include "subsystems/abi.h" +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef INS_XSENS_GPS_ID +#define INS_XSENS_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(INS_XSENS_GPS_ID) static abi_event gps_ev; static void gps_cb(uint8_t sender_id __attribute__((unused)), uint32_t stamp __attribute__((unused)), @@ -270,7 +277,7 @@ static void gps_cb(uint8_t sender_id __attribute__((unused)), void ins_xsens_register(void) { ins_register_impl(ins_xsens_init); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(INS_XSENS_GPS_ID, &gps_ev, gps_cb); } void ins_xsens_update_gps(struct GpsState *gps_s) diff --git a/sw/airborne/modules/ins/ins_xsens700.c b/sw/airborne/modules/ins/ins_xsens700.c index 44f10dd576..44a5b398db 100644 --- a/sw/airborne/modules/ins/ins_xsens700.c +++ b/sw/airborne/modules/ins/ins_xsens700.c @@ -190,6 +190,13 @@ void ins_xsens_init(void) } #include "subsystems/abi.h" +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef INS_XSENS700_GPS_ID +#define INS_XSENS700_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(INS_XSENS700_GPS_ID) static abi_event gps_ev; static void gps_cb(uint8_t sender_id __attribute__((unused)), uint32_t stamp __attribute__((unused)), @@ -201,7 +208,7 @@ static void gps_cb(uint8_t sender_id __attribute__((unused)), void ins_xsens_register(void) { ins_register_impl(ins_xsens_init); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(INS_XSENS700_GPS_ID, &gps_ev, gps_cb); } void ins_xsens_update_gps(struct GpsState *gps_s) diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_wrapper.c b/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_wrapper.c index ea202ae141..b7948284ef 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_wrapper.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_cmpl_wrapper.c @@ -120,6 +120,13 @@ PRINT_CONFIG_VAR(AHRS_FC_IMU_ID) #define AHRS_FC_MAG_ID AHRS_FC_IMU_ID #endif PRINT_CONFIG_VAR(AHRS_FC_MAG_ID) +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef AHRS_FC_GPS_ID +#define AHRS_FC_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(AHRS_FC_GPS_ID) static abi_event gyro_ev; static abi_event accel_ev; static abi_event mag_ev; @@ -288,7 +295,7 @@ void ahrs_fc_register(void) AbiBindMsgIMU_LOWPASSED(ABI_BROADCAST, &aligner_ev, aligner_cb); AbiBindMsgBODY_TO_IMU_QUAT(ABI_BROADCAST, &body_to_imu_ev, body_to_imu_cb); AbiBindMsgGEO_MAG(ABI_BROADCAST, &geo_mag_ev, geo_mag_cb); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(AHRS_FC_GPS_ID, &gps_ev, gps_cb); #if PERIODIC_TELEMETRY register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_AHRS_EULER, send_euler); diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_dcm_wrapper.c b/sw/airborne/subsystems/ahrs/ahrs_float_dcm_wrapper.c index 31b1042d96..5772438bb4 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_dcm_wrapper.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_dcm_wrapper.c @@ -71,6 +71,13 @@ PRINT_CONFIG_VAR(AHRS_DCM_IMU_ID) #define AHRS_DCM_MAG_ID AHRS_DCM_IMU_ID #endif PRINT_CONFIG_VAR(AHRS_DCM_MAG_ID) +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef AHRS_DCM_GPS_ID +#define AHRS_DCM_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(AHRS_DCM_GPS_ID) static abi_event gyro_ev; static abi_event accel_ev; static abi_event mag_ev; @@ -202,7 +209,7 @@ void ahrs_dcm_register(void) AbiBindMsgIMU_MAG_INT32(AHRS_DCM_MAG_ID, &mag_ev, mag_cb); AbiBindMsgIMU_LOWPASSED(ABI_BROADCAST, &aligner_ev, aligner_cb); AbiBindMsgBODY_TO_IMU_QUAT(ABI_BROADCAST, &body_to_imu_ev, body_to_imu_cb); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(AHRS_DCM_GPS_ID, &gps_ev, gps_cb); #if PERIODIC_TELEMETRY register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_STATE_FILTER_STATUS, send_filter_status); diff --git a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_quat_wrapper.c b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_quat_wrapper.c index e3730539db..28f3b0b4dd 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_quat_wrapper.c +++ b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_quat_wrapper.c @@ -121,6 +121,13 @@ PRINT_CONFIG_VAR(AHRS_ICQ_IMU_ID) #define AHRS_ICQ_MAG_ID AHRS_ICQ_IMU_ID #endif PRINT_CONFIG_VAR(AHRS_ICQ_MAG_ID) +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef AHRS_ICQ_GPS_ID +#define AHRS_ICQ_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(AHRS_ICQ_GPS_ID) static abi_event gyro_ev; static abi_event accel_ev; static abi_event mag_ev; @@ -276,7 +283,7 @@ void ahrs_icq_register(void) AbiBindMsgIMU_LOWPASSED(ABI_BROADCAST, &aligner_ev, aligner_cb); AbiBindMsgBODY_TO_IMU_QUAT(ABI_BROADCAST, &body_to_imu_ev, body_to_imu_cb); AbiBindMsgGEO_MAG(ABI_BROADCAST, &geo_mag_ev, geo_mag_cb); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(AHRS_ICQ_GPS_ID, &gps_ev, gps_cb); #if PERIODIC_TELEMETRY register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_AHRS_QUAT_INT, send_quat); diff --git a/sw/airborne/subsystems/ins/ins_alt_float.c b/sw/airborne/subsystems/ins/ins_alt_float.c index 77143cd4ea..3fe2d8f055 100644 --- a/sw/airborne/subsystems/ins/ins_alt_float.c +++ b/sw/airborne/subsystems/ins/ins_alt_float.c @@ -71,10 +71,18 @@ PRINT_CONFIG_MSG("USE_BAROMETER is TRUE: Using baro for altitude estimation.") #endif #endif PRINT_CONFIG_VAR(INS_BARO_ID) + abi_event baro_ev; static void baro_cb(uint8_t sender_id, float pressure); #endif /* USE_BAROMETER */ +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef INS_ALT_GPS_ID +#define INS_ALT_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(INS_ALT_GPS_ID) static abi_event gps_ev; static abi_event accel_ev; static abi_event body_to_imu_ev; @@ -383,7 +391,7 @@ void ins_altf_register(void) // Bind to BARO_ABS message AbiBindMsgBARO_ABS(INS_BARO_ID, &baro_ev, baro_cb); #endif - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(INS_ALT_GPS_ID, &gps_ev, gps_cb); AbiBindMsgIMU_ACCEL_INT32(INS_ALT_IMU_ID, &accel_ev, accel_cb); AbiBindMsgBODY_TO_IMU_QUAT(INS_ALT_IMU_ID, &body_to_imu_ev, body_to_imu_cb); } diff --git a/sw/airborne/subsystems/ins/ins_float_invariant_wrapper.c b/sw/airborne/subsystems/ins/ins_float_invariant_wrapper.c index 4c83c57b1c..6b7caf62d0 100644 --- a/sw/airborne/subsystems/ins/ins_float_invariant_wrapper.c +++ b/sw/airborne/subsystems/ins/ins_float_invariant_wrapper.c @@ -94,6 +94,14 @@ PRINT_CONFIG_VAR(INS_FINV_IMU_ID) #endif PRINT_CONFIG_VAR(INS_FINV_MAG_ID) +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef INS_FINV_GPS_ID +#define INS_FINV_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(INS_FINV_GPS_ID) + static abi_event baro_ev; static abi_event mag_ev; static abi_event gyro_ev; @@ -205,7 +213,7 @@ void ins_float_invariant_register(void) AbiBindMsgIMU_LOWPASSED(INS_FINV_IMU_ID, &aligner_ev, aligner_cb); AbiBindMsgBODY_TO_IMU_QUAT(INS_FINV_IMU_ID, &body_to_imu_ev, body_to_imu_cb); AbiBindMsgGEO_MAG(ABI_BROADCAST, &geo_mag_ev, geo_mag_cb); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(INS_FINV_GPS_ID, &gps_ev, gps_cb); #if PERIODIC_TELEMETRY && !INS_FINV_USE_UTM register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_INS_REF, send_ins_ref); diff --git a/sw/airborne/subsystems/ins/ins_gps_passthrough.c b/sw/airborne/subsystems/ins/ins_gps_passthrough.c index fd79437b62..8863de4d4c 100644 --- a/sw/airborne/subsystems/ins/ins_gps_passthrough.c +++ b/sw/airborne/subsystems/ins/ins_gps_passthrough.c @@ -144,6 +144,13 @@ void ins_reset_altitude_ref(void) #include "subsystems/abi.h" +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef INS_PT_GPS_ID +#define INS_PT_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(INS_PT_GPS_ID) static abi_event gps_ev; static void gps_cb(uint8_t sender_id __attribute__((unused)), uint32_t stamp __attribute__((unused)), @@ -173,5 +180,5 @@ static void gps_cb(uint8_t sender_id __attribute__((unused)), void ins_gps_passthrough_register(void) { ins_register_impl(ins_gps_passthrough_init); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(INS_PT_GPS_ID, &gps_ev, gps_cb); } diff --git a/sw/airborne/subsystems/ins/ins_gps_passthrough_utm.c b/sw/airborne/subsystems/ins/ins_gps_passthrough_utm.c index 6aa8127229..b068075d77 100644 --- a/sw/airborne/subsystems/ins/ins_gps_passthrough_utm.c +++ b/sw/airborne/subsystems/ins/ins_gps_passthrough_utm.c @@ -63,6 +63,13 @@ void ins_reset_altitude_ref(void) #include "subsystems/abi.h" +/** ABI binding for gps data. + * Used for GPS ABI messages. + */ +#ifndef INS_PTU_GPS_ID +#define INS_PTU_GPS_ID ABI_BROADCAST +#endif +PRINT_CONFIG_VAR(INS_PTU_GPS_ID) static abi_event gps_ev; static void gps_cb(uint8_t sender_id __attribute__((unused)), @@ -87,5 +94,5 @@ static void gps_cb(uint8_t sender_id __attribute__((unused)), void ins_gps_utm_register(void) { ins_register_impl(ins_gps_utm_init); - AbiBindMsgGPS(ABI_BROADCAST, &gps_ev, gps_cb); + AbiBindMsgGPS(INS_PTU_GPS_ID, &gps_ev, gps_cb); }