New messages added to sdlog2

This commit is contained in:
Anton Babushkin
2013-05-28 19:02:16 +04:00
parent 8dbda51289
commit 7e95edbbe8
3 changed files with 172 additions and 96 deletions
+64 -13
View File
@@ -47,13 +47,13 @@
/* define message formats */
/* === 1: TS - TIME STAMP === */
#define LOG_TS_MSG 1
struct log_TS_s {
/* --- TIME - TIME STAMP --- */
#define LOG_TIME_MSG 1
struct log_TIME_s {
uint64_t t;
};
/* === 2: ATT - ATTITUDE === */
/* --- ATT - ATTITUDE --- */
#define LOG_ATT_MSG 2
struct log_ATT_s {
float roll;
@@ -61,20 +61,71 @@ struct log_ATT_s {
float yaw;
};
/* === 3: RAW - SENSORS === */
#define LOG_RAW_MSG 3
struct log_RAW_s {
float accX;
float accY;
float accZ;
/* --- ATSP - ATTITUDE SET POINT --- */
#define LOG_ATSP_MSG 3
struct log_ATSP_s {
float roll_sp;
float pitch_sp;
float yaw_sp;
};
/* --- IMU - IMU SENSORS --- */
#define LOG_IMU_MSG 4
struct log_IMU_s {
float acc_x;
float acc_y;
float acc_z;
float gyro_x;
float gyro_y;
float gyro_z;
float mag_x;
float mag_y;
float mag_z;
};
/* --- SENS - OTHER SENSORS --- */
#define LOG_SENS_MSG 5
struct log_SENS_s {
float baro_pres;
float baro_alt;
float baro_temp;
float diff_pres;
};
/* --- LPOS - LOCAL POSITION --- */
#define LOG_LPOS_MSG 6
struct log_LPOS_s {
float x;
float y;
float z;
float vx;
float vy;
float vz;
float hdg;
int32_t home_lat;
int32_t home_lon;
float home_alt;
};
/* --- LPOS - LOCAL POSITION SETPOINT --- */
#define LOG_LPSP_MSG 7
struct log_LPSP_s {
float x;
float y;
float z;
float yaw;
};
/* construct list of all message formats */
static const struct log_format_s log_formats[] = {
LOG_FORMAT(TS, "Q", "t"),
LOG_FORMAT(ATT, "fff", "roll,pitch,yaw"),
LOG_FORMAT(RAW, "fff", "accX,accY,accZ"),
LOG_FORMAT(TIME, "Q", "t"),
LOG_FORMAT(ATT, "fff", "Roll,Pitch,Yaw"),
LOG_FORMAT(ATSP, "fff", "RollSP,PitchSP,YawSP"),
LOG_FORMAT(IMU, "fffffffff", "AccX,AccY,AccZ,GyroX,GyroY,GyroZ,MagX,MagY,MagZ"),
LOG_FORMAT(SENS, "ffff", "BaroPres,BaroAlt,BaroTemp,DiffPres"),
LOG_FORMAT(LPOS, "fffffffLLf", "X,Y,Z,VX,VY,VZ,Heading,HomeLat,HomeLon,HomeAlt"),
LOG_FORMAT(LPSP, "ffff", "X,Y,Z,Yaw"),
};
static const int log_formats_num = sizeof(log_formats) / sizeof(struct log_format_s);