mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 02:53:34 +08:00
Merge branch 'master' into px4dev_new_param
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user