diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-09-07 12:49:31 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-09-07 12:49:31 +0200 |
commit | 1538247a72f37a2f969aa5c41f7a07da4ae31d35 (patch) | |
tree | 53a53c88e2f1d7150af9f6670eac326e37bb98c0 /apps | |
parent | 5066ce1e9132f94bfcabaee3e16c3d9aac4801e8 (diff) | |
download | px4-firmware-1538247a72f37a2f969aa5c41f7a07da4ae31d35.tar.gz px4-firmware-1538247a72f37a2f969aa5c41f7a07da4ae31d35.tar.bz2 px4-firmware-1538247a72f37a2f969aa5c41f7a07da4ae31d35.zip |
Sensor sending rate fixes
Diffstat (limited to 'apps')
-rw-r--r-- | apps/mavlink/mavlink.c | 10 | ||||
-rw-r--r-- | apps/sensors/sensors.cpp | 10 |
2 files changed, 15 insertions, 5 deletions
diff --git a/apps/mavlink/mavlink.c b/apps/mavlink/mavlink.c index 0df881339..7289bd7a8 100644 --- a/apps/mavlink/mavlink.c +++ b/apps/mavlink/mavlink.c @@ -1550,8 +1550,8 @@ int mavlink_thread_main(int argc, char *argv[]) /* all subscriptions are now active, set up initial guess about rate limits */ if (baudrate >= 921600) { - /* 500 Hz / 2 ms */ - set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 2); + /* 200 Hz / 5 ms */ + set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 5); /* 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_NAMED_VALUE_FLOAT, 5); @@ -1561,11 +1561,11 @@ int mavlink_thread_main(int argc, char *argv[]) set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_MANUAL_CONTROL, 200); } else if (baudrate >= 460800) { /* 200 Hz / 5 ms */ - set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 10); - /* 100 Hz / 10 ms */ + set_mavlink_interval_limit(&mavlink_subs, MAVLINK_MSG_ID_HIGHRES_IMU, 5); + /* 50 Hz / 10 ms */ 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 / 20 ms */ + /* 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 */ diff --git a/apps/sensors/sensors.cpp b/apps/sensors/sensors.cpp index 217b05e9d..963c54b8e 100644 --- a/apps/sensors/sensors.cpp +++ b/apps/sensors/sensors.cpp @@ -696,6 +696,16 @@ Sensors::gyro_poll(struct sensor_combined_s &raw) 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; + 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++; + } else { bool gyro_updated; |