diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2013-06-06 23:19:16 +0400 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2013-06-06 23:19:16 +0400 |
commit | 4052652a28232edcdcb8089dcb05a8dc426343e4 (patch) | |
tree | 5f10f89866cc8c010c578bfd4e4bffce2694b7af /src/modules | |
parent | aedacc7bc8daa775f6101fc2ac90ffccae17180d (diff) | |
download | px4-firmware-4052652a28232edcdcb8089dcb05a8dc426343e4.tar.gz px4-firmware-4052652a28232edcdcb8089dcb05a8dc426343e4.tar.bz2 px4-firmware-4052652a28232edcdcb8089dcb05a8dc426343e4.zip |
sdlog2: ATTC - vehicle attitude control logging added
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/sdlog2/sdlog2.c | 8 | ||||
-rw-r--r-- | src/modules/sdlog2/sdlog2_messages.h | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c index b5821098f..290577790 100644 --- a/src/modules/sdlog2/sdlog2.c +++ b/src/modules/sdlog2/sdlog2.c @@ -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 --- */ diff --git a/src/modules/sdlog2/sdlog2_messages.h b/src/modules/sdlog2/sdlog2_messages.h index 316459b1e..44c6b9cba 100644 --- a/src/modules/sdlog2/sdlog2_messages.h +++ b/src/modules/sdlog2/sdlog2_messages.h @@ -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); |