Merge branch 'master' of github.com:PX4/Firmware

This commit is contained in:
Lorenz Meier
2012-09-07 22:12:32 +02:00
39 changed files with 512 additions and 246 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ uorb start
echo "[init] eeprom" echo "[init] eeprom"
eeprom start eeprom start
if [ -f /eeprom/parameters] if [ -f /eeprom/parameters ]
then then
eeprom load_param /eeprom/parameters eeprom load_param /eeprom/parameters
fi fi
+39 -15
View File
@@ -191,12 +191,26 @@ int ardrone_interface_thread_main(int argc, char *argv[])
char *commandline_usage = "\tusage: ardrone_interface start|status|stop [-t for motor test (10%% thrust)]\n"; char *commandline_usage = "\tusage: ardrone_interface start|status|stop [-t for motor test (10%% thrust)]\n";
bool motor_test_mode = false; bool motor_test_mode = false;
int test_motor = -1;
/* read commandline arguments */ /* read commandline arguments */
for (int i = 0; i < argc && argv[i]; i++) { for (int i = 0; i < argc && argv[i]; i++) {
if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--test") == 0) { if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--test") == 0) {
motor_test_mode = true; motor_test_mode = true;
} }
if (strcmp(argv[i], "-m") == 0 || strcmp(argv[i], "--motor") == 0) {
if (i+1 < argc) {
int motor = atoi(argv[i+1]);
if (motor > 0 && motor < 5) {
test_motor = motor;
} else {
errx(1, "supply a motor # between 1 and 4. Example: -m 1\n %s", commandline_usage);
}
} else {
errx(1, "missing parameter to -m 1..4\n %s", commandline_usage);
}
}
} }
struct termios uart_config_original; struct termios uart_config_original;
@@ -205,18 +219,6 @@ int ardrone_interface_thread_main(int argc, char *argv[])
printf("[ardrone_interface] Motor test mode enabled, setting 10 %% thrust.\n"); printf("[ardrone_interface] Motor test mode enabled, setting 10 %% thrust.\n");
} }
/* enable UART, writes potentially an empty buffer, but multiplexing is disabled */
ardrone_write = ardrone_open_uart(&uart_config_original);
/* initialize multiplexing, deactivate all outputs - must happen after UART open to claim GPIOs on PX4FMU */
gpios = ar_multiplexing_init();
if (ardrone_write < 0) {
fprintf(stderr, "[ardrone_interface] Failed opening AR.Drone UART, exiting.\n");
thread_running = false;
exit(ERROR);
}
/* Led animation */ /* Led animation */
int counter = 0; int counter = 0;
int led_counter = 0; int led_counter = 0;
@@ -237,6 +239,18 @@ int ardrone_interface_thread_main(int argc, char *argv[])
printf("[ardrone_interface] Motors initialized - ready.\n"); printf("[ardrone_interface] Motors initialized - ready.\n");
fflush(stdout); fflush(stdout);
/* enable UART, writes potentially an empty buffer, but multiplexing is disabled */
ardrone_write = ardrone_open_uart(&uart_config_original);
/* initialize multiplexing, deactivate all outputs - must happen after UART open to claim GPIOs on PX4FMU */
gpios = ar_multiplexing_init();
if (ardrone_write < 0) {
fprintf(stderr, "[ardrone_interface] Failed opening AR.Drone UART, exiting.\n");
thread_running = false;
exit(ERROR);
}
/* initialize motors */ /* initialize motors */
if (OK != ar_init_motors(ardrone_write, gpios)) { if (OK != ar_init_motors(ardrone_write, gpios)) {
close(ardrone_write); close(ardrone_write);
@@ -253,7 +267,7 @@ int ardrone_interface_thread_main(int argc, char *argv[])
/* close uarts */ /* close uarts */
close(ardrone_write); close(ardrone_write);
ar_multiplexing_deinit(gpios); //ar_multiplexing_deinit(gpios);
/* enable UART, writes potentially an empty buffer, but multiplexing is disabled */ /* enable UART, writes potentially an empty buffer, but multiplexing is disabled */
ardrone_write = ardrone_open_uart(&uart_config_original); ardrone_write = ardrone_open_uart(&uart_config_original);
@@ -279,7 +293,14 @@ int ardrone_interface_thread_main(int argc, char *argv[])
if (motor_test_mode) { if (motor_test_mode) {
/* set motors to idle speed */ /* set motors to idle speed */
ardrone_write_motor_commands(ardrone_write, 10, 10, 10, 10); if (test_motor > 0 && test_motor < 5) {
int motors[4] = {0, 0, 0, 0};
motors[test_motor - 1] = 10;
ardrone_write_motor_commands(ardrone_write, motors[0], motors[1], motors[2], motors[3]);
} else {
ardrone_write_motor_commands(ardrone_write, 10, 10, 10, 10);
}
} else { } else {
/* MAIN OPERATION MODE */ /* MAIN OPERATION MODE */
@@ -289,7 +310,10 @@ int ardrone_interface_thread_main(int argc, char *argv[])
orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_controls_sub, &actuator_controls); orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, actuator_controls_sub, &actuator_controls);
orb_copy(ORB_ID(actuator_armed), armed_sub, &armed); orb_copy(ORB_ID(actuator_armed), armed_sub, &armed);
if (armed.armed) { /* for now only spin if armed and immediately shut down
* if in failsafe
*/
if (armed.armed && !armed.failsafe) {
ardrone_mixing_and_output(ardrone_write, &actuator_controls); ardrone_mixing_and_output(ardrone_write, &actuator_controls);
} else { } else {
/* Silently lock down motor speeds to zero */ /* Silently lock down motor speeds to zero */
+32 -12
View File
@@ -43,6 +43,8 @@
#include <unistd.h> #include <unistd.h>
#include <drivers/drv_gpio.h> #include <drivers/drv_gpio.h>
#include <arch/board/up_hrt.h> #include <arch/board/up_hrt.h>
#include <uORB/uORB.h>
#include <uORB/topics/actuator_outputs.h>
#include <systemlib/err.h> #include <systemlib/err.h>
#include "ardrone_motor_control.h" #include "ardrone_motor_control.h"
@@ -224,9 +226,7 @@ int ar_init_motors(int ardrone_uart, int gpios)
for (i = 1; i < 5; ++i) { for (i = 1; i < 5; ++i) {
/* Initialize motors 1-4 */ /* Initialize motors 1-4 */
errcounter += ar_select_motor(gpios, i); errcounter += ar_select_motor(gpios, i);
usleep(200);
write(ardrone_uart, &(initbuf[3]), 1);
fsync(ardrone_uart);
/* /*
* write 0xE0 - request status * write 0xE0 - request status
@@ -270,29 +270,34 @@ int ar_init_motors(int ardrone_uart, int gpios)
usleep(UART_TRANSFER_TIME_BYTE_US*11); usleep(UART_TRANSFER_TIME_BYTE_US*11);
ar_deselect_motor(gpios, i); ar_deselect_motor(gpios, i);
/* sleep 400 ms */ /* sleep 200 ms */
usleep(400000); usleep(200000);
} }
/* start the multicast part */ /* start the multicast part */
errcounter += ar_select_motor(gpios, 0); errcounter += ar_select_motor(gpios, 0);
usleep(200);
/* /*
* first round
* write six times A0 - enable broadcast * write six times A0 - enable broadcast
* receive nothing * receive nothing
*/ */
// for (int i = 0; i < sizeof(multicastbuf); i++) { write(ardrone_uart, multicastbuf, sizeof(multicastbuf));
write(ardrone_uart, multicastbuf, 6);
fsync(ardrone_uart); fsync(ardrone_uart);
usleep(UART_TRANSFER_TIME_BYTE_US * sizeof(multicastbuf));
usleep(200000); /*
* second round
write(ardrone_uart, multicastbuf, 6); * write six times A0 - enable broadcast
* receive nothing
*/
write(ardrone_uart, multicastbuf, sizeof(multicastbuf));
fsync(ardrone_uart); fsync(ardrone_uart);
usleep(UART_TRANSFER_TIME_BYTE_US * sizeof(multicastbuf));
/* set motors to zero speed */ /* set motors to zero speed (fsync is part of the write command */
ardrone_write_motor_commands(ardrone_uart, 0, 0, 0, 0); ardrone_write_motor_commands(ardrone_uart, 0, 0, 0, 0);
fsync(ardrone_uart);
if (errcounter != 0) { if (errcounter != 0) {
fprintf(stderr, "[ardrone_interface] init sequence incomplete, failed %d times", -errcounter); fprintf(stderr, "[ardrone_interface] init sequence incomplete, failed %d times", -errcounter);
@@ -324,12 +329,27 @@ void ar_set_leds(int ardrone_uart, uint8_t led1_red, uint8_t led1_green, uint8_t
int ardrone_write_motor_commands(int ardrone_fd, uint16_t motor1, uint16_t motor2, uint16_t motor3, uint16_t motor4) { int ardrone_write_motor_commands(int ardrone_fd, uint16_t motor1, uint16_t motor2, uint16_t motor3, uint16_t motor4) {
const unsigned int min_motor_interval = 4900; const unsigned int min_motor_interval = 4900;
static uint64_t last_motor_time = 0; static uint64_t last_motor_time = 0;
static struct actuator_outputs_s outputs;
outputs.output[0] = motor1;
outputs.output[1] = motor2;
outputs.output[2] = motor3;
outputs.output[3] = motor4;
static orb_advert_t pub = 0;
if (pub == 0) {
pub = orb_advertise(ORB_ID_VEHICLE_CONTROLS, &outputs);
}
if (hrt_absolute_time() - last_motor_time > min_motor_interval) { if (hrt_absolute_time() - last_motor_time > min_motor_interval) {
uint8_t buf[5] = {0}; uint8_t buf[5] = {0};
ar_get_motor_packet(buf, motor1, motor2, motor3, motor4); ar_get_motor_packet(buf, motor1, motor2, motor3, motor4);
int ret; int ret;
ret = write(ardrone_fd, buf, sizeof(buf)); ret = write(ardrone_fd, buf, sizeof(buf));
fsync(ardrone_fd); fsync(ardrone_fd);
/* publish just written values */
orb_publish(ORB_ID_VEHICLE_CONTROLS, pub, &outputs);
if (ret == sizeof(buf)) { if (ret == sizeof(buf)) {
return OK; return OK;
} else { } else {
+63 -43
View File
@@ -69,6 +69,7 @@
#include <uORB/topics/vehicle_gps_position.h> #include <uORB/topics/vehicle_gps_position.h>
#include <uORB/topics/vehicle_command.h> #include <uORB/topics/vehicle_command.h>
#include <uORB/topics/subsystem_info.h> #include <uORB/topics/subsystem_info.h>
#include <uORB/topics/actuator_controls.h>
#include <mavlink/mavlink_log.h> #include <mavlink/mavlink_log.h>
#include <systemlib/param/param.h> #include <systemlib/param/param.h>
@@ -425,9 +426,9 @@ void do_mag_calibration(int status_pub, struct vehicle_status_s *status)
} else { } else {
/* announce and set new offset */ /* announce and set new offset */
char offset_output[50]; // char offset_output[50];
sprintf(offset_output, "[commander] mag cal: %8.4f %8.4f %8.4f", (double)mag_offset[0], (double)mag_offset[1], (double)mag_offset[2]); // sprintf(offset_output, "[commander] mag cal: %8.4f %8.4f %8.4f", (double)mag_offset[0], (double)mag_offset[1], (double)mag_offset[2]);
mavlink_log_info(mavlink_fd, offset_output); // mavlink_log_info(mavlink_fd, offset_output);
if (param_set(param_find("SENSOR_MAG_XOFF"), &(mag_offset[0]))) { if (param_set(param_find("SENSOR_MAG_XOFF"), &(mag_offset[0]))) {
fprintf(stderr, "[commander] Setting X mag offset failed!\n"); fprintf(stderr, "[commander] Setting X mag offset failed!\n");
@@ -505,9 +506,9 @@ void do_gyro_calibration(int status_pub, struct vehicle_status_s *status)
status->flag_preflight_gyro_calibration = false; status->flag_preflight_gyro_calibration = false;
state_machine_publish(status_pub, status, mavlink_fd); state_machine_publish(status_pub, status, mavlink_fd);
char offset_output[50]; // char offset_output[50];
sprintf(offset_output, "[commander] gyro cal: x:%8.4f y:%8.4f z:%8.4f", (double)gyro_offset[0], (double)gyro_offset[1], (double)gyro_offset[2]); // sprintf(offset_output, "[commander] gyro cal: x:%8.4f y:%8.4f z:%8.4f", (double)gyro_offset[0], (double)gyro_offset[1], (double)gyro_offset[2]);
mavlink_log_info(mavlink_fd, offset_output); // mavlink_log_info(mavlink_fd, offset_output);
close(sub_sensor_combined); close(sub_sensor_combined);
} }
@@ -573,10 +574,10 @@ void do_accel_calibration(int status_pub, struct vehicle_status_s *status)
status->flag_preflight_accel_calibration = false; status->flag_preflight_accel_calibration = false;
state_machine_publish(status_pub, status, mavlink_fd); state_machine_publish(status_pub, status, mavlink_fd);
char offset_output[50]; // char offset_output[50];
sprintf(offset_output, "[commander] accel cal: x:%8.4f y:%8.4f z:%8.4f", (double)accel_offset[0], // sprintf(offset_output, "[commander] accel cal: x:%8.4f y:%8.4f z:%8.4f", (double)accel_offset[0],
(double)accel_offset[1], (double)accel_offset[2]); // (double)accel_offset[1], (double)accel_offset[2]);
mavlink_log_info(mavlink_fd, offset_output); // mavlink_log_info(mavlink_fd, offset_output);
close(sub_sensor_combined); close(sub_sensor_combined);
} }
@@ -972,7 +973,7 @@ int commander_thread_main(int argc, char *argv[])
uint8_t flight_env; uint8_t flight_env;
/* Initialize to 3.0V to make sure the low-pass loads below valid threshold */ /* Initialize to 3.0V to make sure the low-pass loads below valid threshold */
float battery_voltage = VOLTAGE_BATTERY_HIGH_VOLTS; float battery_voltage = 12.0f;
bool battery_voltage_valid = true; bool battery_voltage_valid = true;
bool low_battery_voltage_actions_done = false; bool low_battery_voltage_actions_done = false;
bool critical_battery_voltage_actions_done = false; bool critical_battery_voltage_actions_done = false;
@@ -1009,6 +1010,8 @@ int commander_thread_main(int argc, char *argv[])
/* now initialized */ /* now initialized */
commander_initialized = true; commander_initialized = true;
uint64_t start_time = hrt_absolute_time();
while (!thread_should_exit) { while (!thread_should_exit) {
/* Get current values */ /* Get current values */
@@ -1018,7 +1021,14 @@ int commander_thread_main(int argc, char *argv[])
battery_voltage = sensors.battery_voltage_v; battery_voltage = sensors.battery_voltage_v;
battery_voltage_valid = sensors.battery_voltage_valid; battery_voltage_valid = sensors.battery_voltage_valid;
bat_remain = battery_remaining_estimate_voltage(3, BAT_CHEM_LITHIUM_POLYMERE, battery_voltage);
/*
* Only update battery voltage estimate if voltage is
* valid and system has been running for two and a half seconds
*/
if (battery_voltage_valid && (hrt_absolute_time() - start_time > 2500000)) {
bat_remain = battery_remaining_estimate_voltage(3, BAT_CHEM_LITHIUM_POLYMERE, battery_voltage);
}
/* Slow but important 8 Hz checks */ /* Slow but important 8 Hz checks */
if (counter % ((1000000 / COMMANDER_MONITORING_INTERVAL) / 8) == 0) { if (counter % ((1000000 / COMMANDER_MONITORING_INTERVAL) / 8) == 0) {
@@ -1083,6 +1093,38 @@ int commander_thread_main(int argc, char *argv[])
ioctl(buzzer, TONE_SET_ALARM, 0); ioctl(buzzer, TONE_SET_ALARM, 0);
} }
/* Check battery voltage */
/* write to sys_status */
current_status.voltage_battery = battery_voltage;
/* if battery voltage is getting lower, warn using buzzer, etc. */
if (battery_voltage_valid && (bat_remain < 0.15f /* XXX MAGIC NUMBER */) && (false == low_battery_voltage_actions_done)) { //TODO: add filter, or call emergency after n measurements < VOLTAGE_BATTERY_MINIMAL_MILLIVOLTS
if (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT) {
low_battery_voltage_actions_done = true;
mavlink_log_critical(mavlink_fd, "[commander] WARNING! LOW BATTERY!");
}
low_voltage_counter++;
}
/* Critical, this is rather an emergency, kill signal to sdlog and change state machine */
else if (battery_voltage_valid && (bat_remain < 0.1f /* XXX MAGIC NUMBER */) && (false == critical_battery_voltage_actions_done && true == low_battery_voltage_actions_done)) {
if (critical_voltage_counter > CRITICAL_VOLTAGE_BATTERY_COUNTER_LIMIT) {
critical_battery_voltage_actions_done = true;
mavlink_log_critical(mavlink_fd, "[commander] EMERGENCY! CIRITICAL BATTERY!");
state_machine_emergency(stat_pub, &current_status, mavlink_fd);
}
critical_voltage_counter++;
} else {
low_voltage_counter = 0;
critical_voltage_counter = 0;
}
/* End battery voltage check */
/* Check if last transition deserved an audio event */ /* Check if last transition deserved an audio event */
#warning This code depends on state that is no longer? maintained #warning This code depends on state that is no longer? maintained
#if 0 #if 0
@@ -1141,39 +1183,9 @@ int commander_thread_main(int argc, char *argv[])
//update_state_machine_got_position_fix(stat_pub, &current_status, mavlink_fd); //update_state_machine_got_position_fix(stat_pub, &current_status, mavlink_fd);
/* end: check gps */ /* end: check gps */
/* Check battery voltage */
/* write to sys_status */
current_status.voltage_battery = battery_voltage;
/* if battery voltage is getting lower, warn using buzzer, etc. */
if (battery_voltage_valid && (battery_voltage < VOLTAGE_BATTERY_LOW_VOLTS && false == low_battery_voltage_actions_done)) { //TODO: add filter, or call emergency after n measurements < VOLTAGE_BATTERY_MINIMAL_MILLIVOLTS
if (low_voltage_counter > LOW_VOLTAGE_BATTERY_COUNTER_LIMIT) {
low_battery_voltage_actions_done = true;
mavlink_log_critical(mavlink_fd, "[commander] WARNING! LOW BATTERY!");
}
low_voltage_counter++;
}
/* Critical, this is rather an emergency, kill signal to sdlog and change state machine */
else if (battery_voltage_valid && (battery_voltage < VOLTAGE_BATTERY_CRITICAL_VOLTS && false == critical_battery_voltage_actions_done && true == low_battery_voltage_actions_done)) {
if (critical_voltage_counter > CRITICAL_VOLTAGE_BATTERY_COUNTER_LIMIT) {
critical_battery_voltage_actions_done = true;
mavlink_log_critical(mavlink_fd, "[commander] EMERGENCY! CIRITICAL BATTERY!");
state_machine_emergency(stat_pub, &current_status, mavlink_fd);
}
critical_voltage_counter++;
} else {
low_voltage_counter = 0;
critical_voltage_counter = 0;
}
/* End battery voltage check */
/* Start RC state check */ /* Start RC state check */
bool prev_lost = current_status.rc_signal_lost;
if (rc.chan_count > 4 && (hrt_absolute_time() - rc.timestamp) < 100000) { if (rc.chan_count > 4 && (hrt_absolute_time() - rc.timestamp) < 100000) {
@@ -1238,10 +1250,18 @@ int commander_thread_main(int argc, char *argv[])
/* flag as lost and update interval since when the signal was lost (to initiate RTL after some time) */ /* flag as lost and update interval since when the signal was lost (to initiate RTL after some time) */
current_status.rc_signal_cutting_off = true; current_status.rc_signal_cutting_off = true;
current_status.rc_signal_lost_interval = hrt_absolute_time() - rc.timestamp; current_status.rc_signal_lost_interval = hrt_absolute_time() - rc.timestamp;
/* if the RC signal is gone for a full second, consider it lost */ /* if the RC signal is gone for a full second, consider it lost */
if (current_status.rc_signal_lost_interval > 1000000) current_status.rc_signal_lost = true; if (current_status.rc_signal_lost_interval > 1000000) current_status.rc_signal_lost = true;
} }
/* Check if this is the first loss or first gain*/
if ((!prev_lost && current_status.rc_signal_lost) ||
prev_lost && !current_status.rc_signal_lost) {
/* publish rc lost */
publish_armed_status(&current_status);
}
/* End mode switch */ /* End mode switch */
/* END RC state check */ /* END RC state check */
-2
View File
@@ -39,8 +39,6 @@
#ifndef COMMANDER_H_ #ifndef COMMANDER_H_
#define COMMANDER_H_ #define COMMANDER_H_
#define VOLTAGE_BATTERY_HIGH_VOLTS 12.0f
#define VOLTAGE_BATTERY_LOW_VOLTS 10.5f
#define VOLTAGE_BATTERY_CRITICAL_VOLTS 10.0f #define VOLTAGE_BATTERY_CRITICAL_VOLTS 10.0f
#define LOW_VOLTAGE_BATTERY_HYSTERESIS_TIME_MS 1000.0f #define LOW_VOLTAGE_BATTERY_HYSTERESIS_TIME_MS 1000.0f
#define CRITICAL_VOLTAGE_BATTERY_HYSTERESIS_TIME_MS 100.0f #define CRITICAL_VOLTAGE_BATTERY_HYSTERESIS_TIME_MS 100.0f
+9 -4
View File
@@ -199,10 +199,7 @@ int do_state_update(int status_pub, struct vehicle_status_s *current_status, con
if (invalid_state == false || old_state != new_state) { if (invalid_state == false || old_state != new_state) {
current_status->state_machine = new_state; current_status->state_machine = new_state;
state_machine_publish(status_pub, current_status, mavlink_fd); state_machine_publish(status_pub, current_status, mavlink_fd);
struct actuator_armed_s armed; publish_armed_status(current_status);
armed.armed = current_status->flag_system_armed;
orb_advert_t armed_pub = orb_advertise(ORB_ID(actuator_armed), &armed);
orb_publish(ORB_ID(actuator_armed), armed_pub, &armed);
ret = OK; ret = OK;
} }
if (invalid_state) { if (invalid_state) {
@@ -220,6 +217,14 @@ void state_machine_publish(int status_pub, struct vehicle_status_s *current_stat
printf("[commander] new state: %s\n", system_state_txt[current_status->state_machine]); printf("[commander] new state: %s\n", system_state_txt[current_status->state_machine]);
} }
void publish_armed_status(const struct vehicle_status_s *current_status) {
struct actuator_armed_s armed;
armed.armed = current_status->flag_system_armed;
armed.failsafe = current_status->rc_signal_lost;
orb_advert_t armed_pub = orb_advertise(ORB_ID(actuator_armed), &armed);
orb_publish(ORB_ID(actuator_armed), armed_pub, &armed);
}
/* /*
* Private functions, update the state machine * Private functions, update the state machine
+6
View File
@@ -188,6 +188,12 @@ void state_machine_emergency_always_critical(int status_pub, struct vehicle_stat
*/ */
void state_machine_emergency(int status_pub, struct vehicle_status_s *current_status, const int mavlink_fd); void state_machine_emergency(int status_pub, struct vehicle_status_s *current_status, const int mavlink_fd);
/**
* Publish the armed state depending on the current system state
*
* @param current_status the current system status
*/
void publish_armed_status(const struct vehicle_status_s *current_status);
+3 -3
View File
@@ -612,8 +612,8 @@ HMC5883::collect()
#pragma pack(push, 1) #pragma pack(push, 1)
struct { /* status register and data as read back from the device */ struct { /* status register and data as read back from the device */
uint8_t x[2]; uint8_t x[2];
uint8_t y[2];
uint8_t z[2]; uint8_t z[2];
uint8_t y[2];
} hmc_report; } hmc_report;
#pragma pack(pop) #pragma pack(pop)
struct { struct {
@@ -833,7 +833,7 @@ test()
err(1, "immediate read failed"); err(1, "immediate read failed");
warnx("single read"); warnx("single read");
warnx("measurement: %.6f %.6f %.6f", report.x, report.y, report.z); warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
warnx("time: %lld", report.timestamp); warnx("time: %lld", report.timestamp);
/* set the queue depth to 10 */ /* set the queue depth to 10 */
@@ -863,7 +863,7 @@ test()
err(1, "periodic read failed"); err(1, "periodic read failed");
warnx("periodic read %u", i); warnx("periodic read %u", i);
warnx("measurement: %.6f %.6f %.6f", report.x, report.y, report.z); warnx("measurement: %.6f %.6f %.6f", (double)report.x, (double)report.y, (double)report.z);
warnx("time: %lld", report.timestamp); warnx("time: %lld", report.timestamp);
} }
+5 -3
View File
@@ -369,8 +369,10 @@ MPU6000::init()
write_reg(MPUREG_SMPLRT_DIV, 0x04); // Sample rate = 200Hz Fsample= 1Khz/(4+1) = 200Hz write_reg(MPUREG_SMPLRT_DIV, 0x04); // Sample rate = 200Hz Fsample= 1Khz/(4+1) = 200Hz
usleep(1000); usleep(1000);
// FS & DLPF FS=2000 deg/s, DLPF = 98Hz (low pass filter) // FS & DLPF FS=2000 deg/s, DLPF = 20Hz (low pass filter)
write_reg(MPUREG_CONFIG, BITS_DLPF_CFG_98HZ); // was 90 Hz, but this ruins quality and does not improve the
// system response
write_reg(MPUREG_CONFIG, BITS_DLPF_CFG_20HZ);
usleep(1000); usleep(1000);
// Gyro scale 2000 deg/s () // Gyro scale 2000 deg/s ()
write_reg(MPUREG_GYRO_CONFIG, BITS_FS_2000DPS); write_reg(MPUREG_GYRO_CONFIG, BITS_FS_2000DPS);
@@ -1120,5 +1122,5 @@ mpu6000_main(int argc, char *argv[])
if (!strcmp(argv[1], "info")) if (!strcmp(argv[1], "info"))
mpu6000::info(); mpu6000::info();
errx(1, "unrecognised command, try 'start', 'test', 'reset' or 'info'"); errx(1, "unrecognized command, try 'start', 'test', 'reset' or 'info'");
} }
+84 -37
View File
@@ -75,6 +75,7 @@
#include <uORB/topics/actuator_outputs.h> #include <uORB/topics/actuator_outputs.h>
#include <uORB/topics/actuator_controls.h> #include <uORB/topics/actuator_controls.h>
#include <uORB/topics/manual_control_setpoint.h> #include <uORB/topics/manual_control_setpoint.h>
#include <uORB/topics/debug_key_value.h>
#include <systemlib/param/param.h> #include <systemlib/param/param.h>
#include "waypoints.h" #include "waypoints.h"
@@ -166,6 +167,7 @@ static struct mavlink_subscriptions {
int spa_sub; int spa_sub;
int spl_sub; int spl_sub;
int spg_sub; int spg_sub;
int debug_key_value;
bool initialized; bool initialized;
} mavlink_subs = { } mavlink_subs = {
.sensor_sub = 0, .sensor_sub = 0,
@@ -183,6 +185,7 @@ static struct mavlink_subscriptions {
.spa_sub = 0, .spa_sub = 0,
.spl_sub = 0, .spl_sub = 0,
.spg_sub = 0, .spg_sub = 0,
.debug_key_value = 0,
.initialized = false .initialized = false
}; };
@@ -539,10 +542,15 @@ static int set_mavlink_interval_limit(struct mavlink_subscriptions *subs, int ma
if (subs->act_1_sub) orb_set_interval(subs->act_1_sub, min_interval); if (subs->act_1_sub) orb_set_interval(subs->act_1_sub, min_interval);
if (subs->act_2_sub) orb_set_interval(subs->act_2_sub, min_interval); if (subs->act_2_sub) orb_set_interval(subs->act_2_sub, min_interval);
if (subs->act_3_sub) orb_set_interval(subs->act_3_sub, min_interval); if (subs->act_3_sub) orb_set_interval(subs->act_3_sub, min_interval);
if (subs->actuators_sub) orb_set_interval(subs->actuators_sub, min_interval);
break; break;
case MAVLINK_MSG_ID_MANUAL_CONTROL: case MAVLINK_MSG_ID_MANUAL_CONTROL:
/* manual_control_setpoint triggers this message */ /* manual_control_setpoint triggers this message */
if (subs->man_control_sp_sub) orb_set_interval(subs->man_control_sp_sub, min_interval); if (subs->man_control_sp_sub) orb_set_interval(subs->man_control_sp_sub, min_interval);
break;
case MAVLINK_MSG_ID_NAMED_VALUE_FLOAT:
if (subs->debug_key_value) orb_set_interval(subs->debug_key_value, min_interval);
break;
default: default:
/* not found */ /* not found */
ret = ERROR; ret = ERROR;
@@ -588,6 +596,7 @@ static void *uorb_receiveloop(void *arg)
struct actuator_outputs_s act_outputs; struct actuator_outputs_s act_outputs;
struct manual_control_setpoint_s man_control; struct manual_control_setpoint_s man_control;
struct actuator_controls_s actuators; struct actuator_controls_s actuators;
struct debug_key_value_s debug;
} buf; } buf;
/* --- SENSORS RAW VALUE --- */ /* --- SENSORS RAW VALUE --- */
@@ -704,11 +713,17 @@ static void *uorb_receiveloop(void *arg)
/* --- ACTUATOR CONTROL VALUE --- */ /* --- ACTUATOR CONTROL VALUE --- */
/* subscribe to ORB for actuator control */ /* subscribe to ORB for actuator control */
subs->actuators_sub = orb_subscribe(ORB_ID_VEHICLE_ATTITUDE_CONTROLS); subs->actuators_sub = orb_subscribe(ORB_ID_VEHICLE_ATTITUDE_CONTROLS);
orb_set_interval(subs->actuators_sub, 2000); /* 0.5 Hz updates */
fds[fdsc_count].fd = subs->actuators_sub; fds[fdsc_count].fd = subs->actuators_sub;
fds[fdsc_count].events = POLLIN; fds[fdsc_count].events = POLLIN;
fdsc_count++; fdsc_count++;
/* --- DEBUG VALUE OUTPUT --- */
/* subscribe to ORB for debug value outputs */
subs->debug_key_value = orb_subscribe(ORB_ID(debug_key_value));
fds[fdsc_count].fd = subs->debug_key_value;
fds[fdsc_count].events = POLLIN;
fdsc_count++;
/* all subscriptions initialized, return success */ /* all subscriptions initialized, return success */
subs->initialized = true; subs->initialized = true;
@@ -755,6 +770,38 @@ static void *uorb_receiveloop(void *arg)
/* send scaled imu data (m/s^2 accelerations scaled back to milli-g) */ /* send scaled imu data (m/s^2 accelerations scaled back to milli-g) */
//mavlink_msg_scaled_imu_send(MAVLINK_COMM_0, buf.raw.timestamp, buf.raw.accelerometer_m_s2[0] * 101.936799f, buf.raw.accelerometer_m_s2[1] * 101.936799f, buf.raw.accelerometer_m_s2[2] * 101.936799f, buf.raw.gyro_rad_s[0] * 1000, buf.raw.gyro_rad_s[1] * 1000, buf.raw.gyro_rad_s[2] * 1000, buf.raw.magnetometer_ga[0] * 1000, buf.raw.magnetometer_ga[1] * 1000, buf.raw.magnetometer_ga[2] * 1000); //mavlink_msg_scaled_imu_send(MAVLINK_COMM_0, buf.raw.timestamp, buf.raw.accelerometer_m_s2[0] * 101.936799f, buf.raw.accelerometer_m_s2[1] * 101.936799f, buf.raw.accelerometer_m_s2[2] * 101.936799f, buf.raw.gyro_rad_s[0] * 1000, buf.raw.gyro_rad_s[1] * 1000, buf.raw.gyro_rad_s[2] * 1000, buf.raw.magnetometer_ga[0] * 1000, buf.raw.magnetometer_ga[1] * 1000, buf.raw.magnetometer_ga[2] * 1000);
/* send scaled imu data */ /* send scaled imu data */
/* mark individual fields as changed */
uint16_t fields_updated = 0;
static unsigned accel_counter = 0;
static unsigned gyro_counter = 0;
static unsigned mag_counter = 0;
static unsigned baro_counter = 0;
if (accel_counter != buf.raw.accelerometer_counter) {
/* mark first three dimensions as changed */
fields_updated |= (1 << 0) | (1 << 1) | (1 << 2);
accel_counter = buf.raw.accelerometer_counter;
}
if (gyro_counter != buf.raw.gyro_counter) {
/* mark first three dimensions as changed */
fields_updated |= (1 << 3) | (1 << 4) | (1 << 5);
gyro_counter = buf.raw.gyro_counter;
}
if (mag_counter != buf.raw.magnetometer_counter) {
/* mark first three dimensions as changed */
fields_updated |= (1 << 6) | (1 << 7) | (1 << 8);
mag_counter = buf.raw.magnetometer_counter;
}
if (baro_counter != buf.raw.baro_counter) {
/* mark first three dimensions as changed */
fields_updated |= (1 << 9) | (1 << 11) | (1 << 12);
baro_counter = buf.raw.baro_counter;
}
mavlink_msg_highres_imu_send(MAVLINK_COMM_0, buf.raw.timestamp, mavlink_msg_highres_imu_send(MAVLINK_COMM_0, buf.raw.timestamp,
buf.raw.accelerometer_m_s2[0], buf.raw.accelerometer_m_s2[1], buf.raw.accelerometer_m_s2[0], buf.raw.accelerometer_m_s2[1],
buf.raw.accelerometer_m_s2[2], buf.raw.gyro_rad_s[0], buf.raw.accelerometer_m_s2[2], buf.raw.gyro_rad_s[0],
@@ -762,7 +809,8 @@ static void *uorb_receiveloop(void *arg)
buf.raw.magnetometer_ga[0], buf.raw.magnetometer_ga[0],
buf.raw.magnetometer_ga[1],buf.raw.magnetometer_ga[2], buf.raw.magnetometer_ga[1],buf.raw.magnetometer_ga[2],
buf.raw.baro_pres_mbar, 0 /* no diff pressure yet */, buf.raw.baro_pres_mbar, 0 /* no diff pressure yet */,
buf.raw.baro_alt_meter, buf.raw.baro_temp_celcius); buf.raw.baro_alt_meter, buf.raw.baro_temp_celcius,
fields_updated);
/* send pressure */ /* send pressure */
//mavlink_msg_scaled_pressure_send(MAVLINK_COMM_0, buf.raw.timestamp / 1000, buf.raw.baro_pres_mbar, buf.raw.baro_alt_meter, buf.raw.baro_temp_celcius * 100); //mavlink_msg_scaled_pressure_send(MAVLINK_COMM_0, buf.raw.timestamp / 1000, buf.raw.baro_pres_mbar, buf.raw.baro_alt_meter, buf.raw.baro_temp_celcius * 100);
@@ -895,32 +943,15 @@ static void *uorb_receiveloop(void *arg)
/* Only send in HIL mode */ /* Only send in HIL mode */
if (mavlink_hil_enabled) { if (mavlink_hil_enabled) {
/* hacked HIL implementation in order for the APM Planner to work
* (correct cmd: mavlink_msg_hil_controls_send())
*/
mavlink_msg_rc_channels_scaled_send(chan,
hrt_absolute_time(),
0, // port 0
buf.att_sp.roll_body,
buf.att_sp.pitch_body,
buf.att_sp.thrust,
buf.att_sp.yaw_body,
0,
0,
0,
0,
1 /*rssi=1*/);
/* translate the current syste state to mavlink state and mode */ /* translate the current syste state to mavlink state and mode */
uint8_t mavlink_state = 0; uint8_t mavlink_state = 0;
uint8_t mavlink_mode = 0; uint8_t mavlink_mode = 0;
get_mavlink_mode_and_state(&v_status, &armed, &mavlink_state, &mavlink_mode); get_mavlink_mode_and_state(&v_status, &armed, &mavlink_state, &mavlink_mode);
/* correct HIL message as per MAVLink spec */ /* HIL message as per MAVLink spec */
mavlink_msg_hil_controls_send(chan, mavlink_msg_hil_controls_send(chan,
hrt_absolute_time(), hrt_absolute_time(),
buf.att_sp.roll_body, buf.att_sp.roll_body, /* this may be replaced by ctrl0 later */
buf.att_sp.pitch_body, buf.att_sp.pitch_body,
buf.att_sp.yaw_body, buf.att_sp.yaw_body,
buf.att_sp.thrust, buf.att_sp.thrust,
@@ -1060,10 +1091,17 @@ static void *uorb_receiveloop(void *arg)
/* --- ACTUATOR CONTROL --- */ /* --- ACTUATOR CONTROL --- */
if (fds[ifds++].revents & POLLIN) { if (fds[ifds++].revents & POLLIN) {
orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs->actuators_sub, &buf.actuators); orb_copy(ORB_ID_VEHICLE_ATTITUDE_CONTROLS, subs->actuators_sub, &buf.actuators);
mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl0", buf.actuators.control[0]); /* send, add spaces so that string buffer is at least 10 chars long */
mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl1", buf.actuators.control[1]); mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl0 ", buf.actuators.control[0]);
mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl2", buf.actuators.control[2]); mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl1 ", buf.actuators.control[1]);
mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl3", buf.actuators.control[3]); mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl2 ", buf.actuators.control[2]);
mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, "ctrl3 ", buf.actuators.control[3]);
}
/* --- DEBUG KEY/VALUE --- */
if (fds[ifds++].revents & POLLIN) {
orb_copy(ORB_ID(debug_key_value), subs->debug_key_value, &buf.debug);
mavlink_msg_named_value_float_send(MAVLINK_COMM_0, hrt_absolute_time() / 1000, buf.debug.key, buf.debug.value);
} }
} }
} }
@@ -1495,28 +1533,33 @@ int mavlink_thread_main(int argc, char *argv[])
/* all subscriptions are now active, set up initial guess about rate limits */ /* all subscriptions are now active, set up initial guess about rate limits */
if (baudrate >= 921600) { if (baudrate >= 921600) {
/* 500 Hz / 2 ms */ /* 200 Hz / 5 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 2); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 5);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 2);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 2);
/* 200 Hz / 5 ms */ /* 200 Hz / 5 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 5); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 5);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 5);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 5);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 5);
/* 5 Hz */ /* 5 Hz */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 200); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 200);
} else if (baudrate >= 460800) { } else if (baudrate >= 460800) {
/* 250 Hz / 4 ms */ /* 200 Hz / 5 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 5);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 5);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 5); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 5);
/* 50 Hz / 20 ms */ /* 50 Hz / 10 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 20); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 20);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 20);
/* 20 Hz / 50 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 50);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 50);
/* 2 Hz */ /* 2 Hz */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 500); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 500);
} else if (baudrate >= 115200) { } else if (baudrate >= 115200) {
/* 50 Hz / 20 ms */ /* 50 Hz / 20 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 50); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 20);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 50); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 20);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 50); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 20);
/* 20 Hz / 50 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 50);
/* 10 Hz / 100 ms */ /* 10 Hz / 100 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 100); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 100);
/* 1 Hz */ /* 1 Hz */
@@ -1527,6 +1570,8 @@ int mavlink_thread_main(int argc, char *argv[])
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 100); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 100);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 100); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 100);
/* 5 Hz / 200 ms */ /* 5 Hz / 200 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 200);
/* 5 Hz / 200 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 200); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 200);
/* 0.2 Hz */ /* 0.2 Hz */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 5000); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 5000);
@@ -1535,6 +1580,8 @@ int mavlink_thread_main(int argc, char *argv[])
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 1000); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SCALED_IMU, 1000);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 1000); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_ATTITUDE, 1000);
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 1000); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 1000);
/* 1 Hz / 1000 ms */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_NAMED_VALUE_FLOAT, 1000);
/* 0.5 Hz */ /* 0.5 Hz */
set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 2000); set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_SERVO_OUTPUT_RAW, 2000);
/* 0.1 Hz */ /* 0.1 Hz */
+3 -3
View File
@@ -189,7 +189,7 @@ static int mavlink_pm_save_eeprom()
int result = param_export(fd, false); int result = param_export(fd, false);
close(fd); close(fd);
if (result < 0) { if (result != 0) {
unlink(mavlink_parameter_file); unlink(mavlink_parameter_file);
warn("error exporting parameters to '%s'", mavlink_parameter_file); warn("error exporting parameters to '%s'", mavlink_parameter_file);
return -2; return -2;
@@ -218,7 +218,7 @@ mavlink_pm_load_eeprom()
int result = param_load(fd); int result = param_load(fd);
close(fd); close(fd);
if (result < 0) { if (result != 0) {
warn("error reading parameters from '%s'", mavlink_parameter_file); warn("error reading parameters from '%s'", mavlink_parameter_file);
return -2; return -2;
} }
@@ -346,7 +346,7 @@ void mavlink_pm_message_handler(const mavlink_channel_t chan, const mavlink_mess
} }
/* send back command result */ /* send back command result */
// mavlink_message_t tx; //mavlink_msg_command_ack_send(chan, cmd.command, result);
} break; } break;
} }
} }
@@ -144,6 +144,7 @@ mc_thread_main(int argc, char *argv[])
att_sp.roll_body = -manual.roll * M_PI_F / 8.0f; att_sp.roll_body = -manual.roll * M_PI_F / 8.0f;
att_sp.pitch_body = -manual.pitch * M_PI_F / 8.0f; att_sp.pitch_body = -manual.pitch * M_PI_F / 8.0f;
att_sp.yaw_body = -manual.yaw * M_PI_F; att_sp.yaw_body = -manual.yaw * M_PI_F;
att_sp.timestamp = hrt_absolute_time();
if (motor_test_mode) { if (motor_test_mode) {
att_sp.roll_body = 0.0f; att_sp.roll_body = 0.0f;
att_sp.pitch_body = 0.0f; att_sp.pitch_body = 0.0f;
@@ -231,7 +231,7 @@ void multirotor_control_attitude(const struct vehicle_attitude_setpoint_s *att_s
pid_set_parameters(&yaw_pos_controller, p.yaw_p, p.yaw_i, p.yaw_d, p.yaw_awu); pid_set_parameters(&yaw_pos_controller, p.yaw_p, p.yaw_i, p.yaw_d, p.yaw_awu);
pid_set_parameters(&yaw_speed_controller, p.yawrate_p, p.yawrate_d, p.yawrate_i, p.yawrate_awu); pid_set_parameters(&yaw_speed_controller, p.yawrate_p, p.yawrate_d, p.yawrate_i, p.yawrate_awu);
pid_set_parameters(&pitch_controller, p.att_p, p.att_i, p.att_d, p.att_awu); pid_set_parameters(&pitch_controller, p.att_p, p.att_i, p.att_d, p.att_awu);
pid_set_parameters(&pitch_controller, p.att_p, p.att_i, p.att_d, p.att_awu); pid_set_parameters(&roll_controller, p.att_p, p.att_i, p.att_d, p.att_awu);
} }
/* calculate current control outputs */ /* calculate current control outputs */
@@ -226,7 +226,7 @@ int attitude_estimator_bm_main(int argc, char *argv[])
att.timestamp = sensor_combined_s_local.timestamp; att.timestamp = sensor_combined_s_local.timestamp;
att.roll = euler.x; att.roll = euler.x;
att.pitch = euler.y; att.pitch = euler.y;
att.yaw = euler.z - M_PI_F; att.yaw = euler.z;
if (att.yaw > M_PI_F) { if (att.yaw > M_PI_F) {
att.yaw -= 2.0f * M_PI_F; att.yaw -= 2.0f * M_PI_F;
+56 -27
View File
@@ -653,9 +653,16 @@ Sensors::accel_poll(struct sensor_combined_s &raw)
accel_report.x = (((accel_report.x_raw - _parameters.acc_offset[0]) * range_g) / 8192.0f) / 9.81f; accel_report.x = (((accel_report.x_raw - _parameters.acc_offset[0]) * range_g) / 8192.0f) / 9.81f;
accel_report.y = (((accel_report.y_raw - _parameters.acc_offset[0]) * range_g) / 8192.0f) / 9.81f; accel_report.y = (((accel_report.y_raw - _parameters.acc_offset[0]) * range_g) / 8192.0f) / 9.81f;
accel_report.z = (((accel_report.z_raw - _parameters.acc_offset[0]) * range_g) / 8192.0f) / 9.81f; accel_report.z = (((accel_report.z_raw - _parameters.acc_offset[0]) * range_g) / 8192.0f) / 9.81f;
raw.accelerometer_counter++;
} else { } else {
orb_copy(ORB_ID(sensor_accel), _accel_sub, &accel_report); bool accel_updated;
orb_check(_accel_sub, &accel_updated);
if (accel_updated) {
orb_copy(ORB_ID(sensor_accel), _accel_sub, &accel_report);
raw.accelerometer_counter++;
}
} }
raw.accelerometer_m_s2[0] = accel_report.x; raw.accelerometer_m_s2[0] = accel_report.x;
@@ -665,8 +672,6 @@ Sensors::accel_poll(struct sensor_combined_s &raw)
raw.accelerometer_raw[0] = accel_report.x_raw; raw.accelerometer_raw[0] = accel_report.x_raw;
raw.accelerometer_raw[1] = accel_report.y_raw; raw.accelerometer_raw[1] = accel_report.y_raw;
raw.accelerometer_raw[2] = accel_report.z_raw; raw.accelerometer_raw[2] = accel_report.z_raw;
raw.accelerometer_raw_counter++;
} }
void void
@@ -691,9 +696,6 @@ Sensors::gyro_poll(struct sensor_combined_s &raw)
gyro_report.y = (gyro_report.y_raw - _parameters.gyro_offset[1]) * 0.000266316109f; gyro_report.y = (gyro_report.y_raw - _parameters.gyro_offset[1]) * 0.000266316109f;
gyro_report.z = (gyro_report.z_raw - _parameters.gyro_offset[2]) * 0.000266316109f; gyro_report.z = (gyro_report.z_raw - _parameters.gyro_offset[2]) * 0.000266316109f;
} else {
orb_copy(ORB_ID(sensor_gyro), _gyro_sub, &gyro_report);
raw.gyro_rad_s[0] = gyro_report.x; raw.gyro_rad_s[0] = gyro_report.x;
raw.gyro_rad_s[1] = gyro_report.y; raw.gyro_rad_s[1] = gyro_report.y;
raw.gyro_rad_s[2] = gyro_report.z; raw.gyro_rad_s[2] = gyro_report.z;
@@ -702,40 +704,69 @@ Sensors::gyro_poll(struct sensor_combined_s &raw)
raw.gyro_raw[1] = gyro_report.y_raw; raw.gyro_raw[1] = gyro_report.y_raw;
raw.gyro_raw[2] = gyro_report.z_raw; raw.gyro_raw[2] = gyro_report.z_raw;
raw.gyro_raw_counter++; raw.gyro_counter++;
} else {
bool gyro_updated;
orb_check(_gyro_sub, &gyro_updated);
if (gyro_updated) {
orb_copy(ORB_ID(sensor_gyro), _gyro_sub, &gyro_report);
raw.gyro_rad_s[0] = gyro_report.x;
raw.gyro_rad_s[1] = gyro_report.y;
raw.gyro_rad_s[2] = gyro_report.z;
raw.gyro_raw[0] = gyro_report.x_raw;
raw.gyro_raw[1] = gyro_report.y_raw;
raw.gyro_raw[2] = gyro_report.z_raw;
raw.gyro_counter++;
}
} }
} }
void void
Sensors::mag_poll(struct sensor_combined_s &raw) Sensors::mag_poll(struct sensor_combined_s &raw)
{ {
struct mag_report mag_report; bool mag_updated;
orb_check(_mag_sub, &mag_updated);
orb_copy(ORB_ID(sensor_mag), _mag_sub, &mag_report); if (mag_updated) {
struct mag_report mag_report;
raw.magnetometer_ga[0] = mag_report.x; orb_copy(ORB_ID(sensor_mag), _mag_sub, &mag_report);
raw.magnetometer_ga[1] = mag_report.y;
raw.magnetometer_ga[2] = mag_report.z;
raw.magnetometer_raw[0] = mag_report.x_raw; raw.magnetometer_ga[0] = mag_report.x;
raw.magnetometer_raw[1] = mag_report.y_raw; raw.magnetometer_ga[1] = mag_report.y;
raw.magnetometer_raw[2] = mag_report.z_raw; raw.magnetometer_ga[2] = mag_report.z;
raw.magnetometer_raw_counter++; raw.magnetometer_raw[0] = mag_report.x_raw;
raw.magnetometer_raw[1] = mag_report.y_raw;
raw.magnetometer_raw[2] = mag_report.z_raw;
raw.magnetometer_counter++;
}
} }
void void
Sensors::baro_poll(struct sensor_combined_s &raw) Sensors::baro_poll(struct sensor_combined_s &raw)
{ {
struct baro_report baro_report; bool baro_updated;
orb_check(_baro_sub, &baro_updated);
orb_copy(ORB_ID(sensor_baro), _baro_sub, &baro_report); if (baro_updated) {
struct baro_report baro_report;
raw.baro_pres_mbar = baro_report.pressure; // Pressure in mbar orb_copy(ORB_ID(sensor_baro), _baro_sub, &baro_report);
raw.baro_alt_meter = baro_report.altitude; // Altitude in meters
raw.baro_temp_celcius = baro_report.temperature; // Temperature in degrees celcius
raw.baro_raw_counter++; raw.baro_pres_mbar = baro_report.pressure; // Pressure in mbar
raw.baro_alt_meter = baro_report.altitude; // Altitude in meters
raw.baro_temp_celcius = baro_report.temperature; // Temperature in degrees celcius
raw.baro_counter++;
}
} }
void void
@@ -779,8 +810,6 @@ Sensors::parameter_update_poll(bool forced)
struct parameter_update_s update; struct parameter_update_s update;
orb_copy(ORB_ID(parameter_update), _params_sub, &update); orb_copy(ORB_ID(parameter_update), _params_sub, &update);
printf("PARAMS UPDATED\n");
/* update parameters */ /* update parameters */
parameters_update(); parameters_update();
@@ -824,7 +853,7 @@ Sensors::parameter_update_poll(bool forced)
warn("WARNING: failed to set scale / offsets for mag"); warn("WARNING: failed to set scale / offsets for mag");
close(fd); close(fd);
#if 1 #if 0
printf("CH0: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n", (int)_parameters.max[0], (int)_parameters.min[0], (int)(_rc.chan[0].scaling_factor*10000), (int)(_rc.chan[0].mid), (int)_rc.function[0]); printf("CH0: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n", (int)_parameters.max[0], (int)_parameters.min[0], (int)(_rc.chan[0].scaling_factor*10000), (int)(_rc.chan[0].mid), (int)_rc.function[0]);
printf("CH1: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n", (int)_parameters.max[1], (int)_parameters.min[1], (int)(_rc.chan[1].scaling_factor*10000), (int)(_rc.chan[1].mid), (int)_rc.function[1]); printf("CH1: RAW MAX: %d MIN %d S: %d MID: %d FUNC: %d\n", (int)_parameters.max[1], (int)_parameters.min[1], (int)(_rc.chan[1].scaling_factor*10000), (int)(_rc.chan[1].mid), (int)_rc.function[1]);
printf("MAN: %d %d\n", (int)(_rc.chan[0].scaled*100), (int)(_rc.chan[1].scaled*100)); printf("MAN: %d %d\n", (int)(_rc.chan[0].scaled*100), (int)(_rc.chan[1].scaled*100));
@@ -857,7 +886,7 @@ Sensors::adc_poll(struct sensor_combined_s &raw)
/* Voltage in volts */ /* Voltage in volts */
raw.battery_voltage_v = (BAT_VOL_LOWPASS_1 * (raw.battery_voltage_v + BAT_VOL_LOWPASS_2 * (buf_adc.am_data1 * _parameters.battery_voltage_scaling))); raw.battery_voltage_v = (BAT_VOL_LOWPASS_1 * (raw.battery_voltage_v + BAT_VOL_LOWPASS_2 * (buf_adc.am_data1 * _parameters.battery_voltage_scaling)));
if ((buf_adc.am_data1 * _parameters.battery_voltage_scaling) < VOLTAGE_BATTERY_IGNORE_THRESHOLD_VOLTS) { if ((raw.battery_voltage_v) < VOLTAGE_BATTERY_IGNORE_THRESHOLD_VOLTS) {
raw.battery_voltage_valid = false; raw.battery_voltage_valid = false;
raw.battery_voltage_v = 0.f; raw.battery_voltage_v = 0.f;
+1 -1
View File
@@ -44,7 +44,7 @@
#include "tinybson.h" #include "tinybson.h"
#if 1 #if 0
# define debug(fmt, args...) do { warnx("BSON: " fmt, ##args); } while(0) # define debug(fmt, args...) do { warnx("BSON: " fmt, ##args); } while(0)
#else #else
# define debug(fmt, args...) do { } while(0) # define debug(fmt, args...) do { } while(0)
+2 -2
View File
@@ -479,7 +479,7 @@ param_export(int fd, bool only_unsaved)
* If we are only saving values changed since last save, and this * If we are only saving values changed since last save, and this
* one hasn't, then skip it * one hasn't, then skip it
*/ */
if (only_unsaved & !s->unsaved) if (only_unsaved && !s->unsaved)
continue; continue;
s->unsaved = false; s->unsaved = false;
@@ -519,7 +519,7 @@ param_export(int fd, bool only_unsaved)
break; break;
default: default:
debug("unrecognised parameter type"); debug("unrecognized parameter type");
goto out; goto out;
} }
} }
+3
View File
@@ -123,3 +123,6 @@ ORB_DEFINE(actuator_outputs_0, struct actuator_outputs_s);
ORB_DEFINE(actuator_outputs_1, struct actuator_outputs_s); ORB_DEFINE(actuator_outputs_1, struct actuator_outputs_s);
ORB_DEFINE(actuator_outputs_2, struct actuator_outputs_s); ORB_DEFINE(actuator_outputs_2, struct actuator_outputs_s);
ORB_DEFINE(actuator_outputs_3, struct actuator_outputs_s); ORB_DEFINE(actuator_outputs_3, struct actuator_outputs_s);
#include "topics/debug_key_value.h"
ORB_DEFINE(debug_key_value, struct debug_key_value_s);
+2 -1
View File
@@ -67,7 +67,8 @@ ORB_DECLARE(actuator_controls_3);
/** global 'actuator output is live' control. */ /** global 'actuator output is live' control. */
struct actuator_armed_s { struct actuator_armed_s {
bool armed; bool armed; /**< Set to true if system is armed */
bool failsafe; /**< Set to true if no valid control input is available */
}; };
ORB_DECLARE(actuator_armed); ORB_DECLARE(actuator_armed);
+75
View File
@@ -0,0 +1,75 @@
/****************************************************************************
*
* Copyright (C) 2012 PX4 Development Team. All rights reserved.
* Author: @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
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name PX4 nor the names of its contributors may be
* used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/**
* @file debug_key_value.h
* Definition of the debug named value uORB topic. Allows to send a 10-char key
* with a float as value.
*/
#ifndef TOPIC_DEBUG_KEY_VALUE_H_
#define TOPIC_DEBUG_KEY_VALUE_H_
#include <stdint.h>
#include <stdbool.h>
#include "../uORB.h"
/**
* @addtogroup topics
*/
/**
* Key/value pair for debugging
*/
struct debug_key_value_s {
/*
* Actual data, this is specific to the type of data which is stored in this struct
* A line containing L0GME will be added by the Python logging code generator to the
* logged dataset.
*/
uint32_t timestamp_ms; /**< in milliseconds since system start */
char key[10]; /**< max. 10 characters as key / name */
float value; /**< the value to send as debug output */
};
/**
* @}
*/
/* register this as object request broker structure */
ORB_DECLARE(debug_key_value);
#endif
+5 -5
View File
@@ -80,11 +80,11 @@ struct sensor_combined_s {
uint64_t timestamp; /**< Timestamp in microseconds since boot LOGME */ uint64_t timestamp; /**< Timestamp in microseconds since boot LOGME */
int16_t gyro_raw[3]; /**< Raw sensor values of angular velocity LOGME */ int16_t gyro_raw[3]; /**< Raw sensor values of angular velocity LOGME */
uint16_t gyro_raw_counter; /**< Number of raw measurments taken LOGME */ uint16_t gyro_counter; /**< Number of raw measurments taken LOGME */
float gyro_rad_s[3]; /**< Angular velocity in radian per seconds LOGME */ float gyro_rad_s[3]; /**< Angular velocity in radian per seconds LOGME */
int16_t accelerometer_raw[3]; /**< Raw acceleration in NED body frame LOGME */ int16_t accelerometer_raw[3]; /**< Raw acceleration in NED body frame LOGME */
uint16_t accelerometer_raw_counter; /**< Number of raw acc measurements taken LOGME */ uint32_t accelerometer_counter; /**< Number of raw acc measurements taken LOGME */
float accelerometer_m_s2[3]; /**< Acceleration in NED body frame, in m/s^2 LOGME */ float accelerometer_m_s2[3]; /**< Acceleration in NED body frame, in m/s^2 LOGME */
int accelerometer_mode; /**< Accelerometer measurement mode */ int accelerometer_mode; /**< Accelerometer measurement mode */
float accelerometer_range_m_s2; /**< Accelerometer measurement range in m/s^2 */ float accelerometer_range_m_s2; /**< Accelerometer measurement range in m/s^2 */
@@ -94,15 +94,15 @@ struct sensor_combined_s {
int magnetometer_mode; /**< Magnetometer measurement mode */ int magnetometer_mode; /**< Magnetometer measurement mode */
float magnetometer_range_ga; /**< ± measurement range in Gauss */ float magnetometer_range_ga; /**< ± measurement range in Gauss */
float magnetometer_cuttoff_freq_hz; /**< Internal analog low pass frequency of sensor */ float magnetometer_cuttoff_freq_hz; /**< Internal analog low pass frequency of sensor */
uint16_t magnetometer_raw_counter; /**< Number of raw mag measurements taken LOGME */ uint32_t magnetometer_counter; /**< Number of raw mag measurements taken LOGME */
float baro_pres_mbar; /**< Barometric pressure, already temp. comp. LOGME */ float baro_pres_mbar; /**< Barometric pressure, already temp. comp. LOGME */
float baro_alt_meter; /**< Altitude, already temp. comp. LOGME */ float baro_alt_meter; /**< Altitude, already temp. comp. LOGME */
float baro_temp_celcius; /**< Temperature in degrees celsius LOGME */ float baro_temp_celcius; /**< Temperature in degrees celsius LOGME */
float battery_voltage_v; /**< Battery voltage in volts, filtered LOGME */ float battery_voltage_v; /**< Battery voltage in volts, filtered LOGME */
float adc_voltage_v[3]; /**< ADC voltages of ADC Chan 11/12/13 or -1 LOGME */ float adc_voltage_v[3]; /**< ADC voltages of ADC Chan 11/12/13 or -1 LOGME */
uint16_t baro_raw_counter; /**< Number of raw baro measurements taken LOGME */ uint32_t baro_counter; /**< Number of raw baro measurements taken LOGME */
uint16_t battery_voltage_counter; /**< Number of voltage measurements taken LOGME */ uint32_t battery_voltage_counter; /**< Number of voltage measurements taken LOGME */
bool battery_voltage_valid; /**< True if battery voltage can be measured LOGME */ bool battery_voltage_valid; /**< True if battery voltage can be measured LOGME */
}; };
@@ -12,11 +12,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS // MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS #ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0} #define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 8, 4, 12, 15, 13, 6, 15, 14, 0, 12, 3, 8, 28, 44, 3, 9, 22, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_CRCS #ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 111, 21, 21, 144, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0} #define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 134, 219, 208, 188, 84, 22, 19, 21, 134, 0, 78, 68, 189, 127, 111, 21, 21, 144, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_INFO #ifndef MAVLINK_MESSAGE_INFO
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H #ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H #define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Sep 3 14:55:54 2012" #define MAVLINK_BUILD_DATE "Thu Sep 6 15:30:01 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
+2 -2
View File
@@ -12,11 +12,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS // MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS #ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0} #define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_CRCS #ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0} #define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_INFO #ifndef MAVLINK_MESSAGE_INFO
@@ -4,7 +4,7 @@
typedef struct __mavlink_global_vision_position_estimate_t typedef struct __mavlink_global_vision_position_estimate_t
{ {
uint64_t usec; ///< Timestamp (milliseconds) uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X position float x; ///< Global X position
float y; ///< Global Y position float y; ///< Global Y position
float z; ///< Global Z position float z; ///< Global Z position
@@ -38,7 +38,7 @@ typedef struct __mavlink_global_vision_position_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_pack(uint8_t
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over * @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_global_vision_position_estimate_encode(uint8_
* @brief Send a global_vision_position_estimate message * @brief Send a global_vision_position_estimate message
* @param chan MAVLink channel to send the message * @param chan MAVLink channel to send the message
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -187,7 +187,7 @@ static inline void mavlink_msg_global_vision_position_estimate_send(mavlink_chan
/** /**
* @brief Get field usec from global_vision_position_estimate message * @brief Get field usec from global_vision_position_estimate message
* *
* @return Timestamp (milliseconds) * @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/ */
static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg) static inline uint64_t mavlink_msg_global_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{ {
@@ -4,7 +4,7 @@
typedef struct __mavlink_highres_imu_t typedef struct __mavlink_highres_imu_t
{ {
uint64_t time_boot_ms; ///< Timestamp (milliseconds since system boot) uint64_t time_usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float xacc; ///< X acceleration (m/s^2) float xacc; ///< X acceleration (m/s^2)
float yacc; ///< Y acceleration (m/s^2) float yacc; ///< Y acceleration (m/s^2)
float zacc; ///< Z acceleration (m/s^2) float zacc; ///< Z acceleration (m/s^2)
@@ -14,21 +14,22 @@ typedef struct __mavlink_highres_imu_t
float xmag; ///< X Magnetic field (Gauss) float xmag; ///< X Magnetic field (Gauss)
float ymag; ///< Y Magnetic field (Gauss) float ymag; ///< Y Magnetic field (Gauss)
float zmag; ///< Z Magnetic field (Gauss) float zmag; ///< Z Magnetic field (Gauss)
float abs_pressure; ///< Absolute pressure in hectopascal float abs_pressure; ///< Absolute pressure in millibar
float diff_pressure; ///< Differential pressure in hectopascal float diff_pressure; ///< Differential pressure in millibar
float pressure_alt; ///< Altitude calculated from pressure float pressure_alt; ///< Altitude calculated from pressure
float temperature; ///< Temperature in degrees celsius float temperature; ///< Temperature in degrees celsius
uint16_t fields_updated; ///< Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
} mavlink_highres_imu_t; } mavlink_highres_imu_t;
#define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 60 #define MAVLINK_MSG_ID_HIGHRES_IMU_LEN 62
#define MAVLINK_MSG_ID_105_LEN 60 #define MAVLINK_MSG_ID_105_LEN 62
#define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \ #define MAVLINK_MESSAGE_INFO_HIGHRES_IMU { \
"HIGHRES_IMU", \ "HIGHRES_IMU", \
14, \ 15, \
{ { "time_boot_ms", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_boot_ms) }, \ { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_highres_imu_t, time_usec) }, \
{ "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \ { "xacc", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_highres_imu_t, xacc) }, \
{ "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \ { "yacc", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_highres_imu_t, yacc) }, \
{ "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \ { "zacc", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_highres_imu_t, zacc) }, \
@@ -42,6 +43,7 @@ typedef struct __mavlink_highres_imu_t
{ "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \ { "diff_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_highres_imu_t, diff_pressure) }, \
{ "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \ { "pressure_alt", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_highres_imu_t, pressure_alt) }, \
{ "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \ { "temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_highres_imu_t, temperature) }, \
{ "fields_updated", NULL, MAVLINK_TYPE_UINT16_T, 0, 60, offsetof(mavlink_highres_imu_t, fields_updated) }, \
} \ } \
} }
@@ -52,7 +54,7 @@ typedef struct __mavlink_highres_imu_t
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* *
* @param time_boot_ms Timestamp (milliseconds since system boot) * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param xacc X acceleration (m/s^2) * @param xacc X acceleration (m/s^2)
* @param yacc Y acceleration (m/s^2) * @param yacc Y acceleration (m/s^2)
* @param zacc Z acceleration (m/s^2) * @param zacc Z acceleration (m/s^2)
@@ -62,18 +64,19 @@ typedef struct __mavlink_highres_imu_t
* @param xmag X Magnetic field (Gauss) * @param xmag X Magnetic field (Gauss)
* @param ymag Y Magnetic field (Gauss) * @param ymag Y Magnetic field (Gauss)
* @param zmag Z Magnetic field (Gauss) * @param zmag Z Magnetic field (Gauss)
* @param abs_pressure Absolute pressure in hectopascal * @param abs_pressure Absolute pressure in millibar
* @param diff_pressure Differential pressure in hectopascal * @param diff_pressure Differential pressure in millibar
* @param pressure_alt Altitude calculated from pressure * @param pressure_alt Altitude calculated from pressure
* @param temperature Temperature in degrees celsius * @param temperature Temperature in degrees celsius
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
* @return length of the message in bytes (excluding serial stream start sign) * @return length of the message in bytes (excluding serial stream start sign)
*/ */
static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
uint64_t time_boot_ms, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature) uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[60]; char buf[62];
_mav_put_uint64_t(buf, 0, time_boot_ms); _mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, xacc); _mav_put_float(buf, 8, xacc);
_mav_put_float(buf, 12, yacc); _mav_put_float(buf, 12, yacc);
_mav_put_float(buf, 16, zacc); _mav_put_float(buf, 16, zacc);
@@ -87,11 +90,12 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c
_mav_put_float(buf, 48, diff_pressure); _mav_put_float(buf, 48, diff_pressure);
_mav_put_float(buf, 52, pressure_alt); _mav_put_float(buf, 52, pressure_alt);
_mav_put_float(buf, 56, temperature); _mav_put_float(buf, 56, temperature);
_mav_put_uint16_t(buf, 60, fields_updated);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 60); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62);
#else #else
mavlink_highres_imu_t packet; mavlink_highres_imu_t packet;
packet.time_boot_ms = time_boot_ms; packet.time_usec = time_usec;
packet.xacc = xacc; packet.xacc = xacc;
packet.yacc = yacc; packet.yacc = yacc;
packet.zacc = zacc; packet.zacc = zacc;
@@ -105,12 +109,13 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c
packet.diff_pressure = diff_pressure; packet.diff_pressure = diff_pressure;
packet.pressure_alt = pressure_alt; packet.pressure_alt = pressure_alt;
packet.temperature = temperature; packet.temperature = temperature;
packet.fields_updated = fields_updated;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 60); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62);
#endif #endif
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
return mavlink_finalize_message(msg, system_id, component_id, 60, 106); return mavlink_finalize_message(msg, system_id, component_id, 62, 93);
} }
/** /**
@@ -119,7 +124,7 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over * @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* @param time_boot_ms Timestamp (milliseconds since system boot) * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param xacc X acceleration (m/s^2) * @param xacc X acceleration (m/s^2)
* @param yacc Y acceleration (m/s^2) * @param yacc Y acceleration (m/s^2)
* @param zacc Z acceleration (m/s^2) * @param zacc Z acceleration (m/s^2)
@@ -129,19 +134,20 @@ static inline uint16_t mavlink_msg_highres_imu_pack(uint8_t system_id, uint8_t c
* @param xmag X Magnetic field (Gauss) * @param xmag X Magnetic field (Gauss)
* @param ymag Y Magnetic field (Gauss) * @param ymag Y Magnetic field (Gauss)
* @param zmag Z Magnetic field (Gauss) * @param zmag Z Magnetic field (Gauss)
* @param abs_pressure Absolute pressure in hectopascal * @param abs_pressure Absolute pressure in millibar
* @param diff_pressure Differential pressure in hectopascal * @param diff_pressure Differential pressure in millibar
* @param pressure_alt Altitude calculated from pressure * @param pressure_alt Altitude calculated from pressure
* @param temperature Temperature in degrees celsius * @param temperature Temperature in degrees celsius
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
* @return length of the message in bytes (excluding serial stream start sign) * @return length of the message in bytes (excluding serial stream start sign)
*/ */
static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
mavlink_message_t* msg, mavlink_message_t* msg,
uint64_t time_boot_ms,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature) uint64_t time_usec,float xacc,float yacc,float zacc,float xgyro,float ygyro,float zgyro,float xmag,float ymag,float zmag,float abs_pressure,float diff_pressure,float pressure_alt,float temperature,uint16_t fields_updated)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[60]; char buf[62];
_mav_put_uint64_t(buf, 0, time_boot_ms); _mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, xacc); _mav_put_float(buf, 8, xacc);
_mav_put_float(buf, 12, yacc); _mav_put_float(buf, 12, yacc);
_mav_put_float(buf, 16, zacc); _mav_put_float(buf, 16, zacc);
@@ -155,11 +161,12 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint
_mav_put_float(buf, 48, diff_pressure); _mav_put_float(buf, 48, diff_pressure);
_mav_put_float(buf, 52, pressure_alt); _mav_put_float(buf, 52, pressure_alt);
_mav_put_float(buf, 56, temperature); _mav_put_float(buf, 56, temperature);
_mav_put_uint16_t(buf, 60, fields_updated);
memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 60); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 62);
#else #else
mavlink_highres_imu_t packet; mavlink_highres_imu_t packet;
packet.time_boot_ms = time_boot_ms; packet.time_usec = time_usec;
packet.xacc = xacc; packet.xacc = xacc;
packet.yacc = yacc; packet.yacc = yacc;
packet.zacc = zacc; packet.zacc = zacc;
@@ -173,12 +180,13 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint
packet.diff_pressure = diff_pressure; packet.diff_pressure = diff_pressure;
packet.pressure_alt = pressure_alt; packet.pressure_alt = pressure_alt;
packet.temperature = temperature; packet.temperature = temperature;
packet.fields_updated = fields_updated;
memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 60); memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 62);
#endif #endif
msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU; msg->msgid = MAVLINK_MSG_ID_HIGHRES_IMU;
return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 60, 106); return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 62, 93);
} }
/** /**
@@ -191,14 +199,14 @@ static inline uint16_t mavlink_msg_highres_imu_pack_chan(uint8_t system_id, uint
*/ */
static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu) static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_highres_imu_t* highres_imu)
{ {
return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_boot_ms, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature); return mavlink_msg_highres_imu_pack(system_id, component_id, msg, highres_imu->time_usec, highres_imu->xacc, highres_imu->yacc, highres_imu->zacc, highres_imu->xgyro, highres_imu->ygyro, highres_imu->zgyro, highres_imu->xmag, highres_imu->ymag, highres_imu->zmag, highres_imu->abs_pressure, highres_imu->diff_pressure, highres_imu->pressure_alt, highres_imu->temperature, highres_imu->fields_updated);
} }
/** /**
* @brief Send a highres_imu message * @brief Send a highres_imu message
* @param chan MAVLink channel to send the message * @param chan MAVLink channel to send the message
* *
* @param time_boot_ms Timestamp (milliseconds since system boot) * @param time_usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param xacc X acceleration (m/s^2) * @param xacc X acceleration (m/s^2)
* @param yacc Y acceleration (m/s^2) * @param yacc Y acceleration (m/s^2)
* @param zacc Z acceleration (m/s^2) * @param zacc Z acceleration (m/s^2)
@@ -208,18 +216,19 @@ static inline uint16_t mavlink_msg_highres_imu_encode(uint8_t system_id, uint8_t
* @param xmag X Magnetic field (Gauss) * @param xmag X Magnetic field (Gauss)
* @param ymag Y Magnetic field (Gauss) * @param ymag Y Magnetic field (Gauss)
* @param zmag Z Magnetic field (Gauss) * @param zmag Z Magnetic field (Gauss)
* @param abs_pressure Absolute pressure in hectopascal * @param abs_pressure Absolute pressure in millibar
* @param diff_pressure Differential pressure in hectopascal * @param diff_pressure Differential pressure in millibar
* @param pressure_alt Altitude calculated from pressure * @param pressure_alt Altitude calculated from pressure
* @param temperature Temperature in degrees celsius * @param temperature Temperature in degrees celsius
* @param fields_updated Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
*/ */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_boot_ms, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature) static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t time_usec, float xacc, float yacc, float zacc, float xgyro, float ygyro, float zgyro, float xmag, float ymag, float zmag, float abs_pressure, float diff_pressure, float pressure_alt, float temperature, uint16_t fields_updated)
{ {
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
char buf[60]; char buf[62];
_mav_put_uint64_t(buf, 0, time_boot_ms); _mav_put_uint64_t(buf, 0, time_usec);
_mav_put_float(buf, 8, xacc); _mav_put_float(buf, 8, xacc);
_mav_put_float(buf, 12, yacc); _mav_put_float(buf, 12, yacc);
_mav_put_float(buf, 16, zacc); _mav_put_float(buf, 16, zacc);
@@ -233,11 +242,12 @@ static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t
_mav_put_float(buf, 48, diff_pressure); _mav_put_float(buf, 48, diff_pressure);
_mav_put_float(buf, 52, pressure_alt); _mav_put_float(buf, 52, pressure_alt);
_mav_put_float(buf, 56, temperature); _mav_put_float(buf, 56, temperature);
_mav_put_uint16_t(buf, 60, fields_updated);
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, 60, 106); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, buf, 62, 93);
#else #else
mavlink_highres_imu_t packet; mavlink_highres_imu_t packet;
packet.time_boot_ms = time_boot_ms; packet.time_usec = time_usec;
packet.xacc = xacc; packet.xacc = xacc;
packet.yacc = yacc; packet.yacc = yacc;
packet.zacc = zacc; packet.zacc = zacc;
@@ -251,8 +261,9 @@ static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t
packet.diff_pressure = diff_pressure; packet.diff_pressure = diff_pressure;
packet.pressure_alt = pressure_alt; packet.pressure_alt = pressure_alt;
packet.temperature = temperature; packet.temperature = temperature;
packet.fields_updated = fields_updated;
_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, 60, 106); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGHRES_IMU, (const char *)&packet, 62, 93);
#endif #endif
} }
@@ -262,11 +273,11 @@ static inline void mavlink_msg_highres_imu_send(mavlink_channel_t chan, uint64_t
/** /**
* @brief Get field time_boot_ms from highres_imu message * @brief Get field time_usec from highres_imu message
* *
* @return Timestamp (milliseconds since system boot) * @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/ */
static inline uint64_t mavlink_msg_highres_imu_get_time_boot_ms(const mavlink_message_t* msg) static inline uint64_t mavlink_msg_highres_imu_get_time_usec(const mavlink_message_t* msg)
{ {
return _MAV_RETURN_uint64_t(msg, 0); return _MAV_RETURN_uint64_t(msg, 0);
} }
@@ -364,7 +375,7 @@ static inline float mavlink_msg_highres_imu_get_zmag(const mavlink_message_t* ms
/** /**
* @brief Get field abs_pressure from highres_imu message * @brief Get field abs_pressure from highres_imu message
* *
* @return Absolute pressure in hectopascal * @return Absolute pressure in millibar
*/ */
static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg) static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_message_t* msg)
{ {
@@ -374,7 +385,7 @@ static inline float mavlink_msg_highres_imu_get_abs_pressure(const mavlink_messa
/** /**
* @brief Get field diff_pressure from highres_imu message * @brief Get field diff_pressure from highres_imu message
* *
* @return Differential pressure in hectopascal * @return Differential pressure in millibar
*/ */
static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg) static inline float mavlink_msg_highres_imu_get_diff_pressure(const mavlink_message_t* msg)
{ {
@@ -401,6 +412,16 @@ static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_messag
return _MAV_RETURN_float(msg, 56); return _MAV_RETURN_float(msg, 56);
} }
/**
* @brief Get field fields_updated from highres_imu message
*
* @return Bitmask for fields that have updated since last message, bit 0 = xacc, bit 12: temperature
*/
static inline uint16_t mavlink_msg_highres_imu_get_fields_updated(const mavlink_message_t* msg)
{
return _MAV_RETURN_uint16_t(msg, 60);
}
/** /**
* @brief Decode a highres_imu message into a struct * @brief Decode a highres_imu message into a struct
* *
@@ -410,7 +431,7 @@ static inline float mavlink_msg_highres_imu_get_temperature(const mavlink_messag
static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu) static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg, mavlink_highres_imu_t* highres_imu)
{ {
#if MAVLINK_NEED_BYTE_SWAP #if MAVLINK_NEED_BYTE_SWAP
highres_imu->time_boot_ms = mavlink_msg_highres_imu_get_time_boot_ms(msg); highres_imu->time_usec = mavlink_msg_highres_imu_get_time_usec(msg);
highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg); highres_imu->xacc = mavlink_msg_highres_imu_get_xacc(msg);
highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg); highres_imu->yacc = mavlink_msg_highres_imu_get_yacc(msg);
highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg); highres_imu->zacc = mavlink_msg_highres_imu_get_zacc(msg);
@@ -424,7 +445,8 @@ static inline void mavlink_msg_highres_imu_decode(const mavlink_message_t* msg,
highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg); highres_imu->diff_pressure = mavlink_msg_highres_imu_get_diff_pressure(msg);
highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg); highres_imu->pressure_alt = mavlink_msg_highres_imu_get_pressure_alt(msg);
highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg); highres_imu->temperature = mavlink_msg_highres_imu_get_temperature(msg);
highres_imu->fields_updated = mavlink_msg_highres_imu_get_fields_updated(msg);
#else #else
memcpy(highres_imu, _MAV_PAYLOAD(msg), 60); memcpy(highres_imu, _MAV_PAYLOAD(msg), 62);
#endif #endif
} }
@@ -4,7 +4,7 @@
typedef struct __mavlink_vicon_position_estimate_t typedef struct __mavlink_vicon_position_estimate_t
{ {
uint64_t usec; ///< Timestamp (milliseconds) uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X position float x; ///< Global X position
float y; ///< Global Y position float y; ///< Global Y position
float z; ///< Global Z position float z; ///< Global Z position
@@ -38,7 +38,7 @@ typedef struct __mavlink_vicon_position_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_pack(uint8_t system_i
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over * @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_vicon_position_estimate_encode(uint8_t system
* @brief Send a vicon_position_estimate message * @brief Send a vicon_position_estimate message
* @param chan MAVLink channel to send the message * @param chan MAVLink channel to send the message
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -187,7 +187,7 @@ static inline void mavlink_msg_vicon_position_estimate_send(mavlink_channel_t ch
/** /**
* @brief Get field usec from vicon_position_estimate message * @brief Get field usec from vicon_position_estimate message
* *
* @return Timestamp (milliseconds) * @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/ */
static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg) static inline uint64_t mavlink_msg_vicon_position_estimate_get_usec(const mavlink_message_t* msg)
{ {
@@ -4,7 +4,7 @@
typedef struct __mavlink_vision_position_estimate_t typedef struct __mavlink_vision_position_estimate_t
{ {
uint64_t usec; ///< Timestamp (milliseconds) uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X position float x; ///< Global X position
float y; ///< Global Y position float y; ///< Global Y position
float z; ///< Global Z position float z; ///< Global Z position
@@ -38,7 +38,7 @@ typedef struct __mavlink_vision_position_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -84,7 +84,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_pack(uint8_t system_
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over * @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -142,7 +142,7 @@ static inline uint16_t mavlink_msg_vision_position_estimate_encode(uint8_t syste
* @brief Send a vision_position_estimate message * @brief Send a vision_position_estimate message
* @param chan MAVLink channel to send the message * @param chan MAVLink channel to send the message
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X position * @param x Global X position
* @param y Global Y position * @param y Global Y position
* @param z Global Z position * @param z Global Z position
@@ -187,7 +187,7 @@ static inline void mavlink_msg_vision_position_estimate_send(mavlink_channel_t c
/** /**
* @brief Get field usec from vision_position_estimate message * @brief Get field usec from vision_position_estimate message
* *
* @return Timestamp (milliseconds) * @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/ */
static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg) static inline uint64_t mavlink_msg_vision_position_estimate_get_usec(const mavlink_message_t* msg)
{ {
@@ -4,7 +4,7 @@
typedef struct __mavlink_vision_speed_estimate_t typedef struct __mavlink_vision_speed_estimate_t
{ {
uint64_t usec; ///< Timestamp (milliseconds) uint64_t usec; ///< Timestamp (microseconds, synced to UNIX time or since system boot)
float x; ///< Global X speed float x; ///< Global X speed
float y; ///< Global Y speed float y; ///< Global Y speed
float z; ///< Global Z speed float z; ///< Global Z speed
@@ -32,7 +32,7 @@ typedef struct __mavlink_vision_speed_estimate_t
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X speed * @param x Global X speed
* @param y Global Y speed * @param y Global Y speed
* @param z Global Z speed * @param z Global Z speed
@@ -69,7 +69,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_pack(uint8_t system_id,
* @param component_id ID of this component (e.g. 200 for IMU) * @param component_id ID of this component (e.g. 200 for IMU)
* @param chan The MAVLink channel this message was sent over * @param chan The MAVLink channel this message was sent over
* @param msg The MAVLink message to compress the data into * @param msg The MAVLink message to compress the data into
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X speed * @param x Global X speed
* @param y Global Y speed * @param y Global Y speed
* @param z Global Z speed * @param z Global Z speed
@@ -118,7 +118,7 @@ static inline uint16_t mavlink_msg_vision_speed_estimate_encode(uint8_t system_i
* @brief Send a vision_speed_estimate message * @brief Send a vision_speed_estimate message
* @param chan MAVLink channel to send the message * @param chan MAVLink channel to send the message
* *
* @param usec Timestamp (milliseconds) * @param usec Timestamp (microseconds, synced to UNIX time or since system boot)
* @param x Global X speed * @param x Global X speed
* @param y Global Y speed * @param y Global Y speed
* @param z Global Z speed * @param z Global Z speed
@@ -154,7 +154,7 @@ static inline void mavlink_msg_vision_speed_estimate_send(mavlink_channel_t chan
/** /**
* @brief Get field usec from vision_speed_estimate message * @brief Get field usec from vision_speed_estimate message
* *
* @return Timestamp (milliseconds) * @return Timestamp (microseconds, synced to UNIX time or since system boot)
*/ */
static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg) static inline uint64_t mavlink_msg_vision_speed_estimate_get_usec(const mavlink_message_t* msg)
{ {
@@ -3735,10 +3735,11 @@ static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, ma
353.0, 353.0,
381.0, 381.0,
409.0, 409.0,
20355,
}; };
mavlink_highres_imu_t packet1, packet2; mavlink_highres_imu_t packet1, packet2;
memset(&packet1, 0, sizeof(packet1)); memset(&packet1, 0, sizeof(packet1));
packet1.time_boot_ms = packet_in.time_boot_ms; packet1.time_usec = packet_in.time_usec;
packet1.xacc = packet_in.xacc; packet1.xacc = packet_in.xacc;
packet1.yacc = packet_in.yacc; packet1.yacc = packet_in.yacc;
packet1.zacc = packet_in.zacc; packet1.zacc = packet_in.zacc;
@@ -3752,6 +3753,7 @@ static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, ma
packet1.diff_pressure = packet_in.diff_pressure; packet1.diff_pressure = packet_in.diff_pressure;
packet1.pressure_alt = packet_in.pressure_alt; packet1.pressure_alt = packet_in.pressure_alt;
packet1.temperature = packet_in.temperature; packet1.temperature = packet_in.temperature;
packet1.fields_updated = packet_in.fields_updated;
@@ -3761,12 +3763,12 @@ static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, ma
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2)); memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature ); mavlink_msg_highres_imu_pack(system_id, component_id, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
mavlink_msg_highres_imu_decode(&msg, &packet2); mavlink_msg_highres_imu_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2)); memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature ); mavlink_msg_highres_imu_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
mavlink_msg_highres_imu_decode(&msg, &packet2); mavlink_msg_highres_imu_decode(&msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
@@ -3779,7 +3781,7 @@ static void mavlink_test_highres_imu(uint8_t system_id, uint8_t component_id, ma
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
memset(&packet2, 0, sizeof(packet2)); memset(&packet2, 0, sizeof(packet2));
mavlink_msg_highres_imu_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature ); mavlink_msg_highres_imu_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.xmag , packet1.ymag , packet1.zmag , packet1.abs_pressure , packet1.diff_pressure , packet1.pressure_alt , packet1.temperature , packet1.fields_updated );
mavlink_msg_highres_imu_decode(last_msg, &packet2); mavlink_msg_highres_imu_decode(last_msg, &packet2);
MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
} }
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H #ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H #define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Sep 3 14:56:15 2012" #define MAVLINK_BUILD_DATE "Thu Sep 6 15:30:32 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H #ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H #define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Thu Aug 23 16:39:29 2012" #define MAVLINK_BUILD_DATE "Thu Sep 6 15:30:21 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
@@ -12,11 +12,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS // MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS #ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 52, 1, 92, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 26, 16, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 0, 0, 0, 0, 0, 0, 106, 43, 55, 12, 255, 53, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0} #define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 52, 1, 92, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 26, 16, 0, 0, 0, 0, 0, 0, 0, 4, 255, 12, 6, 0, 0, 0, 0, 0, 0, 106, 43, 55, 12, 255, 53, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_CRCS #ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 86, 95, 224, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 249, 182, 0, 0, 0, 0, 0, 0, 0, 153, 16, 29, 162, 0, 0, 0, 0, 0, 0, 90, 95, 36, 23, 223, 88, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0} #define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 108, 86, 95, 224, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 249, 182, 0, 0, 0, 0, 0, 0, 0, 153, 16, 29, 162, 0, 0, 0, 0, 0, 0, 90, 95, 36, 23, 223, 88, 0, 0, 0, 0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_INFO #ifndef MAVLINK_MESSAGE_INFO
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H #ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H #define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Sep 3 14:56:05 2012" #define MAVLINK_BUILD_DATE "Thu Sep 6 15:30:14 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 255
@@ -12,11 +12,11 @@ extern "C" {
// MESSAGE LENGTHS AND CRCS // MESSAGE LENGTHS AND CRCS
#ifndef MAVLINK_MESSAGE_LENGTHS #ifndef MAVLINK_MESSAGE_LENGTHS
#define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 0, 32, 0, 12, 0, 12, 0, 24, 0, 4, 4, 12, 0, 12, 0, 20, 0, 4, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0} #define MAVLINK_MESSAGE_LENGTHS {9, 31, 12, 0, 14, 28, 3, 32, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 20, 2, 25, 23, 30, 101, 22, 26, 16, 14, 28, 32, 28, 28, 22, 22, 21, 6, 6, 37, 4, 4, 2, 2, 4, 2, 2, 3, 13, 12, 19, 17, 15, 15, 27, 25, 18, 18, 20, 20, 9, 34, 26, 46, 36, 0, 6, 4, 0, 21, 18, 0, 0, 0, 20, 0, 33, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 56, 42, 33, 0, 0, 0, 0, 0, 0, 0, 26, 32, 32, 20, 32, 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 12, 0, 32, 0, 12, 0, 12, 0, 24, 0, 4, 4, 12, 0, 12, 0, 20, 0, 4, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 30, 18, 18, 51, 9, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_CRCS #ifndef MAVLINK_MESSAGE_CRCS
#define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 108, 0, 146, 0, 16, 0, 32, 0, 159, 0, 24, 248, 79, 0, 5, 0, 170, 0, 157, 0, 209, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0} #define MAVLINK_MESSAGE_CRCS {50, 124, 137, 0, 237, 217, 104, 119, 0, 0, 0, 89, 0, 0, 0, 0, 0, 0, 0, 0, 214, 159, 220, 168, 24, 23, 170, 144, 67, 115, 39, 246, 185, 104, 237, 244, 222, 212, 9, 254, 230, 28, 28, 132, 221, 232, 11, 153, 41, 39, 214, 223, 141, 33, 15, 3, 100, 24, 239, 238, 30, 240, 183, 130, 130, 0, 148, 21, 0, 52, 124, 0, 0, 0, 20, 0, 152, 143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 231, 183, 63, 54, 0, 0, 0, 0, 0, 0, 0, 175, 102, 158, 208, 56, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 108, 0, 146, 0, 16, 0, 32, 0, 159, 0, 24, 248, 79, 0, 5, 0, 170, 0, 157, 0, 209, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 204, 49, 170, 44, 83, 46, 0}
#endif #endif
#ifndef MAVLINK_MESSAGE_INFO #ifndef MAVLINK_MESSAGE_INFO
@@ -5,7 +5,7 @@
#ifndef MAVLINK_VERSION_H #ifndef MAVLINK_VERSION_H
#define MAVLINK_VERSION_H #define MAVLINK_VERSION_H
#define MAVLINK_BUILD_DATE "Mon Sep 3 14:56:15 2012" #define MAVLINK_BUILD_DATE "Thu Sep 6 15:30:32 2012"
#define MAVLINK_WIRE_PROTOCOL_VERSION "1.0" #define MAVLINK_WIRE_PROTOCOL_VERSION "1.0"
#define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101 #define MAVLINK_MAX_DIALECT_PAYLOAD_SIZE 101
+7
View File
@@ -1835,6 +1835,13 @@ void up_serialinit(void)
#if CONSOLE_UART > 0 #if CONSOLE_UART > 0
(void)uart_register("/dev/console", &uart_devs[CONSOLE_UART - 1]->dev); (void)uart_register("/dev/console", &uart_devs[CONSOLE_UART - 1]->dev);
(void)uart_register("/dev/ttyS0", &uart_devs[CONSOLE_UART - 1]->dev); (void)uart_register("/dev/ttyS0", &uart_devs[CONSOLE_UART - 1]->dev);
/* If we need to re-initialise the console (e.g. to enable DMA) do that here. */
# if CONFIG_SERIAL_CONSOLE_REINIT
uart_devs[CONSOLE_UART - 1]->dev.ops->setup(&uart_devs[CONSOLE_UART - 1]->dev);
# endif
#endif #endif
/* Register all remaining USARTs */ /* Register all remaining USARTs */
+5 -1
View File
@@ -221,6 +221,9 @@ CONFIG_AT24XX_MTD_BLOCKSIZE=256
# tcflush, etc.). If this is not defined, then the terminal settings (baud, # tcflush, etc.). If this is not defined, then the terminal settings (baud,
# parity, etc.) are not configurable at runtime; serial streams cannot be # parity, etc.) are not configurable at runtime; serial streams cannot be
# flushed, etc. # flushed, etc.
# CONFIG_SERIAL_CONSOLE_REINIT - re-initializes the console serial port
# immediately after creating the /dev/console device. This is required
# if the console serial port has RX DMA enabled.
# #
# CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the # CONFIG_USARTn_SERIAL_CONSOLE - selects the USARTn for the
# console and ttys0 (default is the USART1). # console and ttys0 (default is the USART1).
@@ -234,6 +237,7 @@ CONFIG_AT24XX_MTD_BLOCKSIZE=256
# CONFIG_USARTn_2STOP - Two stop bits # CONFIG_USARTn_2STOP - Two stop bits
# #
CONFIG_SERIAL_TERMIOS=y CONFIG_SERIAL_TERMIOS=y
CONFIG_SERIAL_CONSOLE_REINIT=y
CONFIG_USART1_SERIAL_CONSOLE=y CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USART2_SERIAL_CONSOLE=n CONFIG_USART2_SERIAL_CONSOLE=n
@@ -285,7 +289,7 @@ CONFIG_USART4_2STOP=0
CONFIG_USART5_2STOP=0 CONFIG_USART5_2STOP=0
CONFIG_USART6_2STOP=0 CONFIG_USART6_2STOP=0
CONFIG_USART1_RXDMA=n CONFIG_USART1_RXDMA=y
CONFIG_USART2_RXDMA=y CONFIG_USART2_RXDMA=y
CONFIG_USART3_RXDMA=n CONFIG_USART3_RXDMA=n
CONFIG_USART4_RXDMA=n CONFIG_USART4_RXDMA=n