Main Content

readmsg

Read specific messages from TLOG file

Description

example

msgTable = readmsg(tlogReader) reads all message data from the specified mavlinkdialect object and returns a table, msgTable, that contains all the messages separated by message type, system ID, and component ID.

msgTable = readmsg(tlogReader,Name,Value) reads specific messages based on the specified name-value pairs for filtering specific properties of the messages. You can filter by message name, system ID, component ID, and time.

Examples

collapse all

This example shows how to load a MAVLink TLOG file and select a specific message type.

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');

Input Arguments

collapse all

MAVLink TLOG reader, specified as a mavlinktlog object.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: 'MessageID',22

Name of message in TLOG, specified as string scalar or character vector.

Data Types: char | string

MAVLink system ID, specified as a positive integer from 1 through 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.

MAVLink system ID, specified as a positive integer from 1 through 255.

Time interval between which to select messages, specified as a two-element vector in seconds.

Output Arguments

collapse all

Table of messages with columns:

  • MessageID

  • MessageName

  • ComponentID

  • SystemID

  • Messages

Each row of Messages is a timetable containing the message Payload and the associated timestamp.

Version History

Introduced in R2019a