[abi] configurable ID for GPS ABI message bindings

This commit is contained in:
Felix Ruess
2016-01-28 23:24:16 +01:00
committed by masierra
parent 6db2cc9f43
commit 4043fdb5fd
10 changed files with 82 additions and 10 deletions
+8 -1
View File
@@ -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)
+8 -1
View File
@@ -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)
+8 -1
View File
@@ -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)
@@ -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);
@@ -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);
@@ -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);
+9 -1
View File
@@ -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);
}
@@ -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);
@@ -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);
}
@@ -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);
}