forked from Archive/PX4-Autopilot
sdlog2: ATTC - vehicle attitude control logging added
This commit is contained in:
parent
aedacc7bc8
commit
4052652a28
|
@ -652,6 +652,7 @@ int sdlog2_thread_main(int argc, char *argv[])
|
|||
struct log_LPOS_s log_LPOS;
|
||||
struct log_LPSP_s log_LPSP;
|
||||
struct log_GPS_s log_GPS;
|
||||
struct log_ATTC_s log_ATTC;
|
||||
} body;
|
||||
} log_msg = {
|
||||
LOG_PACKET_HEADER_INIT(0)
|
||||
|
@ -930,7 +931,12 @@ int sdlog2_thread_main(int argc, char *argv[])
|
|||
/* --- ACTUATOR CONTROL --- */
|
||||
if (fds[ifds++].revents & POLLIN) {
|
||||
orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs.act_controls_sub, &buf.act_controls);
|
||||
// TODO not implemented yet
|
||||
log_msg.msg_type = LOG_ATTC_MSG;
|
||||
log_msg.body.log_ATTC.roll = buf.act_controls.control[0];
|
||||
log_msg.body.log_ATTC.pitch = buf.act_controls.control[1];
|
||||
log_msg.body.log_ATTC.yaw = buf.act_controls.control[2];
|
||||
log_msg.body.log_ATTC.thrust = buf.act_controls.control[3];
|
||||
LOGBUFFER_WRITE_AND_COUNT(ATTC);
|
||||
}
|
||||
|
||||
/* --- ACTUATOR CONTROL EFFECTIVE --- */
|
||||
|
|
|
@ -132,6 +132,15 @@ struct log_GPS_s {
|
|||
float vel_d;
|
||||
float cog;
|
||||
};
|
||||
|
||||
/* --- ATTC - ATTITUDE CONTROLS --- */
|
||||
#define LOG_ATTC_MSG 9
|
||||
struct log_ATTC_s {
|
||||
float roll;
|
||||
float pitch;
|
||||
float yaw;
|
||||
float thrust;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
/* construct list of all message formats */
|
||||
|
@ -145,6 +154,7 @@ static const struct log_format_s log_formats[] = {
|
|||
LOG_FORMAT(LPOS, "fffffffLLf", "X,Y,Z,VX,VY,VZ,Heading,HomeLat,HomeLon,HomeAlt"),
|
||||
LOG_FORMAT(LPSP, "ffff", "X,Y,Z,Yaw"),
|
||||
LOG_FORMAT(GPS, "QBffLLfffff", "GPSTime,FixType,EPH,EPV,Lat,Lon,Alt,VelN,VelE,VelD,Cog"),
|
||||
LOG_FORMAT(ATTC, "ffff", "Roll,Pitch,Yaw,Thrust"),
|
||||
};
|
||||
|
||||
static const int log_formats_num = sizeof(log_formats) / sizeof(struct log_format_s);
|
||||
|
|
Loading…
Reference in New Issue