mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 19:29:06 +08:00
sdlog2: Log actuator output group 1 as well
This commit is contained in:
parent
f52ce2001d
commit
c2aaeefa6c
@ -1118,7 +1118,7 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||
struct log_STAT_s log_STAT;
|
||||
struct log_VTOL_s log_VTOL;
|
||||
struct log_RC_s log_RC;
|
||||
struct log_OUT0_s log_OUT0;
|
||||
struct log_OUT_s log_OUT;
|
||||
struct log_AIRS_s log_AIRS;
|
||||
struct log_ARSP_s log_ARSP;
|
||||
struct log_FLOW_s log_FLOW;
|
||||
@ -1164,6 +1164,7 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||
int att_sp_sub;
|
||||
int rates_sp_sub;
|
||||
int act_outputs_sub;
|
||||
int act_outputs_1_sub;
|
||||
int act_controls_sub;
|
||||
int act_controls_1_sub;
|
||||
int local_pos_sub;
|
||||
@ -1203,6 +1204,7 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||
subs.att_sp_sub = -1;
|
||||
subs.rates_sp_sub = -1;
|
||||
subs.act_outputs_sub = -1;
|
||||
subs.act_outputs_1_sub = -1;
|
||||
subs.act_controls_sub = -1;
|
||||
subs.act_controls_1_sub = -1;
|
||||
subs.local_pos_sub = -1;
|
||||
@ -1532,8 +1534,14 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||
/* --- ACTUATOR OUTPUTS --- */
|
||||
if (copy_if_updated(ORB_ID(actuator_outputs), &subs.act_outputs_sub, &buf.act_outputs)) {
|
||||
log_msg.msg_type = LOG_OUT0_MSG;
|
||||
memcpy(log_msg.body.log_OUT0.output, buf.act_outputs.output, sizeof(log_msg.body.log_OUT0.output));
|
||||
LOGBUFFER_WRITE_AND_COUNT(OUT0);
|
||||
memcpy(log_msg.body.log_OUT.output, buf.act_outputs.output, sizeof(log_msg.body.log_OUT.output));
|
||||
LOGBUFFER_WRITE_AND_COUNT(OUT);
|
||||
}
|
||||
|
||||
if (copy_if_updated(ORB_ID(actuator_outputs), &subs.act_outputs_1_sub, &buf.act_outputs)) {
|
||||
log_msg.msg_type = LOG_OUT1_MSG;
|
||||
memcpy(log_msg.body.log_OUT.output, buf.act_outputs.output, sizeof(log_msg.body.log_OUT.output));
|
||||
LOGBUFFER_WRITE_AND_COUNT(OUT);
|
||||
}
|
||||
|
||||
/* --- ACTUATOR CONTROL --- */
|
||||
|
||||
@ -195,9 +195,9 @@ struct log_RC_s {
|
||||
uint32_t frame_drop;
|
||||
};
|
||||
|
||||
/* --- OUT0 - ACTUATOR_0 OUTPUT --- */
|
||||
/* --- OUT - ACTUATOR OUTPUT --- */
|
||||
#define LOG_OUT0_MSG 12
|
||||
struct log_OUT0_s {
|
||||
struct log_OUT_s {
|
||||
float output[8];
|
||||
};
|
||||
|
||||
@ -491,6 +491,8 @@ struct log_MACS_s {
|
||||
float yaw_rate_integ;
|
||||
};
|
||||
|
||||
/* WARNING: ID 46 is already in use for ATTC1 */
|
||||
|
||||
/* --- CONTROL STATE --- */
|
||||
#define LOG_CTS_MSG 47
|
||||
struct log_CTS_s {
|
||||
@ -503,7 +505,7 @@ struct log_CTS_s {
|
||||
float yaw_rate;
|
||||
};
|
||||
|
||||
/* WARNING: ID 46 is already in use for ATTC1 */
|
||||
#define LOG_OUT1_MSG 50
|
||||
|
||||
/********** SYSTEM MESSAGES, ID > 0x80 **********/
|
||||
|
||||
@ -547,7 +549,8 @@ static const struct log_format_s log_formats[] = {
|
||||
LOG_FORMAT(VTOL, "f", "Arsp"),
|
||||
LOG_FORMAT(CTS, "fffffff", "Vx_b,Vy_b,Vz_b,Vinf,P,Q,R"),
|
||||
LOG_FORMAT(RC, "ffffffffffffBBBL", "C0,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,RSSI,CNT,Lost,Drop"),
|
||||
LOG_FORMAT(OUT0, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
|
||||
LOG_FORMAT_S(OUT0, OUT, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
|
||||
LOG_FORMAT_S(OUT1, OUT, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
|
||||
LOG_FORMAT(AIRS, "fff", "IndSpeed,TrueSpeed,AirTemp"),
|
||||
LOG_FORMAT(ARSP, "fff", "RollRateSP,PitchRateSP,YawRateSP"),
|
||||
LOG_FORMAT(FLOW, "BffffffLLHhB", "ID,RawX,RawY,RX,RY,RZ,Dist,TSpan,DtSonar,FrmCnt,GT,Qlty"),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user