@@ -1521,15 +1521,20 @@ Mavlink::update_rate_mult()
15211521 MavlinkStream *stream;
15221522 LL_FOREACH (_streams, stream) {
15231523 if (stream->const_rate ()) {
1524- const_rate += stream->get_size () * 1000000 .0f / stream->get_interval ();
1524+ const_rate += ( stream->get_interval () > 0 ) ? stream-> get_size_avg () * 1000000 .0f / stream->get_interval () : 0 ;
15251525
15261526 } else {
1527- rate += stream->get_size () * 1000000 .0f / stream->get_interval ();
1527+ rate += ( stream->get_interval () > 0 ) ? stream-> get_size_avg () * 1000000 .0f / stream->get_interval () : 0 ;
15281528 }
15291529 }
15301530
1531- /* don't scale up rates, only scale down if needed */
1532- float bandwidth_mult = fminf (1 .0f , ((float )_datarate - const_rate) / rate);
1531+ /* scale up and down as the link permits */
1532+ float bandwidth_mult = (float )(_datarate - const_rate) / rate;
1533+
1534+ /* if we do not have flow control, limit to the set data rate */
1535+ if (!get_flow_control_enabled ()) {
1536+ bandwidth_mult = fminf (1 .0f , bandwidth_mult);
1537+ }
15331538
15341539 /* check if we have radio feedback */
15351540 struct telemetry_status_s &tstatus = get_rx_status ();
@@ -1852,26 +1857,26 @@ Mavlink::task_main(int argc, char *argv[])
18521857 case MAVLINK_MODE_NORMAL:
18531858 configure_stream (" SYS_STATUS" , 1 .0f );
18541859 configure_stream (" EXTENDED_SYS_STATE" , 1 .0f );
1855- configure_stream (" HIGHRES_IMU" , 2 . 0f );
1860+ configure_stream (" HIGHRES_IMU" , 1 . 5f );
18561861 configure_stream (" ATTITUDE" , 20 .0f );
1857- configure_stream (" RC_CHANNELS" , 1 .0f );
1862+ configure_stream (" RC_CHANNELS" , 5 .0f );
18581863 configure_stream (" SERVO_OUTPUT_RAW_0" , 1 .0f );
18591864 configure_stream (" ALTITUDE" , 1 .0f );
18601865 configure_stream (" GPS_RAW_INT" , 1 .0f );
18611866 configure_stream (" ADSB_VEHICLE" , 2 .0f );
18621867 configure_stream (" DISTANCE_SENSOR" , 0 .5f );
1863- configure_stream (" OPTICAL_FLOW_RAD" , 5 .0f );
1864- configure_stream (" VISION_POSITION_NED" , 10 .0f );
1868+ configure_stream (" OPTICAL_FLOW_RAD" , 1 .0f );
1869+ configure_stream (" VISION_POSITION_NED" , 1 .0f );
18651870 configure_stream (" ESTIMATOR_STATUS" , 0 .5f );
1866- configure_stream (" NAV_CONTROLLER_OUTPUT" , 2 . 0f );
1867- configure_stream (" GLOBAL_POSITION_INT" , 3 .0f );
1868- configure_stream (" LOCAL_POSITION_NED" , 3 .0f );
1869- configure_stream (" POSITION_TARGET_GLOBAL_INT" , 3 . 0f );
1870- configure_stream (" ATTITUDE_TARGET" , 8 .0f );
1871+ configure_stream (" NAV_CONTROLLER_OUTPUT" , 1 . 5f );
1872+ configure_stream (" GLOBAL_POSITION_INT" , 5 .0f );
1873+ configure_stream (" LOCAL_POSITION_NED" , 1 .0f );
1874+ configure_stream (" POSITION_TARGET_GLOBAL_INT" , 1 . 5f );
1875+ configure_stream (" ATTITUDE_TARGET" , 2 .0f );
18711876 configure_stream (" HOME_POSITION" , 0 .5f );
18721877 configure_stream (" NAMED_VALUE_FLOAT" , 1 .0f );
1873- configure_stream (" VFR_HUD" , 8 .0f );
1874- configure_stream (" WIND " , 2 .0f );
1878+ configure_stream (" VFR_HUD" , 4 .0f );
1879+ configure_stream (" WIND_COV " , 1 .0f );
18751880 break ;
18761881
18771882 case MAVLINK_MODE_ONBOARD:
@@ -1896,7 +1901,7 @@ Mavlink::task_main(int argc, char *argv[])
18961901 configure_stream (" HOME_POSITION" , 0 .5f );
18971902 configure_stream (" NAMED_VALUE_FLOAT" , 10 .0f );
18981903 configure_stream (" VFR_HUD" , 10 .0f );
1899- configure_stream (" WIND " , 10 .0f );
1904+ configure_stream (" WIND_COV " , 10 .0f );
19001905 configure_stream (" POSITION_TARGET_LOCAL_NED" , 10 .0f );
19011906 configure_stream (" SYSTEM_TIME" , 1 .0f );
19021907 configure_stream (" TIMESYNC" , 10 .0f );
@@ -1919,7 +1924,7 @@ Mavlink::task_main(int argc, char *argv[])
19191924 configure_stream (" ATTITUDE_TARGET" , 10 .0f );
19201925 configure_stream (" HOME_POSITION" , 0 .5f );
19211926 configure_stream (" VFR_HUD" , 25 .0f );
1922- configure_stream (" WIND " , 2 .0f );
1927+ configure_stream (" WIND_COV " , 2 .0f );
19231928 configure_stream (" SYSTEM_TIME" , 1 .0f );
19241929 break ;
19251930
@@ -1951,7 +1956,7 @@ Mavlink::task_main(int argc, char *argv[])
19511956 configure_stream (" HOME_POSITION" , 0 .5f );
19521957 configure_stream (" NAMED_VALUE_FLOAT" , 50 .0f );
19531958 configure_stream (" VFR_HUD" , 20 .0f );
1954- configure_stream (" WIND " , 10 .0f );
1959+ configure_stream (" WIND_COV " , 10 .0f );
19551960 configure_stream (" CAMERA_TRIGGER" , 500 .0f );
19561961 configure_stream (" MISSION_ITEM" , 50 .0f );
19571962 configure_stream (" ACTUATOR_CONTROL_TARGET0" , 30 .0f );
0 commit comments