This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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.

Note

This object requires you to install the UAV Library for Robotics System Toolbox™. To install add-ons, use roboticsAddons and select the desired add-on.

Creation

Syntax

client = mavlinkclient(mavlink,sysID,compID)

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

NOTE: This example requires you to install the UAV Library for Robotics System Toolbox®. Call roboticsAddons to open the Add-ons Explorer and install the library.

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)

Introduced in R2019a