aboutsummaryrefslogtreecommitdiff
path: root/src/modules/sdlog2/sdlog2.c
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2013-06-30 19:15:02 +0200
committerLorenz Meier <lm@inf.ethz.ch>2013-06-30 19:15:02 +0200
commitaa04701c89f912d455f8d2cf7a09c367d3ddd4e6 (patch)
tree4861ea3545bdcde0bc899458a8504bcda3217d50 /src/modules/sdlog2/sdlog2.c
parent8191130bbc8f2cbd53e69a7bcd1a4d4b1b2d68bb (diff)
downloadpx4-firmware-aa04701c89f912d455f8d2cf7a09c367d3ddd4e6.tar.gz
px4-firmware-aa04701c89f912d455f8d2cf7a09c367d3ddd4e6.tar.bz2
px4-firmware-aa04701c89f912d455f8d2cf7a09c367d3ddd4e6.zip
Added global position to logging
Diffstat (limited to 'src/modules/sdlog2/sdlog2.c')
-rw-r--r--src/modules/sdlog2/sdlog2.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/modules/sdlog2/sdlog2.c b/src/modules/sdlog2/sdlog2.c
index 90460cc62..982f843be 100644
--- a/src/modules/sdlog2/sdlog2.c
+++ b/src/modules/sdlog2/sdlog2.c
@@ -685,6 +685,7 @@ int sdlog2_thread_main(int argc, char *argv[])
struct log_AIRS_s log_AIRS;
struct log_ARSP_s log_ARSP;
struct log_FLOW_s log_FLOW;
+ struct log_GPOS_s log_GPOS;
} body;
} log_msg = {
LOG_PACKET_HEADER_INIT(0)
@@ -1056,7 +1057,14 @@ int sdlog2_thread_main(int argc, char *argv[])
/* --- GLOBAL POSITION --- */
if (fds[ifds++].revents & POLLIN) {
orb_copy(ORB_ID(vehicle_global_position), subs.global_pos_sub, &buf.global_pos);
- // TODO not implemented yet
+ log_msg.msg_type = LOG_GPOS_MSG;
+ log_msg.body.log_GPOS.lat = buf.global_pos.lat;
+ log_msg.body.log_GPOS.lon = buf.global_pos.lon;
+ log_msg.body.log_GPOS.alt = buf.global_pos.alt;
+ log_msg.body.log_GPOS.vel_n = buf.global_pos.vx;
+ log_msg.body.log_GPOS.vel_e = buf.global_pos.vy;
+ log_msg.body.log_GPOS.vel_d = buf.global_pos.vz;
+ LOGBUFFER_WRITE_AND_COUNT(GPOS);
}
/* --- VICON POSITION --- */