What problem does it solve?
Connecting MATLAB to a PX4 or ArduPilot flight controller over MAVLink involves a strict protocol sequence that is easy to get wrong: dialect creation, UDP transport setup, heartbeat construction, and client discovery must happen in the correct order, and common mistakes like wrong payload field access or incorrect port usage cause silent failures.
Core Features & Use Cases
- Correct Connection Sequence: Encodes the exact workflow for creating a MAVLink dialect, configuring the mavlinkio interface with GCS identity, and connecting over UDP with name-value arguments.
- Heartbeat Management: Covers both auto-discovery (autopilot already broadcasting) and manual initiation (sending heartbeats to a known SITL endpoint) with timer-based 1 Hz heartbeat patterns.
- Payload and Message Gotchas: Documents critical rules such as accessing fields via msg.Payload.fieldname(:) to preserve wire types and passing the dialect (not the io object) to createmsg.
- Use Case: You are building a MATLAB ground control station and need to connect to a PX4 SITL instance, exchange heartbeats, discover the autopilot client, and send an arm command.
Quick Start
Connect MATLAB to my PX4 SITL autopilot over MAVLink UDP and set up the GCS heartbeat.