mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 13:13:33 +08:00
Merge branch 'pid_fixes' into new_state_machine
Conflicts: src/modules/multirotor_att_control/multirotor_rate_control.c src/modules/sdlog2/sdlog2.c src/modules/sdlog2/sdlog2_messages.h and some fixes, logging of control PID values now working
This commit is contained in:
@@ -91,7 +91,6 @@
|
||||
|
||||
#define LOGBUFFER_WRITE_AND_COUNT(_msg) if (logbuffer_write(&lb, &log_msg, LOG_PACKET_SIZE(_msg))) { \
|
||||
log_msgs_written++; \
|
||||
printf("size: %d\n", LOG_PACKET_SIZE(_msg)); \
|
||||
} else { \
|
||||
log_msgs_skipped++; \
|
||||
/*printf("skip\n");*/ \
|
||||
@@ -616,6 +615,7 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||
/* --- IMPORTANT: DEFINE NUMBER OF ORB STRUCTS TO WAIT FOR HERE --- */
|
||||
/* number of messages */
|
||||
const ssize_t fdsc = 17;
|
||||
|
||||
/* Sanity check variable and index */
|
||||
ssize_t fdsc_count = 0;
|
||||
/* file descriptors to wait for */
|
||||
@@ -1072,26 +1072,20 @@ int sdlog2_thread_main(int argc, char *argv[])
|
||||
/* --- CONTROL DEBUG --- */
|
||||
if (fds[ifds++].revents & POLLIN) {
|
||||
orb_copy(ORB_ID(vehicle_control_debug), subs.control_debug_sub, &buf.control_debug);
|
||||
printf("copied control debug\n");
|
||||
|
||||
// log_msg.body.log_CTRL.roll_p = buf.control_debug.roll_p;
|
||||
// log_msg.body.log_CTRL.roll_i = buf.control_debug.roll_i;
|
||||
// log_msg.body.log_CTRL.roll_d = buf.control_debug.roll_d;
|
||||
log_msg.msg_type = LOG_CTRL_MSG;
|
||||
log_msg.body.log_CTRL.roll_p = buf.control_debug.roll_p;
|
||||
log_msg.body.log_CTRL.roll_i = buf.control_debug.roll_i;
|
||||
log_msg.body.log_CTRL.roll_d = buf.control_debug.roll_d;
|
||||
log_msg.body.log_CTRL.roll_rate_p = buf.control_debug.roll_rate_p;
|
||||
log_msg.body.log_CTRL.roll_rate_i = buf.control_debug.roll_rate_i;
|
||||
log_msg.body.log_CTRL.roll_rate_d = buf.control_debug.roll_rate_d;
|
||||
// log_msg.body.log_CTRL.pitch_p = buf.control_debug.pitch_p;
|
||||
// log_msg.body.log_CTRL.pitch_i = buf.control_debug.pitch_i;
|
||||
// log_msg.body.log_CTRL.pitch_d = buf.control_debug.pitch_d;
|
||||
log_msg.body.log_CTRL.pitch_p = buf.control_debug.pitch_p;
|
||||
log_msg.body.log_CTRL.pitch_i = buf.control_debug.pitch_i;
|
||||
log_msg.body.log_CTRL.pitch_d = buf.control_debug.pitch_d;
|
||||
log_msg.body.log_CTRL.pitch_rate_p = buf.control_debug.pitch_rate_p;
|
||||
log_msg.body.log_CTRL.pitch_rate_i = buf.control_debug.pitch_rate_i;
|
||||
log_msg.body.log_CTRL.pitch_rate_d = buf.control_debug.pitch_rate_d;
|
||||
// log_msg.body.log_CTRL.yaw_p = buf.control_debug.yaw_p;
|
||||
// log_msg.body.log_CTRL.yaw_i = buf.control_debug.yaw_i;
|
||||
// log_msg.body.log_CTRL.yaw_d = buf.control_debug.yaw_d;
|
||||
log_msg.body.log_CTRL.yaw_rate_p = buf.control_debug.yaw_rate_p;
|
||||
log_msg.body.log_CTRL.yaw_rate_i = buf.control_debug.yaw_rate_i;
|
||||
log_msg.body.log_CTRL.yaw_rate_d = buf.control_debug.yaw_rate_d;
|
||||
|
||||
LOGBUFFER_WRITE_AND_COUNT(CTRL);
|
||||
}
|
||||
|
||||
@@ -159,29 +159,18 @@ struct log_STAT_s {
|
||||
/* --- CTRL - CONTROL DEBUG --- */
|
||||
#define LOG_CTRL_MSG 11
|
||||
struct log_CTRL_s {
|
||||
// float roll_p;
|
||||
// float roll_i;
|
||||
// float roll_d;
|
||||
|
||||
float roll_p;
|
||||
float roll_i;
|
||||
float roll_d;
|
||||
float roll_rate_p;
|
||||
float roll_rate_i;
|
||||
float roll_rate_d;
|
||||
|
||||
// float pitch_p;
|
||||
// float pitch_i;
|
||||
// float pitch_d;
|
||||
|
||||
float pitch_p;
|
||||
float pitch_i;
|
||||
float pitch_d;
|
||||
float pitch_rate_p;
|
||||
float pitch_rate_i;
|
||||
float pitch_rate_d;
|
||||
|
||||
// float yaw_p;
|
||||
// float yaw_i;
|
||||
// float yaw_d;
|
||||
|
||||
float yaw_rate_p;
|
||||
float yaw_rate_i;
|
||||
float yaw_rate_d;
|
||||
};
|
||||
|
||||
/* --- RC - RC INPUT CHANNELS --- */
|
||||
@@ -210,7 +199,7 @@ static const struct log_format_s log_formats[] = {
|
||||
LOG_FORMAT(GPS, "QBffLLfffff", "GPSTime,FixType,EPH,EPV,Lat,Lon,Alt,VelN,VelE,VelD,Cog"),
|
||||
LOG_FORMAT(ATTC, "ffff", "Roll,Pitch,Yaw,Thrust"),
|
||||
LOG_FORMAT(STAT, "BBBBBfffB", "State,FlightMode,CtlMode,SASMode,Armed,BatV,BatC,BatRem,BatWarn"),
|
||||
LOG_FORMAT(CTRL, "fffffffff", "RollRP,RollRI,RollRD,PitchRP,PitchRI,PitchRD,YawRP,YawRI,YawRD"),
|
||||
LOG_FORMAT(CTRL, "ffffffffffff", "RP,RI,RD,RRP,RRI,RRD,PP,PI,PD,PRP,PRI,PRD"),
|
||||
LOG_FORMAT(RC, "ffffffff", "Ch0,Ch1,Ch2,Ch3,Ch4,Ch5,Ch6,Ch7"),
|
||||
LOG_FORMAT(OUT0, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user