forked from Archive/PX4-Autopilot
Tried to add ctrl debug values to sdlog2 (WIP)
This commit is contained in:
parent
b52d561b11
commit
bd7f86bb6a
|
@ -248,4 +248,5 @@ void multirotor_control_rates(const struct vehicle_rates_setpoint_s *rate_sp,
|
|||
motor_skip_counter++;
|
||||
|
||||
orb_publish(ORB_ID(vehicle_control_debug), control_debug_pub, &control_debug);
|
||||
printf("Published control debug\n");
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
|
||||
#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");*/ \
|
||||
|
@ -1071,25 +1072,28 @@ 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.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_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);
|
||||
}
|
||||
|
||||
/* --- FLOW --- */
|
||||
|
|
|
@ -159,25 +159,25 @@ 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_p;
|
||||
// float yaw_i;
|
||||
// float yaw_d;
|
||||
|
||||
float yaw_rate_p;
|
||||
float yaw_rate_i;
|
||||
|
@ -210,7 +210,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, "ffffffffffffffffff", "RollP,RollI,RollD,RollRateP,RollRateI,RollRateD,PitchP,PitchI,PitchD,PitchRateP,PitchRateI,PitchRateD,YawP,YawI,YawD,YawRateP,YawRateI,YawRateD"),
|
||||
LOG_FORMAT(CTRL, "fffffffff", "RollRP,RollRI,RollRD,PitchRP,PitchRI,PitchRD,YawRP,YawRI,YawRD"),
|
||||
LOG_FORMAT(RC, "ffffffff", "Ch0,Ch1,Ch2,Ch3,Ch4,Ch5,Ch6,Ch7"),
|
||||
LOG_FORMAT(OUT0, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue