消息解析

This commit is contained in:
hm
2020-10-08 16:13:38 +08:00
parent 88019cd149
commit 1944dac45a
6 changed files with 1059 additions and 394 deletions
+5 -22
View File
@@ -430,28 +430,6 @@ void MavLinkNode::MAVLinkRcv_Handler(mavlink_message_t msg)
vehicle.compid = msg.compid;
switch (msg.msgid) {
//状态
case MAVLINK_MSG_ID_AUTOPILOT_VERSION:
case MAVLINK_MSG_ID_SYS_STATUS:
case MAVLINK_MSG_ID_HEARTBEAT:
case MAVLINK_MSG_ID_PING:
case MAVLINK_MSG_ID_ATTITUDE:
case MAVLINK_MSG_ID_GPS_RAW_INT:
case MAVLINK_MSG_ID_GLOBAL_POSITION_INT:
case MAVLINK_MSG_ID_SERVO_OUTPUT_RAW:
case MAVLINK_MSG_ID_RC_CHANNELS_RAW:
case MAVLINK_MSG_ID_NAV_CONTROLLER_OUTPUT:
case MAVLINK_MSG_ID_AIRSPEED_AUTOCAL:
case MAVLINK_MSG_ID_RPM:
case MAVLINK_MSG_ID_SCALED_PRESSURE:
case MAVLINK_MSG_ID_EXTENDED_SYS_STATE:
case MAVLINK_MSG_ID_BATTERY_STATUS:
case MAVLINK_MSG_ID_VIBRATION:
case MAVLINK_MSG_ID_EngineState:
case MAVLINK_MSG_ID_VFR_HUD:
StatusParse(msg);
break;
//航线部分
case MAVLINK_MSG_ID_MISSION_REQUEST_LIST:
case MAVLINK_MSG_ID_MISSION_COUNT:
@@ -484,6 +462,11 @@ void MavLinkNode::MAVLinkRcv_Handler(mavlink_message_t msg)
Commander->Parse(msg);
break;
//状态
default:
StatusParse(msg);
break;
}
}