Main Content

mavlinkclient

MAVLink client information

Description

The mavlinkclient object stores MAVLink client information for connecting to UAVs (unmanned aerial vehicles) that utilize the MAVLink communication protocol. Connect with a MAVLink client using mavlinkio and use this object for saving the component and system information.

Creation

Description

example

client = mavlinkclient(mavlink,sysID,compID) creates a MAVLink client interface for a MAVLink component. Connect to a MAVLink client using mavlinkio and specify the object in mavlink. When a heartbeat is received by the client, the ComponentType and AutoPilotType properties are updated automatically. Specify the SystemID and ComponentID as integers.

Properties

expand all

MAVLink system ID, specified as a positive integer between 1 and 255. MAVLink protocol only supports up to 255 systems. Usually, each UAV has its own system ID, but multiple UAVs could be considered one system.

Example: 1

Data Types: uint8

MAVLink component ID, specified as a positive integer between 1 and 255.

Example: 2

Data Types: uint8

MAVLink component type, specified as a string. This value is automatically updated to the correct type if a heartbeat message is received by the client with the matching system ID and component ID. You must be connected to a client using mavlinkio.

Example: "MAV_TYPE_GCS"

Data Types: string

Autopilot type for UAV, specified as a string. This value is automatically updated to the correct type if a heartbeat message is received by the client with the matching system ID and component ID. You must be connected to a client using mavlinkio.

Example: "MAV_AUTOPILOT_INVALID"

Data Types: string

Examples

collapse all

Connect to a MAVLink client.

mavlink = mavlinkio("common.xml");
connect(mavlink,"UDP");

Create the object for storing the client information. Specify the system and component ID.

client = mavlinkclient(mavlink,1,1)
client = 
  mavlinkclient with properties:

         SystemID: 1
      ComponentID: 1
    ComponentType: "Unknown"
    AutopilotType: "Unknown"

Disconnect from client.

disconnect(mavlink)

Version History

Introduced in R2019a