How can I communicate directly with MAVLink over telemetry radio?
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 9 Mai 2023
Réponse apportée : MathWorks Support Team
le 11 Mai 2023
I want to connect PX4 and MATLAB over MAVLink using a Holybro telemetry antenna without having to interface with QGroundControl. I want to transmit data such as heartbeat, monitoring, desired waypoints, and telemetry. Is this supported, and if so, how can I find and send data over the ports?
Réponse acceptée
MathWorks Support Team
le 9 Mai 2023
To connect via the Holybro antenna via MAVLink, telemetry radio would appear as a serial port on the host PC.
For reading MAVLink data using MATLAB:
1. Read the raw bytes using "serialport" and "read", as demonstrated in the following documentation:
2. Create a "mavlinkdialect" object for parsing messages, as described here:
3. Decode the uint8 buffer using "deserializemsg", demonstrated here:
For reading MAVLink data using Simulink:
1. Read serial port data using a "Serial Receive" block. Set the "COM port", "data length", and "sample time", as described below:
2. Parse the raw serial data into a Simulink bus using a "MAVLink Deserializer" block, as shown here:
Information on sending and reading data such as waypoints directly should be contained in the MAVLink Dialect XML file that you use. If using the dialect "common.xml", you can view this file by executing the following command from the MATLAB Command Window:
>> open common.xml
0 commentaires
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!