Engee documentation

MAVLINK RX

Page in progress.

Receiving MAVLink messages.

blockType: EngeeFunction

Path in the library:

/Interfaces/MAVLink/MAVLINK RX

Description

To work with the block, install/update the support package. equipment.

Block MAVLINK RX accepts MAVLink messages via a shared connection created by the block MAVLINK Setup (the descriptor is fed to the input conn), and lays them out on the output buses.

The block works in streaming mode: after connection, it continuously reads the MAVLink message stream, and at each calculation step it takes a fresh snapshot of the message buffer from the queue (the last received message of each type) and outputs its values to the output buses. If there is no new data in the snapshot for a particular message (no messages have been received for it since the previous step), the fields of its bus store the values from the last received message, and this is visible on the bus Message status — the corresponding flag is equal to false (for more information, see Message status). The block does not store past values between steps: if there is not a single snapshot in the queue at the calculation step, all buses are issued zero, and all flags are equal false. If the message from the array has never arrived yet, all fields of its bus are zero

The set of received messages is set by an array of names in the parameter MAVLink сообщения на приём:. For each name from the array, the block automatically deploys an output bus with a pre—prepared composition of the fields of this message - the name of the output port matches the name of the message, and the composition of the fields is given on the page MAVLink Messages. Additionally, the Message status bus is always output to the output.

Message status

Additional output Message status — bus of logical flags, one flag for each message from the array MAVLink сообщения на приём:. The flag indicates whether the data is up to date for the current calculation step:

  • true — at this step, new data was received for a specific message (including the first time it was received);

  • false — there was no new data at this step: the message bus fields contain values from the last snapshot of the buffer (or zeros if there was no snapshot at this step or the message has never arrived yet).

It is convenient to use the status bus to detect telemetry updates: for example, to start data processing only upon the arrival of a fresh packet, without comparing the field values manually.

Ports

The composition of the output ports is determined by the array MAVLink сообщения на приём:. For by default configuration, the block outputs are as follows: SIMSTATE, GLOBAL_POSITION_INT, HEARTBEAT, EKF_STATUS_REPORT.

The tire field compositions described below correspond by default. If you specify other messages in the block parameter, the buses of these messages will be deployed instead. The port Message status is saved for any configuration of the block, and the composition of its fields depends on the specified array: it always contains one flag for each message from the array. Descriptions of messages and their fields are given in the dialect documentation common and ardupilotmega, as well as on the page MAVLink Messages.

Input

# conn — MAVLink connection descriptor
scalar

Details
Data types

Float64

Complex numbers support

No

Output

# SIMSTATE — the state of the autopilot simulation environment
the tire

Details
Data types

BusSignal

Complex numbers support

No

# GLOBAL_POSITION_INT — filtered global position
the tire

Details
Data types

BusSignal

Complex numbers support

No

# HEARTBEAT — system or component status
the tire

Details
Data types

BusSignal

Complex numbers support

No

# EKF_STATUS_REPORT — status of the extended Kalman Filter (EKF)
the tire

Details
Data types

BusSignal

Complex numbers support

No

# Message status — the bus of logical flags for receiving messages
the tire

Details
Data types

BusSignal

Complex numbers support

No

Parameters

Main group

# MAVLink сообщения на приём: — array of names of received messages

Details
Default value

["SIMSTATE",  "GLOBAL_POSITION_INT", "HEARTBEAT", "EKF_STATUS_REPORT"]

Program usage name

m_rcv_messages

Tunable

No

Evaluatable

Yes

# Шаг расчёта, с: — the block calculation step for receiving MAVLink messages

Details
Default value

-1

Program usage name

m_sample_time

Tunable

No

Evaluatable

Yes