Tracker: request baro pressure from vehicle at 1hz

This commit is contained in:
Randy Mackay 2015-12-23 11:51:16 +09:00
parent 86bb03aa79
commit 9fda13d965

View File

@ -540,6 +540,7 @@ void Tracker::mavlink_check_target(const mavlink_message_t* msg)
// Note: this doesn't check success for all sends meaning it's not guaranteed the vehicle's positions will be sent at 1hz
for (uint8_t i=0; i < num_gcs; i++) {
if (gcs[i].initialised) {
// request position
if (comm_get_txspace((mavlink_channel_t)i) - MAVLINK_NUM_NON_PAYLOAD_BYTES >= MAVLINK_MSG_ID_DATA_STREAM_LEN) {
mavlink_msg_request_data_stream_send(
(mavlink_channel_t)i,
@ -549,6 +550,16 @@ void Tracker::mavlink_check_target(const mavlink_message_t* msg)
1, // 1hz
1); // start streaming
}
// request air pressure
if (comm_get_txspace((mavlink_channel_t)i) - MAVLINK_NUM_NON_PAYLOAD_BYTES >= MAVLINK_MSG_ID_DATA_STREAM_LEN) {
mavlink_msg_request_data_stream_send(
(mavlink_channel_t)i,
msg->sysid,
msg->compid,
MAV_DATA_STREAM_RAW_SENSORS,
1, // 1hz
1); // start streaming
}
}
}