Main Content

MAVLink Bridge Source

Read MAVLink data from the Pixhawk board

Since R2022a

Add-On Required: This feature requires the UAV Toolbox Support Package for PX4 Autopilots add-on.

  • MAVLink Bridge Source

Libraries:
px4MAVLinkBridgelib

Description

The MAVLink Bridge Source block reads MAVLink data stream from the Pixhawk® board connected to the serial port and routes it to the Simulink® plant model and the configured UDP/TCP objects. This block allows you to configure Serial, UDP, and TCP connections.

To access the block, open the block library by entering the following command in the MATLAB® Command window.

px4MAVLinkBridgelib

The MAVLink Bridge Source and MAVLink Bridge Sink blocks provides a way to route MAVLink data stream from Pixhawk hardware to the mission planning software QGroundControl(QGC), On-board computer hardware, Simulink Plant, and vice versa in HITL workflow. For more information, see MAVLink Connectivity for QGC, On-board Computer and Simulink Plant.

Ports

Output

expand all

This port outputs the MAVLink data stream.

Data Types: uint8

This port outputs the length of the data stream for the current time setup.

Data Types: uint16

Parameters

expand all

Select a serial port to connect to the Pixhawk board. If the required ports are not available in the list, select Specify manually and enter the serial port in the Serial Port (specify manually) field.

Enter the maximum output data stream length.

Click Add to add the destination UDP/TCP connections for data routing. The existing connections ('UDP','127.0.0.1','14550') are used for connecting to QGC.

Specify the time interval at which the block reads values from the serial connections and routes it to the added UDP/TCP connections.

Version History

Introduced in R2022a