Merge branch 'master' into navigator_new_vector

This commit is contained in:
Anton Babushkin
2014-01-01 14:14:35 +04:00
24 changed files with 275 additions and 210 deletions
@@ -533,7 +533,8 @@ FixedwingAttitudeControl::task_main()
/* rate limit vehicle status updates to 5Hz */
orb_set_interval(_vcontrol_mode_sub, 200);
orb_set_interval(_att_sub, 100);
/* rate limit attitude control to 50 Hz (with some margin, so 17 ms) */
orb_set_interval(_att_sub, 17);
parameters_update();
+22 -15
View File
@@ -350,20 +350,26 @@ l_input_rc(const struct listener *l)
/* copy rc channels into local buffer */
orb_copy(ORB_ID(input_rc), mavlink_subs.input_rc_sub, &rc_raw);
if (gcs_link)
/* Channels are sent in MAVLink main loop at a fixed interval */
mavlink_msg_rc_channels_raw_send(chan,
rc_raw.timestamp / 1000,
0,
(rc_raw.channel_count > 0) ? rc_raw.values[0] : UINT16_MAX,
(rc_raw.channel_count > 1) ? rc_raw.values[1] : UINT16_MAX,
(rc_raw.channel_count > 2) ? rc_raw.values[2] : UINT16_MAX,
(rc_raw.channel_count > 3) ? rc_raw.values[3] : UINT16_MAX,
(rc_raw.channel_count > 4) ? rc_raw.values[4] : UINT16_MAX,
(rc_raw.channel_count > 5) ? rc_raw.values[5] : UINT16_MAX,
(rc_raw.channel_count > 6) ? rc_raw.values[6] : UINT16_MAX,
(rc_raw.channel_count > 7) ? rc_raw.values[7] : UINT16_MAX,
255);
if (gcs_link) {
const unsigned port_width = 8;
for (unsigned i = 0; (i * port_width) < (rc_raw.channel_count + port_width); i++) {
/* Channels are sent in MAVLink main loop at a fixed interval */
mavlink_msg_rc_channels_raw_send(chan,
rc_raw.timestamp / 1000,
i,
(rc_raw.channel_count > (i * port_width) + 0) ? rc_raw.values[(i * port_width) + 0] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 1) ? rc_raw.values[(i * port_width) + 1] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 2) ? rc_raw.values[(i * port_width) + 2] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 3) ? rc_raw.values[(i * port_width) + 3] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 4) ? rc_raw.values[(i * port_width) + 4] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 5) ? rc_raw.values[(i * port_width) + 5] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 6) ? rc_raw.values[(i * port_width) + 6] : UINT16_MAX,
(rc_raw.channel_count > (i * port_width) + 7) ? rc_raw.values[(i * port_width) + 7] : UINT16_MAX,
rc_raw.rssi);
}
}
}
void
@@ -492,7 +498,8 @@ l_actuator_outputs(const struct listener *l)
if (gcs_link) {
mavlink_msg_servo_output_raw_send(MAVLINK_COMM_0, last_sensor_timestamp / 1000,
l->arg /* port number */,
l->arg /* port number - needs GCS support */,
/* QGC has port number support already */
act_outputs.output[0],
act_outputs.output[1],
act_outputs.output[2],
+21 -14
View File
@@ -1,7 +1,6 @@
/****************************************************************************
*
* Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
* Author: Lorenz Meier <lm@inf.ethz.ch>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -63,7 +62,7 @@ static void do_import(const char* param_file_name);
static void do_show(const char* search_string);
static void do_show_print(void *arg, param_t param);
static void do_set(const char* name, const char* val);
static void do_compare(const char* name, const char* val);
static void do_compare(const char* name, const char* vals[], unsigned comparisons);
int
param_main(int argc, char *argv[])
@@ -121,7 +120,7 @@ param_main(int argc, char *argv[])
if (!strcmp(argv[1], "compare")) {
if (argc >= 4) {
do_compare(argv[2], argv[3]);
do_compare(argv[2], &argv[3], argc - 3);
} else {
errx(1, "not enough arguments.\nTry 'param compare PARAM_NAME 3'");
}
@@ -306,7 +305,7 @@ do_set(const char* name, const char* val)
}
static void
do_compare(const char* name, const char* val)
do_compare(const char* name, const char* vals[], unsigned comparisons)
{
int32_t i;
float f;
@@ -330,12 +329,16 @@ do_compare(const char* name, const char* val)
/* convert string */
char* end;
int j = strtol(val,&end,10);
if (i == j) {
printf(" %d: ", i);
ret = 0;
}
for (unsigned k = 0; k < comparisons; k++) {
int j = strtol(vals[k],&end,10);
if (i == j) {
printf(" %d: ", i);
ret = 0;
}
}
}
break;
@@ -345,10 +348,14 @@ do_compare(const char* name, const char* val)
/* convert string */
char* end;
float g = strtod(val, &end);
if (fabsf(f - g) < 1e-7f) {
printf(" %4.4f: ", (double)f);
ret = 0;
for (unsigned k = 0; k < comparisons; k++) {
float g = strtod(vals[k], &end);
if (fabsf(f - g) < 1e-7f) {
printf(" %4.4f: ", (double)f);
ret = 0;
}
}
}
@@ -359,7 +366,7 @@ do_compare(const char* name, const char* val)
}
if (ret == 0) {
printf("%c %s: equal\n",
printf("%c %s: match\n",
param_value_unsaved(param) ? '*' : (param_value_is_default(param) ? ' ' : '+'),
param_name(param));
}