Main Content

mavlinktlog

Read MAVLink message from TLOG file

Description

Themavlinktlogobject reads all messages from a telemetry log or TLOG file (.tlog). The object gives you information about the file, including the start and end time, number of messages, available topics, and packet loss percentage. You can specify a MAVLink dialect for parsing the messages or use thecommon.xmldialect.

Creation

Description

example

tlogReader = mavlinktlog(filePath)reads all messages from the tlog file at the given file path and returns an object summarizing the file. This syntax uses thecommon.xmldialect for the MAVLink protocol (Version 2.0) for parsing the messages. The information infilePathis used to set theFileNameproperty.

tlogReader = mavlinktlog(filePath,dialect)reads the MAVLink messages based on the dialect specified as amavlinkdialectobject or string scalar specifying the XML file path.dialectsets theDialectproperty.

Properties

expand all

This property is read-only.

Name of the TLOG file, specified as a string scalar or character vector. The name is the last part of the path given in thefilePathinput.

Example:'flightlog.tlog'

Data Types:string|char

This property is read-only.

MAVLink dialect used for parsing the message data, specified as amavlinkdialectobject.

This property is read-only.

Time of the first message recorded in the TLOG file, specified as adatetimeobject.

Data Types:datetime

This property is read-only.

Time of the last message recorded in the TLOG file, specified as adatetimeobject.

Data Types:datetime

This property is read-only.

Number of MAVLink messages in the TLOG file, specified as a numeric scalar.

Data Types:double

This property is read-only.

List of different messages, specified as a table that contains:

  • MessageID

  • MessageName

  • SystemID

  • ComponentID

  • NumMessages

Data Types:table

This property is read-only.

Percentage of packets lost, specified as a numeric scalar from 0 through 100.

Data Types:double

Object Functions

readmsg Read specific messages from TLOG file

Examples

collapse all

Load the TLOG file. Specify the relative path of the file name.

tlogReader = mavlinktlog('flight.tlog');

Read the'REQUEST_DATA_STREAM'messages from the file.

msgData = readmsg(result,'MessageName','REQUEST_DATA_STREAM');
Introduced in R2019a