mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 20:38:27 +08:00
[imu] remove ImuFloat
not really used anywhere anymore and we want to get rid of the global imu struct anyway...
This commit is contained in:
@@ -43,22 +43,6 @@
|
|||||||
#if PERIODIC_TELEMETRY
|
#if PERIODIC_TELEMETRY
|
||||||
#include "subsystems/datalink/telemetry.h"
|
#include "subsystems/datalink/telemetry.h"
|
||||||
|
|
||||||
#if USE_IMU_FLOAT
|
|
||||||
|
|
||||||
static void send_accel(struct transport_tx *trans, struct link_device *dev)
|
|
||||||
{
|
|
||||||
pprz_msg_send_IMU_ACCEL(trans, dev, AC_ID,
|
|
||||||
&imuf.accel.x, &imuf.accel.y, &imuf.accel.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void send_gyro(struct transport_tx *trans, struct link_device *dev)
|
|
||||||
{
|
|
||||||
pprz_msg_send_IMU_GYRO(trans, dev, AC_ID,
|
|
||||||
&imuf.gyro.p, &imuf.gyro.q, &imuf.gyro.r);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // !USE_IMU_FLOAT
|
|
||||||
|
|
||||||
static void send_accel_raw(struct transport_tx *trans, struct link_device *dev)
|
static void send_accel_raw(struct transport_tx *trans, struct link_device *dev)
|
||||||
{
|
{
|
||||||
pprz_msg_send_IMU_ACCEL_RAW(trans, dev, AC_ID,
|
pprz_msg_send_IMU_ACCEL_RAW(trans, dev, AC_ID,
|
||||||
@@ -118,12 +102,10 @@ static void send_mag(struct transport_tx *trans, struct link_device *dev)
|
|||||||
pprz_msg_send_IMU_MAG(trans, dev, AC_ID,
|
pprz_msg_send_IMU_MAG(trans, dev, AC_ID,
|
||||||
&mag_float.x, &mag_float.y, &mag_float.z);
|
&mag_float.x, &mag_float.y, &mag_float.z);
|
||||||
}
|
}
|
||||||
#endif // !USE_IMU_FLOAT
|
|
||||||
|
|
||||||
#endif
|
#endif /* PERIODIC_TELEMETRY */
|
||||||
|
|
||||||
struct Imu imu;
|
struct Imu imu;
|
||||||
struct ImuFloat imuf;
|
|
||||||
|
|
||||||
void imu_init(void)
|
void imu_init(void)
|
||||||
{
|
{
|
||||||
@@ -154,7 +136,6 @@ void imu_init(void)
|
|||||||
#if PERIODIC_TELEMETRY
|
#if PERIODIC_TELEMETRY
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL", send_accel);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL", send_accel);
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_GYRO", send_gyro);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_GYRO", send_gyro);
|
||||||
#if !USE_IMU_FLOAT
|
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL_RAW", send_accel_raw);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL_RAW", send_accel_raw);
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL_SCALED", send_accel_scaled);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL_SCALED", send_accel_scaled);
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL", send_accel);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_ACCEL", send_accel);
|
||||||
@@ -164,7 +145,6 @@ void imu_init(void)
|
|||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_MAG_RAW", send_mag_raw);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_MAG_RAW", send_mag_raw);
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_MAG_SCALED", send_mag_scaled);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_MAG_SCALED", send_mag_scaled);
|
||||||
register_periodic_telemetry(DefaultPeriodic, "IMU_MAG", send_mag);
|
register_periodic_telemetry(DefaultPeriodic, "IMU_MAG", send_mag);
|
||||||
#endif // !USE_IMU_FLOAT
|
|
||||||
#endif // DOWNLINK
|
#endif // DOWNLINK
|
||||||
|
|
||||||
imu_impl_init();
|
imu_impl_init();
|
||||||
|
|||||||
@@ -58,20 +58,8 @@ struct Imu {
|
|||||||
bool_t b2i_set_current;
|
bool_t b2i_set_current;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** abstract IMU interface providing floating point interface */
|
|
||||||
struct ImuFloat {
|
|
||||||
struct FloatRates gyro;
|
|
||||||
struct FloatVect3 accel;
|
|
||||||
struct FloatVect3 mag;
|
|
||||||
struct FloatRates gyro_prev;
|
|
||||||
uint32_t sample_count;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** global IMU state */
|
/** global IMU state */
|
||||||
extern struct Imu imu;
|
extern struct Imu imu;
|
||||||
extern struct ImuFloat imuf;
|
|
||||||
|
|
||||||
/* underlying hardware */
|
/* underlying hardware */
|
||||||
#ifdef IMU_TYPE_H
|
#ifdef IMU_TYPE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user