log total airspeed for vtol

This commit is contained in:
tumbili
2015-01-18 18:00:14 +01:00
parent beab89367f
commit 3a05b57169
2 changed files with 18 additions and 0 deletions
+12
View File
@@ -94,6 +94,7 @@
#include <uORB/topics/servorail_status.h>
#include <uORB/topics/wind_estimate.h>
#include <uORB/topics/encoders.h>
#include <uORB/topics/vtol_vehicle_status.h>
#include <systemlib/systemlib.h>
#include <systemlib/param/param.h>
@@ -1000,6 +1001,7 @@ int sdlog2_thread_main(int argc, char *argv[])
struct satellite_info_s sat_info;
struct wind_estimate_s wind_estimate;
struct encoders_s encoders;
struct vtol_vehicle_status_s vtol_status;
} buf;
memset(&buf, 0, sizeof(buf));
@@ -1019,6 +1021,7 @@ int sdlog2_thread_main(int argc, char *argv[])
struct log_GPS_s log_GPS;
struct log_ATTC_s log_ATTC;
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_AIRS_s log_AIRS;
@@ -1053,6 +1056,7 @@ int sdlog2_thread_main(int argc, char *argv[])
struct {
int cmd_sub;
int status_sub;
int vtol_status_sub;
int sensor_sub;
int att_sub;
int att_sp_sub;
@@ -1086,6 +1090,7 @@ int sdlog2_thread_main(int argc, char *argv[])
subs.cmd_sub = orb_subscribe(ORB_ID(vehicle_command));
subs.status_sub = orb_subscribe(ORB_ID(vehicle_status));
subs.vtol_status_sub = orb_subscribe(ORB_ID(vtol_vehicle_status));
subs.gps_pos_sub = orb_subscribe(ORB_ID(vehicle_gps_position));
subs.sensor_sub = orb_subscribe(ORB_ID(sensor_combined));
subs.att_sub = orb_subscribe(ORB_ID(vehicle_attitude));
@@ -1219,6 +1224,13 @@ int sdlog2_thread_main(int argc, char *argv[])
LOGBUFFER_WRITE_AND_COUNT(STAT);
}
/* --- VTOL VEHICLE STATUS --- */
if(copy_if_updated(ORB_ID(vtol_vehicle_status), subs.vtol_status_sub, &buf.vtol_status)) {
log_msg.msg_type = LOG_VTOL_MSG;
log_msg.body.log_VTOL.airspeed_tot = buf.vtol_status.airspeed_tot;
LOGBUFFER_WRITE_AND_COUNT(VTOL);
}
/* --- GPS POSITION - UNIT #1 --- */
if (gps_pos_updated) {