diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-04-27 14:26:49 +0200 |
---|---|---|
committer | Roman Bapst <romanbapst@yahoo.de> | 2015-05-04 12:32:22 +0200 |
commit | d874ecf6ec223e322ba1a591af8cd6f1623ea675 (patch) | |
tree | f53e2017fb7df3aedd4d672de36d1201a34e3089 | |
parent | 0b5e6bdf9755cf530bf425b0b77db2c5374a279c (diff) | |
download | px4-firmware-d874ecf6ec223e322ba1a591af8cd6f1623ea675.tar.gz px4-firmware-d874ecf6ec223e322ba1a591af8cd6f1623ea675.tar.bz2 px4-firmware-d874ecf6ec223e322ba1a591af8cd6f1623ea675.zip |
commander: Use pre-rotated topic in board framecal_orientation_fix
-rw-r--r-- | src/modules/commander/calibration_routines.cpp | 14 | ||||
-rw-r--r-- | src/modules/commander/commander.cpp | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/commander/calibration_routines.cpp b/src/modules/commander/calibration_routines.cpp index 7e8c0fa52..e854c9aa7 100644 --- a/src/modules/commander/calibration_routines.cpp +++ b/src/modules/commander/calibration_routines.cpp @@ -43,12 +43,12 @@ #include <float.h> #include <poll.h> #include <drivers/drv_hrt.h> -#include <drivers/drv_accel.h> #include <mavlink/mavlink_log.h> #include <geo/geo.h> #include <string.h> #include <uORB/topics/vehicle_command.h> +#include <uORB/topics/sensor_combined.h> #include "calibration_routines.h" #include "calibration_messages.h" @@ -236,7 +236,7 @@ enum detect_orientation_return detect_orientation(int mavlink_fd, int cancel_sub { const unsigned ndim = 3; - struct accel_report sensor; + struct sensor_combined_s sensor; float accel_ema[ndim] = { 0.0f }; // exponential moving average of accel float accel_disp[3] = { 0.0f, 0.0f, 0.0f }; // max-hold dispersion of accel float ema_len = 0.5f; // EMA time constant in seconds @@ -264,7 +264,7 @@ enum detect_orientation_return detect_orientation(int mavlink_fd, int cancel_sub int poll_ret = poll(fds, 1, 1000); if (poll_ret) { - orb_copy(ORB_ID(sensor_accel), accel_sub, &sensor); + orb_copy(ORB_ID(sensor_combined), accel_sub, &sensor); t = hrt_absolute_time(); float dt = (t - t_prev) / 1000000.0f; t_prev = t; @@ -275,13 +275,13 @@ enum detect_orientation_return detect_orientation(int mavlink_fd, int cancel_sub float di = 0.0f; switch (i) { case 0: - di = sensor.x; + di = sensor.accelerometer_m_s2[0]; break; case 1: - di = sensor.y; + di = sensor.accelerometer_m_s2[1]; break; case 2: - di = sensor.z; + di = sensor.accelerometer_m_s2[2]; break; } @@ -410,7 +410,7 @@ calibrate_return calibrate_from_orientation(int mavlink_fd, // Setup subscriptions to onboard accel sensor - int sub_accel = orb_subscribe_multi(ORB_ID(sensor_accel), 0); + int sub_accel = orb_subscribe(ORB_ID(sensor_combined)); if (sub_accel < 0) { mavlink_and_console_log_critical(mavlink_fd, CAL_QGC_FAILED_MSG, "No onboard accel"); return calibrate_return_error; diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 7aaf5e5cd..3308acb8e 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -1159,7 +1159,7 @@ int commander_thread_main(int argc, char *argv[]) /* initialize low priority thread */ pthread_attr_t commander_low_prio_attr; pthread_attr_init(&commander_low_prio_attr); - pthread_attr_setstacksize(&commander_low_prio_attr, 2000); + pthread_attr_setstacksize(&commander_low_prio_attr, 2600); struct sched_param param; (void)pthread_attr_getschedparam(&commander_low_prio_attr, ¶m); |