Merge branch 'master' into seatbelt_multirotor

This commit is contained in:
Anton Babushkin
2013-06-17 13:52:20 +04:00
5 changed files with 118 additions and 78 deletions
@@ -126,7 +126,7 @@ int attitude_estimator_ekf_main(int argc, char *argv[])
attitude_estimator_ekf_task = task_spawn("attitude_estimator_ekf",
SCHED_DEFAULT,
SCHED_PRIORITY_MAX - 5,
12400,
14000,
attitude_estimator_ekf_thread_main,
(argv) ? (const char **)&argv[2] : (const char **)NULL);
exit(0);
+18 -1
View File
@@ -241,7 +241,7 @@ int sdlog2_main(int argc, char *argv[])
deamon_task = task_spawn("sdlog2",
SCHED_DEFAULT,
SCHED_PRIORITY_DEFAULT - 30,
2048,
3000,
sdlog2_thread_main,
(const char **)argv);
exit(0);
@@ -661,6 +661,7 @@ int sdlog2_thread_main(int argc, char *argv[])
int vicon_pos_sub;
int flow_sub;
int rc_sub;
int airspeed_sub;
} subs;
/* log message buffer: header + body */
@@ -681,6 +682,7 @@ int sdlog2_thread_main(int argc, char *argv[])
struct log_RC_s log_RC;
struct log_OUT0_s log_OUT0;
struct log_ARSP_s log_ARSP;
struct log_AIRS_s log_AIRS;
} body;
} log_msg = {
LOG_PACKET_HEADER_INIT(0)
@@ -784,6 +786,12 @@ int sdlog2_thread_main(int argc, char *argv[])
fds[fdsc_count].events = POLLIN;
fdsc_count++;
/* --- AIRSPEED --- */
subs.airspeed_sub = orb_subscribe(ORB_ID(airspeed));
fds[fdsc_count].fd = subs.airspeed_sub;
fds[fdsc_count].events = POLLIN;
fdsc_count++;
/* WARNING: If you get the error message below,
* then the number of registered messages (fdsc)
* differs from the number of messages in the above list.
@@ -1069,6 +1077,15 @@ int sdlog2_thread_main(int argc, char *argv[])
LOGBUFFER_WRITE_AND_COUNT(RC);
}
/* --- AIRSPEED --- */
if (fds[ifds++].revents & POLLIN) {
orb_copy(ORB_ID(airspeed), subs.airspeed_sub, &buf.airspeed);
log_msg.msg_type = LOG_AIRS_MSG;
log_msg.body.log_AIRS.indicated_airspeed = buf.airspeed.indicated_airspeed_m_s;
log_msg.body.log_AIRS.true_airspeed = buf.airspeed.true_airspeed_m_s;
LOGBUFFER_WRITE_AND_COUNT(AIRS);
}
/* signal the other thread new data, but not yet unlock */
if (logbuffer_count(&lb) > MIN_BYTES_TO_WRITE) {
#ifdef SDLOG2_DEBUG
+8 -1
View File
@@ -178,6 +178,13 @@ struct log_ARSP_s {
float pitch_rate_sp;
float yaw_rate_sp;
};
/* --- AIRS - AIRSPEED --- */
#define LOG_AIRS_MSG 13
struct log_AIRS_s {
float indicated_airspeed;
float true_airspeed;
};
#pragma pack(pop)
/* construct list of all message formats */
@@ -195,7 +202,7 @@ static const struct log_format_s log_formats[] = {
LOG_FORMAT(STAT, "BBBBBfffB", "State,FlightMode,CtlMode,SASMode,Armed,BatV,BatC,BatRem,BatWarn"),
LOG_FORMAT(RC, "ffffffff", "Ch0,Ch1,Ch2,Ch3,Ch4,Ch5,Ch6,Ch7"),
LOG_FORMAT(OUT0, "ffffffff", "Out0,Out1,Out2,Out3,Out4,Out5,Out6,Out7"),
LOG_FORMAT(ARSP, "fff", "RollRateSP,PitchRateSP,YawRateSP"),
LOG_FORMAT(AIRS, "ff", "IndSpeed,TrueSpeed"),
};
static const int log_formats_num = sizeof(log_formats) / sizeof(struct log_format_s);