diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-20 13:16:09 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2012-08-20 13:16:09 +0200 |
commit | e3fffa23e0665f2e9ce58cdf9035134785124f62 (patch) | |
tree | bc980876795c7901db506cbad2010ea7a6014148 /apps/mavlink/mavlink.c | |
parent | f20c61ccdf1109b70c4ec145ed5fe7bf4589bde6 (diff) | |
parent | 78db6c990b609a773b2bb1eb0e1d979e77933ced (diff) | |
download | px4-firmware-e3fffa23e0665f2e9ce58cdf9035134785124f62.tar.gz px4-firmware-e3fffa23e0665f2e9ce58cdf9035134785124f62.tar.bz2 px4-firmware-e3fffa23e0665f2e9ce58cdf9035134785124f62.zip |
Merge branch 'master' into px4dev_new_param
Diffstat (limited to 'apps/mavlink/mavlink.c')
-rw-r--r-- | apps/mavlink/mavlink.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/apps/mavlink/mavlink.c b/apps/mavlink/mavlink.c index 1ac3f907a..653a41090 100644 --- a/apps/mavlink/mavlink.c +++ b/apps/mavlink/mavlink.c @@ -474,7 +474,7 @@ static int set_mavlink_interval_limit(int mavlink_msg_id, int min_interval) break; case MAVLINK_MSG_ID_ATTITUDE: /* attitude sub triggers attitude */ - orb_set_interval(att_sub, 100); + orb_set_interval(att_sub, min_interval); break; default: /* not found */ @@ -527,6 +527,7 @@ static void *uorb_receiveloop(void *arg) /* --- ATTITUDE VALUE --- */ /* subscribe to ORB for attitude */ att_sub = orb_subscribe(ORB_ID(vehicle_attitude)); + orb_set_interval(att_sub, 100); fds[fdsc_count].fd = att_sub; fds[fdsc_count].events = POLLIN; fdsc_count++; @@ -1324,17 +1325,17 @@ int mavlink_thread_main(int argc, char *argv[]) /* all subscriptions are now active, set up initial guess about rate limits */ if (baudrate >= 921600) { - /* set no limit */ /* 500 Hz / 2 ms */ - //set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 2); + set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 2); + set_mavlink_interval_limit(MAVLINK_MSG_ID_ATTITUDE, 2); } else if (baudrate >= 460800) { /* 250 Hz / 4 ms */ - set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 4); - set_mavlink_interval_limit(MAVLINK_MSG_ID_ATTITUDE, 4); + set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 5); + set_mavlink_interval_limit(MAVLINK_MSG_ID_ATTITUDE, 5); } else if (baudrate >= 115200) { /* 50 Hz / 20 ms */ - set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 20); - set_mavlink_interval_limit(MAVLINK_MSG_ID_ATTITUDE, 20); + set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 50); + set_mavlink_interval_limit(MAVLINK_MSG_ID_ATTITUDE, 50); } else if (baudrate >= 57600) { /* 10 Hz / 100 ms */ set_mavlink_interval_limit(MAVLINK_MSG_ID_SCALED_IMU, 100); |