Skip to content

Commit

Permalink
GCS_MAVLink: add support for AIRSPEED message
Browse files Browse the repository at this point in the history
  • Loading branch information
IamPete1 committed May 1, 2023
1 parent bd84a7c commit 72c2709
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions libraries/GCS_MAVLink/GCS_Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,9 @@ ap_message GCS_MAVLINK::mavlink_id_to_ap_message_id(const uint32_t mavlink_id) c
#endif
#if HAL_ADSB_ENABLED
{ MAVLINK_MSG_ID_UAVIONIX_ADSB_OUT_STATUS, MSG_UAVIONIX_ADSB_OUT_STATUS},
#endif
#if AP_AIRSPEED_ENABLED
{ MAVLINK_MSG_ID_AIRSPEED, MSG_AIRSPEED},
#endif
};

Expand Down Expand Up @@ -5753,6 +5756,17 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id)
send_scaled_pressure3();
break;

#if AP_AIRSPEED_ENABLED
case MSG_AIRSPEED:
{
AP_Airspeed *airspeed = AP_Airspeed::get_singleton();
if (airspeed != nullptr) {
airspeed->send_mavlink_airspeed(*this);
}
}
break;
#endif

case MSG_SERVO_OUTPUT_RAW:
CHECK_PAYLOAD_SIZE(SERVO_OUTPUT_RAW);
send_servo_output_raw();
Expand Down
1 change: 1 addition & 0 deletions libraries/GCS_MAVLink/ap_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@ enum ap_message : uint8_t {
MSG_ATTITUDE_TARGET,
MSG_HYGROMETER,
MSG_AUTOPILOT_STATE_FOR_GIMBAL_DEVICE,
MSG_AIRSPEED,
MSG_LAST // MSG_LAST must be the last entry in this enum
};

0 comments on commit 72c2709

Please sign in to comment.